From 820f55d192b59c534601cc7a910de28fb8d17aad Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 16 Sep 2025 00:29:53 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.615.2 --- .gitignore | 2 + .speakeasy/gen.lock | 697 +++- .speakeasy/gen.yaml | 12 +- .speakeasy/workflow.lock | 14 +- README.md | 170 +- RELEASES.md | 12 +- USAGE.md | 2 +- build.gradle | 17 +- codeSamples.yaml | 214 +- .../errors/AddPlaylistContentsBadRequest.md | 8 +- .../errors/AddPlaylistContentsUnauthorized.md | 8 +- docs/models/errors/ApplyUpdatesBadRequest.md | 8 +- .../models/errors/ApplyUpdatesUnauthorized.md | 8 +- .../CancelServerActivitiesBadRequest.md | 8 +- .../CancelServerActivitiesUnauthorized.md | 8 +- .../errors/CheckForUpdatesBadRequest.md | 8 +- .../errors/CheckForUpdatesUnauthorized.md | 8 +- .../errors/ClearPlaylistContentsBadRequest.md | 8 +- .../ClearPlaylistContentsUnauthorized.md | 8 +- .../models/errors/CreatePlaylistBadRequest.md | 8 +- .../errors/CreatePlaylistUnauthorized.md | 8 +- docs/models/errors/DeleteLibraryBadRequest.md | 8 +- .../errors/DeleteLibraryUnauthorized.md | 8 +- .../models/errors/DeletePlaylistBadRequest.md | 8 +- .../errors/DeletePlaylistUnauthorized.md | 8 +- .../errors/EnablePaperTrailBadRequest.md | 8 +- .../errors/EnablePaperTrailUnauthorized.md | 8 +- .../errors/GetActorsLibraryBadRequest.md | 8 +- .../errors/GetActorsLibraryUnauthorized.md | 8 +- .../errors/GetAllLibrariesBadRequest.md | 8 +- .../errors/GetAllLibrariesUnauthorized.md | 8 +- .../errors/GetAvailableClientsBadRequest.md | 8 +- .../errors/GetAvailableClientsUnauthorized.md | 8 +- .../GetBandwidthStatisticsBadRequest.md | 8 +- .../GetBandwidthStatisticsUnauthorized.md | 8 +- .../models/errors/GetBannerImageBadRequest.md | 8 +- .../errors/GetBannerImageUnauthorized.md | 8 +- .../models/errors/GetButlerTasksBadRequest.md | 8 +- .../errors/GetButlerTasksUnauthorized.md | 8 +- .../errors/GetCompanionsDataBadRequest.md | 8 +- .../errors/GetCompanionsDataUnauthorized.md | 8 +- .../errors/GetCountriesLibraryBadRequest.md | 8 +- .../errors/GetCountriesLibraryUnauthorized.md | 8 +- docs/models/errors/GetDevicesBadRequest.md | 8 +- docs/models/errors/GetDevicesUnauthorized.md | 8 +- docs/models/errors/GetFileHashBadRequest.md | 8 +- docs/models/errors/GetFileHashUnauthorized.md | 8 +- .../errors/GetGenresLibraryBadRequest.md | 8 +- .../errors/GetGenresLibraryUnauthorized.md | 8 +- docs/models/errors/GetGeoDataBadRequest.md | 8 +- docs/models/errors/GetGeoDataUnauthorized.md | 8 +- docs/models/errors/GetGlobalHubsBadRequest.md | 8 +- .../errors/GetGlobalHubsUnauthorized.md | 8 +- docs/models/errors/GetHomeDataBadRequest.md | 8 +- docs/models/errors/GetHomeDataUnauthorized.md | 8 +- .../errors/GetLibraryDetailsBadRequest.md | 8 +- .../errors/GetLibraryDetailsUnauthorized.md | 8 +- .../models/errors/GetLibraryHubsBadRequest.md | 8 +- .../errors/GetLibraryHubsUnauthorized.md | 8 +- .../errors/GetLibraryItemsBadRequest.md | 8 +- .../errors/GetLibraryItemsUnauthorized.md | 8 +- .../errors/GetLibrarySectionsAllBadRequest.md | 8 +- .../GetLibrarySectionsAllUnauthorized.md | 8 +- .../errors/GetMediaMetaDataBadRequest.md | 8 +- .../errors/GetMediaMetaDataUnauthorized.md | 8 +- .../errors/GetMediaProvidersBadRequest.md | 8 +- .../errors/GetMediaProvidersUnauthorized.md | 8 +- .../errors/GetMetadataChildrenBadRequest.md | 8 +- .../errors/GetMetadataChildrenUnauthorized.md | 8 +- .../errors/GetMyPlexAccountBadRequest.md | 8 +- .../errors/GetMyPlexAccountUnauthorized.md | 8 +- docs/models/errors/GetPinBadRequest.md | 8 +- docs/models/errors/GetPlaylistBadRequest.md | 8 +- .../errors/GetPlaylistContentsBadRequest.md | 8 +- .../errors/GetPlaylistContentsUnauthorized.md | 8 +- docs/models/errors/GetPlaylistUnauthorized.md | 8 +- docs/models/errors/GetPlaylistsBadRequest.md | 8 +- .../models/errors/GetPlaylistsUnauthorized.md | 8 +- .../GetRecentlyAddedLibraryBadRequest.md | 8 +- .../GetRecentlyAddedLibraryUnauthorized.md | 8 +- .../GetRefreshLibraryMetadataBadRequest.md | 8 +- .../GetRefreshLibraryMetadataUnauthorized.md | 8 +- .../errors/GetResizedPhotoBadRequest.md | 8 +- .../errors/GetResizedPhotoUnauthorized.md | 8 +- .../GetResourcesStatisticsBadRequest.md | 8 +- .../GetResourcesStatisticsUnauthorized.md | 8 +- .../errors/GetSearchAllLibrariesBadRequest.md | 8 +- .../GetSearchAllLibrariesUnauthorized.md | 8 +- .../errors/GetSearchLibraryBadRequest.md | 8 +- .../errors/GetSearchLibraryUnauthorized.md | 8 +- .../errors/GetSearchResultsBadRequest.md | 8 +- .../errors/GetSearchResultsUnauthorized.md | 8 +- .../errors/GetServerActivitiesBadRequest.md | 8 +- .../errors/GetServerActivitiesUnauthorized.md | 8 +- .../errors/GetServerCapabilitiesBadRequest.md | 8 +- .../GetServerCapabilitiesUnauthorized.md | 8 +- .../errors/GetServerIdentityRequestTimeout.md | 10 +- docs/models/errors/GetServerListBadRequest.md | 8 +- .../errors/GetServerListUnauthorized.md | 8 +- .../errors/GetServerPreferencesBadRequest.md | 8 +- .../GetServerPreferencesUnauthorized.md | 8 +- .../errors/GetServerResourcesBadRequest.md | 8 +- .../errors/GetServerResourcesUnauthorized.md | 8 +- .../errors/GetSessionHistoryBadRequest.md | 8 +- .../errors/GetSessionHistoryUnauthorized.md | 8 +- docs/models/errors/GetSessionsBadRequest.md | 8 +- docs/models/errors/GetSessionsUnauthorized.md | 8 +- ...etSourceConnectionInformationBadRequest.md | 8 +- ...SourceConnectionInformationUnauthorized.md | 2 +- docs/models/errors/GetStatisticsBadRequest.md | 8 +- .../errors/GetStatisticsUnauthorized.md | 8 +- docs/models/errors/GetThumbImageBadRequest.md | 8 +- .../errors/GetThumbImageUnauthorized.md | 8 +- docs/models/errors/GetTimelineBadRequest.md | 8 +- docs/models/errors/GetTimelineUnauthorized.md | 8 +- .../errors/GetTokenByPinIdBadRequest.md | 8 +- .../errors/GetTokenByPinIdResponseBody.md | 8 +- .../errors/GetTokenDetailsBadRequest.md | 8 +- .../errors/GetTokenDetailsUnauthorized.md | 8 +- .../errors/GetTopWatchedContentBadRequest.md | 8 +- .../GetTopWatchedContentUnauthorized.md | 8 +- .../errors/GetTranscodeSessionsBadRequest.md | 8 +- .../GetTranscodeSessionsUnauthorized.md | 8 +- .../errors/GetTransientTokenBadRequest.md | 8 +- .../errors/GetTransientTokenUnauthorized.md | 8 +- .../errors/GetUpdateStatusBadRequest.md | 8 +- .../errors/GetUpdateStatusUnauthorized.md | 8 +- .../models/errors/GetUserFriendsBadRequest.md | 8 +- .../errors/GetUserFriendsUnauthorized.md | 8 +- docs/models/errors/GetUsersBadRequest.md | 8 +- docs/models/errors/GetUsersUnauthorized.md | 8 +- docs/models/errors/GetWatchListBadRequest.md | 8 +- .../models/errors/GetWatchListUnauthorized.md | 8 +- docs/models/errors/LogLineBadRequest.md | 8 +- docs/models/errors/LogLineUnauthorized.md | 8 +- docs/models/errors/LogMultiLineBadRequest.md | 8 +- .../models/errors/LogMultiLineUnauthorized.md | 8 +- docs/models/errors/MarkPlayedBadRequest.md | 8 +- docs/models/errors/MarkPlayedUnauthorized.md | 8 +- docs/models/errors/MarkUnplayedBadRequest.md | 8 +- .../models/errors/MarkUnplayedUnauthorized.md | 8 +- docs/models/errors/PerformSearchBadRequest.md | 8 +- .../errors/PerformSearchUnauthorized.md | 8 +- .../errors/PerformVoiceSearchBadRequest.md | 8 +- .../errors/PerformVoiceSearchUnauthorized.md | 8 +- .../errors/PostUsersSignInDataBadRequest.md | 8 +- .../errors/PostUsersSignInDataUnauthorized.md | 8 +- docs/models/errors/StartAllTasksBadRequest.md | 8 +- .../errors/StartAllTasksUnauthorized.md | 8 +- docs/models/errors/StartTaskBadRequest.md | 8 +- docs/models/errors/StartTaskUnauthorized.md | 8 +- .../StartUniversalTranscodeBadRequest.md | 8 +- .../StartUniversalTranscodeUnauthorized.md | 8 +- docs/models/errors/StopAllTasksBadRequest.md | 8 +- .../models/errors/StopAllTasksUnauthorized.md | 8 +- docs/models/errors/StopTaskBadRequest.md | 8 +- docs/models/errors/StopTaskUnauthorized.md | 8 +- .../errors/StopTranscodeSessionBadRequest.md | 8 +- .../StopTranscodeSessionUnauthorized.md | 8 +- .../errors/UpdatePlayProgressBadRequest.md | 8 +- .../errors/UpdatePlayProgressUnauthorized.md | 8 +- .../models/errors/UpdatePlaylistBadRequest.md | 8 +- .../errors/UpdatePlaylistUnauthorized.md | 8 +- .../models/errors/UploadPlaylistBadRequest.md | 8 +- .../errors/UploadPlaylistUnauthorized.md | 8 +- .../operations/AddPlaylistContentsResponse.md | 12 +- .../models/operations/ApplyUpdatesResponse.md | 10 +- .../CancelServerActivitiesResponse.md | 10 +- .../operations/CheckForUpdatesResponse.md | 10 +- .../ClearPlaylistContentsResponse.md | 10 +- .../operations/CreatePlaylistResponse.md | 12 +- .../operations/DeleteLibraryResponse.md | 10 +- .../operations/DeletePlaylistResponse.md | 10 +- .../operations/EnablePaperTrailResponse.md | 10 +- .../operations/GetActorsLibraryResponse.md | 12 +- .../operations/GetAllLibrariesResponse.md | 12 +- .../operations/GetAvailableClientsResponse.md | 12 +- .../GetBandwidthStatisticsResponse.md | 12 +- .../operations/GetBannerImageResponse.md | 14 +- .../operations/GetButlerTasksResponse.md | 12 +- .../operations/GetCompanionsDataResponse.md | 12 +- .../operations/GetCountriesLibraryResponse.md | 12 +- docs/models/operations/GetDevicesResponse.md | 12 +- docs/models/operations/GetFileHashResponse.md | 10 +- .../operations/GetGenresLibraryResponse.md | 12 +- docs/models/operations/GetGeoDataResponse.md | 2 +- .../operations/GetGlobalHubsResponse.md | 12 +- docs/models/operations/GetHomeDataResponse.md | 12 +- .../operations/GetLibraryDetailsResponse.md | 12 +- .../operations/GetLibraryHubsResponse.md | 12 +- .../operations/GetLibraryItemsResponse.md | 12 +- .../GetLibrarySectionsAllResponse.md | 12 +- .../models/operations/GetMediaArtsResponse.md | 12 +- .../operations/GetMediaMetaDataResponse.md | 12 +- .../operations/GetMediaPostersResponse.md | 12 +- .../operations/GetMediaProvidersResponse.md | 12 +- .../operations/GetMetadataChildrenResponse.md | 12 +- .../operations/GetMyPlexAccountResponse.md | 12 +- docs/models/operations/GetPinResponse.md | 2 +- .../operations/GetPlaylistContentsResponse.md | 12 +- docs/models/operations/GetPlaylistResponse.md | 12 +- .../models/operations/GetPlaylistsResponse.md | 12 +- .../GetRecentlyAddedLibraryResponse.md | 12 +- .../operations/GetRecentlyAddedResponse.md | 12 +- .../GetRefreshLibraryMetadataResponse.md | 10 +- .../operations/GetResizedPhotoResponse.md | 10 +- .../GetResourcesStatisticsResponse.md | 12 +- .../GetSearchAllLibrariesResponse.md | 12 +- .../operations/GetSearchLibraryResponse.md | 12 +- .../operations/GetSearchResultsResponse.md | 12 +- .../operations/GetServerActivitiesResponse.md | 12 +- .../GetServerCapabilitiesResponse.md | 12 +- .../operations/GetServerIdentityResponse.md | 12 +- .../operations/GetServerListResponse.md | 12 +- .../GetServerPreferencesResponse.md | 12 +- .../operations/GetServerResourcesResponse.md | 12 +- .../operations/GetSessionHistoryResponse.md | 12 +- docs/models/operations/GetSessionsResponse.md | 12 +- .../GetSourceConnectionInformationResponse.md | 10 +- .../operations/GetStatisticsResponse.md | 12 +- .../operations/GetThumbImageResponse.md | 14 +- docs/models/operations/GetTimelineResponse.md | 10 +- .../operations/GetTokenByPinIdResponse.md | 2 +- .../operations/GetTokenDetailsResponse.md | 12 +- .../GetTopWatchedContentResponse.md | 12 +- .../GetTranscodeSessionsResponse.md | 12 +- .../operations/GetTransientTokenResponse.md | 10 +- .../operations/GetUpdateStatusResponse.md | 12 +- .../operations/GetUserFriendsResponse.md | 12 +- docs/models/operations/GetUsersResponse.md | 12 +- .../models/operations/GetWatchListResponse.md | 12 +- docs/models/operations/LogLineResponse.md | 10 +- .../models/operations/LogMultiLineResponse.md | 10 +- docs/models/operations/MarkPlayedResponse.md | 10 +- .../models/operations/MarkUnplayedResponse.md | 10 +- .../operations/PerformSearchResponse.md | 10 +- .../operations/PerformVoiceSearchResponse.md | 10 +- .../models/operations/PostMediaArtsRequest.md | 2 +- .../operations/PostMediaArtsResponse.md | 10 +- .../operations/PostMediaPosterRequest.md | 2 +- .../operations/PostMediaPosterResponse.md | 10 +- .../operations/PostUsersSignInDataResponse.md | 12 +- .../operations/StartAllTasksResponse.md | 10 +- docs/models/operations/StartTaskResponse.md | 10 +- .../StartUniversalTranscodeResponse.md | 10 +- .../models/operations/StopAllTasksResponse.md | 10 +- docs/models/operations/StopTaskResponse.md | 10 +- .../StopTranscodeSessionResponse.md | 10 +- .../operations/UpdatePlayProgressResponse.md | 10 +- .../operations/UpdatePlaylistResponse.md | 10 +- .../operations/UploadPlaylistResponse.md | 10 +- docs/sdks/activities/README.md | 6 +- docs/sdks/authentication/README.md | 10 +- docs/sdks/butler/README.md | 15 +- docs/sdks/hubs/README.md | 9 +- docs/sdks/library/README.md | 68 +- docs/sdks/log/README.md | 9 +- docs/sdks/media/README.md | 21 +- docs/sdks/playlists/README.md | 29 +- docs/sdks/plex/README.md | 15 +- docs/sdks/search/README.md | 13 +- docs/sdks/server/README.md | 31 +- docs/sdks/sessions/README.md | 12 +- docs/sdks/statistics/README.md | 9 +- docs/sdks/updater/README.md | 9 +- docs/sdks/users/README.md | 1 + docs/sdks/video/README.md | 42 +- docs/sdks/watchlist/README.md | 3 +- docs/utils/Blob.md | 195 + gradle.properties | 3 +- gradle/wrapper/gradle-wrapper.jar | Bin 43462 -> 43764 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 12 +- gradlew.bat | 26 +- src/main/java/dev/plexapi/sdk/Activities.java | 332 +- .../java/dev/plexapi/sdk/AsyncActivities.java | 104 + .../dev/plexapi/sdk/AsyncAuthentication.java | 197 + .../java/dev/plexapi/sdk/AsyncButler.java | 209 ++ src/main/java/dev/plexapi/sdk/AsyncHubs.java | 169 + .../java/dev/plexapi/sdk/AsyncLibrary.java | 1103 ++++++ src/main/java/dev/plexapi/sdk/AsyncLog.java | 181 + src/main/java/dev/plexapi/sdk/AsyncMedia.java | 208 ++ .../java/dev/plexapi/sdk/AsyncPlaylists.java | 449 +++ src/main/java/dev/plexapi/sdk/AsyncPlex.java | 339 ++ .../java/dev/plexapi/sdk/AsyncPlexAPI.java | 254 ++ .../java/dev/plexapi/sdk/AsyncSearch.java | 220 ++ .../java/dev/plexapi/sdk/AsyncServer.java | 303 ++ .../java/dev/plexapi/sdk/AsyncSessions.java | 192 + .../java/dev/plexapi/sdk/AsyncStatistics.java | 180 + .../java/dev/plexapi/sdk/AsyncUpdater.java | 162 + src/main/java/dev/plexapi/sdk/AsyncUsers.java | 75 + src/main/java/dev/plexapi/sdk/AsyncVideo.java | 93 + .../java/dev/plexapi/sdk/AsyncWatchlist.java | 77 + .../java/dev/plexapi/sdk/Authentication.java | 694 +--- src/main/java/dev/plexapi/sdk/Butler.java | 768 +--- src/main/java/dev/plexapi/sdk/Hubs.java | 496 +-- src/main/java/dev/plexapi/sdk/Library.java | 3190 +---------------- src/main/java/dev/plexapi/sdk/Log.java | 487 +-- src/main/java/dev/plexapi/sdk/Media.java | 817 +---- src/main/java/dev/plexapi/sdk/Playlists.java | 1467 +------- src/main/java/dev/plexapi/sdk/Plex.java | 1224 +------ src/main/java/dev/plexapi/sdk/PlexAPI.java | 40 +- .../dev/plexapi/sdk/SDKConfiguration.java | 33 +- src/main/java/dev/plexapi/sdk/Search.java | 504 +-- src/main/java/dev/plexapi/sdk/Server.java | 1406 +------- src/main/java/dev/plexapi/sdk/Sessions.java | 658 +--- src/main/java/dev/plexapi/sdk/Statistics.java | 525 +-- src/main/java/dev/plexapi/sdk/Updater.java | 492 +-- src/main/java/dev/plexapi/sdk/Users.java | 198 +- src/main/java/dev/plexapi/sdk/Video.java | 334 +- src/main/java/dev/plexapi/sdk/Watchlist.java | 217 +- .../java/dev/plexapi/sdk/hooks/SDKHooks.java | 34 +- .../errors/AddPlaylistContentsBadRequest.java | 37 +- .../errors/AddPlaylistContentsErrors.java | 47 +- .../AddPlaylistContentsPlaylistsErrors.java | 47 +- .../AddPlaylistContentsUnauthorized.java | 37 +- .../models/errors/ApplyUpdatesBadRequest.java | 37 +- .../sdk/models/errors/ApplyUpdatesErrors.java | 47 +- .../errors/ApplyUpdatesUnauthorized.java | 37 +- .../errors/ApplyUpdatesUpdaterErrors.java | 47 +- ...ancelServerActivitiesActivitiesErrors.java | 47 +- .../CancelServerActivitiesBadRequest.java | 37 +- .../errors/CancelServerActivitiesErrors.java | 47 +- .../CancelServerActivitiesUnauthorized.java | 37 +- .../errors/CheckForUpdatesBadRequest.java | 37 +- .../models/errors/CheckForUpdatesErrors.java | 47 +- .../errors/CheckForUpdatesUnauthorized.java | 37 +- .../errors/CheckForUpdatesUpdaterErrors.java | 47 +- .../ClearPlaylistContentsBadRequest.java | 37 +- .../errors/ClearPlaylistContentsErrors.java | 47 +- .../ClearPlaylistContentsPlaylistsErrors.java | 47 +- .../ClearPlaylistContentsUnauthorized.java | 37 +- .../errors/CreatePlaylistBadRequest.java | 37 +- .../models/errors/CreatePlaylistErrors.java | 47 +- .../errors/CreatePlaylistPlaylistsErrors.java | 47 +- .../errors/CreatePlaylistUnauthorized.java | 37 +- .../errors/DeleteLibraryBadRequest.java | 37 +- .../models/errors/DeleteLibraryErrors.java | 47 +- .../errors/DeleteLibraryLibraryErrors.java | 47 +- .../errors/DeleteLibraryUnauthorized.java | 37 +- .../errors/DeletePlaylistBadRequest.java | 37 +- .../models/errors/DeletePlaylistErrors.java | 47 +- .../errors/DeletePlaylistPlaylistsErrors.java | 47 +- .../errors/DeletePlaylistUnauthorized.java | 37 +- .../errors/EnablePaperTrailBadRequest.java | 37 +- .../models/errors/EnablePaperTrailErrors.java | 47 +- .../errors/EnablePaperTrailLogErrors.java | 47 +- .../errors/EnablePaperTrailUnauthorized.java | 37 +- .../dev/plexapi/sdk/models/errors/Errors.java | 47 +- .../errors/GetActorsLibraryBadRequest.java | 37 +- .../models/errors/GetActorsLibraryErrors.java | 47 +- .../errors/GetActorsLibraryLibraryErrors.java | 47 +- .../errors/GetActorsLibraryUnauthorized.java | 37 +- .../errors/GetAllLibrariesBadRequest.java | 37 +- .../models/errors/GetAllLibrariesErrors.java | 47 +- .../errors/GetAllLibrariesLibraryErrors.java | 47 +- .../errors/GetAllLibrariesUnauthorized.java | 37 +- .../errors/GetAvailableClientsBadRequest.java | 37 +- .../errors/GetAvailableClientsErrors.java | 47 +- .../GetAvailableClientsServerErrors.java | 47 +- .../GetAvailableClientsUnauthorized.java | 37 +- .../GetBandwidthStatisticsBadRequest.java | 37 +- .../errors/GetBandwidthStatisticsErrors.java | 47 +- ...etBandwidthStatisticsStatisticsErrors.java | 47 +- .../GetBandwidthStatisticsUnauthorized.java | 37 +- .../errors/GetBannerImageBadRequest.java | 37 +- .../models/errors/GetBannerImageErrors.java | 47 +- .../errors/GetBannerImageMediaErrors.java | 47 +- .../errors/GetBannerImageUnauthorized.java | 37 +- .../errors/GetButlerTasksBadRequest.java | 37 +- .../errors/GetButlerTasksButlerErrors.java | 47 +- .../models/errors/GetButlerTasksErrors.java | 47 +- .../errors/GetButlerTasksUnauthorized.java | 37 +- .../errors/GetCompanionsDataBadRequest.java | 37 +- .../errors/GetCompanionsDataErrors.java | 47 +- .../errors/GetCompanionsDataPlexErrors.java | 47 +- .../errors/GetCompanionsDataUnauthorized.java | 37 +- .../errors/GetCountriesLibraryBadRequest.java | 37 +- .../errors/GetCountriesLibraryErrors.java | 47 +- .../GetCountriesLibraryLibraryErrors.java | 47 +- .../GetCountriesLibraryUnauthorized.java | 37 +- .../models/errors/GetDevicesBadRequest.java | 37 +- .../sdk/models/errors/GetDevicesErrors.java | 47 +- .../models/errors/GetDevicesServerErrors.java | 47 +- .../models/errors/GetDevicesUnauthorized.java | 37 +- .../models/errors/GetFileHashBadRequest.java | 37 +- .../sdk/models/errors/GetFileHashErrors.java | 47 +- .../errors/GetFileHashLibraryErrors.java | 47 +- .../errors/GetFileHashUnauthorized.java | 37 +- .../errors/GetGenresLibraryBadRequest.java | 37 +- .../models/errors/GetGenresLibraryErrors.java | 47 +- .../errors/GetGenresLibraryLibraryErrors.java | 47 +- .../errors/GetGenresLibraryUnauthorized.java | 37 +- .../models/errors/GetGeoDataBadRequest.java | 37 +- .../sdk/models/errors/GetGeoDataErrors.java | 47 +- .../models/errors/GetGeoDataPlexErrors.java | 47 +- .../models/errors/GetGeoDataUnauthorized.java | 37 +- .../errors/GetGlobalHubsBadRequest.java | 37 +- .../models/errors/GetGlobalHubsErrors.java | 47 +- .../errors/GetGlobalHubsHubsErrors.java | 47 +- .../errors/GetGlobalHubsUnauthorized.java | 37 +- .../models/errors/GetHomeDataBadRequest.java | 37 +- .../sdk/models/errors/GetHomeDataErrors.java | 47 +- .../models/errors/GetHomeDataPlexErrors.java | 47 +- .../errors/GetHomeDataUnauthorized.java | 37 +- .../errors/GetLibraryDetailsBadRequest.java | 37 +- .../errors/GetLibraryDetailsErrors.java | 47 +- .../GetLibraryDetailsLibraryErrors.java | 47 +- .../errors/GetLibraryDetailsUnauthorized.java | 37 +- .../errors/GetLibraryHubsBadRequest.java | 37 +- .../models/errors/GetLibraryHubsErrors.java | 47 +- .../errors/GetLibraryHubsHubsErrors.java | 47 +- .../errors/GetLibraryHubsUnauthorized.java | 37 +- .../errors/GetLibraryItemsBadRequest.java | 37 +- .../models/errors/GetLibraryItemsErrors.java | 47 +- .../errors/GetLibraryItemsLibraryErrors.java | 47 +- .../errors/GetLibraryItemsUnauthorized.java | 37 +- .../GetLibrarySectionsAllBadRequest.java | 37 +- .../errors/GetLibrarySectionsAllErrors.java | 47 +- .../GetLibrarySectionsAllLibraryErrors.java | 47 +- .../GetLibrarySectionsAllUnauthorized.java | 37 +- .../errors/GetMediaMetaDataBadRequest.java | 37 +- .../models/errors/GetMediaMetaDataErrors.java | 47 +- .../errors/GetMediaMetaDataLibraryErrors.java | 47 +- .../errors/GetMediaMetaDataUnauthorized.java | 37 +- .../errors/GetMediaProvidersBadRequest.java | 37 +- .../errors/GetMediaProvidersErrors.java | 47 +- .../errors/GetMediaProvidersServerErrors.java | 47 +- .../errors/GetMediaProvidersUnauthorized.java | 37 +- .../errors/GetMetadataChildrenBadRequest.java | 37 +- .../errors/GetMetadataChildrenErrors.java | 47 +- .../GetMetadataChildrenLibraryErrors.java | 47 +- .../GetMetadataChildrenUnauthorized.java | 37 +- .../errors/GetMyPlexAccountBadRequest.java | 37 +- .../models/errors/GetMyPlexAccountErrors.java | 47 +- .../errors/GetMyPlexAccountServerErrors.java | 47 +- .../errors/GetMyPlexAccountUnauthorized.java | 37 +- .../sdk/models/errors/GetPinBadRequest.java | 37 +- .../sdk/models/errors/GetPinErrors.java | 47 +- .../models/errors/GetPlaylistBadRequest.java | 37 +- .../errors/GetPlaylistContentsBadRequest.java | 37 +- .../errors/GetPlaylistContentsErrors.java | 47 +- .../GetPlaylistContentsPlaylistsErrors.java | 47 +- .../GetPlaylistContentsUnauthorized.java | 37 +- .../sdk/models/errors/GetPlaylistErrors.java | 47 +- .../errors/GetPlaylistPlaylistsErrors.java | 47 +- .../errors/GetPlaylistUnauthorized.java | 37 +- .../models/errors/GetPlaylistsBadRequest.java | 37 +- .../sdk/models/errors/GetPlaylistsErrors.java | 47 +- .../errors/GetPlaylistsPlaylistsErrors.java | 47 +- .../errors/GetPlaylistsUnauthorized.java | 37 +- .../GetRecentlyAddedLibraryBadRequest.java | 37 +- .../errors/GetRecentlyAddedLibraryErrors.java | 47 +- .../GetRecentlyAddedLibraryLibraryErrors.java | 47 +- .../GetRecentlyAddedLibraryUnauthorized.java | 37 +- .../GetRefreshLibraryMetadataBadRequest.java | 37 +- .../GetRefreshLibraryMetadataErrors.java | 47 +- ...etRefreshLibraryMetadataLibraryErrors.java | 47 +- ...GetRefreshLibraryMetadataUnauthorized.java | 37 +- .../errors/GetResizedPhotoBadRequest.java | 37 +- .../models/errors/GetResizedPhotoErrors.java | 47 +- .../errors/GetResizedPhotoServerErrors.java | 47 +- .../errors/GetResizedPhotoUnauthorized.java | 37 +- .../GetResourcesStatisticsBadRequest.java | 37 +- .../errors/GetResourcesStatisticsErrors.java | 47 +- ...etResourcesStatisticsStatisticsErrors.java | 47 +- .../GetResourcesStatisticsUnauthorized.java | 37 +- .../GetSearchAllLibrariesBadRequest.java | 37 +- .../errors/GetSearchAllLibrariesErrors.java | 47 +- .../GetSearchAllLibrariesLibraryErrors.java | 47 +- .../GetSearchAllLibrariesUnauthorized.java | 37 +- .../errors/GetSearchLibraryBadRequest.java | 37 +- .../models/errors/GetSearchLibraryErrors.java | 47 +- .../errors/GetSearchLibraryLibraryErrors.java | 47 +- .../errors/GetSearchLibraryUnauthorized.java | 37 +- .../errors/GetSearchResultsBadRequest.java | 37 +- .../models/errors/GetSearchResultsErrors.java | 47 +- .../errors/GetSearchResultsSearchErrors.java | 47 +- .../errors/GetSearchResultsUnauthorized.java | 37 +- .../GetServerActivitiesActivitiesErrors.java | 47 +- .../errors/GetServerActivitiesBadRequest.java | 37 +- .../errors/GetServerActivitiesErrors.java | 47 +- .../GetServerActivitiesUnauthorized.java | 37 +- .../GetServerCapabilitiesBadRequest.java | 37 +- .../errors/GetServerCapabilitiesErrors.java | 47 +- .../GetServerCapabilitiesUnauthorized.java | 37 +- .../GetServerIdentityRequestTimeout.java | 47 +- .../errors/GetServerListBadRequest.java | 37 +- .../models/errors/GetServerListErrors.java | 47 +- .../errors/GetServerListServerErrors.java | 47 +- .../errors/GetServerListUnauthorized.java | 37 +- .../GetServerPreferencesBadRequest.java | 37 +- .../errors/GetServerPreferencesErrors.java | 47 +- .../GetServerPreferencesServerErrors.java | 47 +- .../GetServerPreferencesUnauthorized.java | 37 +- .../errors/GetServerResourcesBadRequest.java | 37 +- .../errors/GetServerResourcesErrors.java | 47 +- .../errors/GetServerResourcesPlexErrors.java | 47 +- .../GetServerResourcesUnauthorized.java | 37 +- .../errors/GetSessionHistoryBadRequest.java | 37 +- .../errors/GetSessionHistoryErrors.java | 47 +- .../GetSessionHistorySessionsErrors.java | 47 +- .../errors/GetSessionHistoryUnauthorized.java | 37 +- .../models/errors/GetSessionsBadRequest.java | 37 +- .../sdk/models/errors/GetSessionsErrors.java | 47 +- .../errors/GetSessionsSessionsErrors.java | 47 +- .../errors/GetSessionsUnauthorized.java | 37 +- ...ectionInformationAuthenticationErrors.java | 47 +- ...SourceConnectionInformationBadRequest.java | 37 +- .../GetSourceConnectionInformationErrors.java | 47 +- ...urceConnectionInformationUnauthorized.java | 37 +- .../errors/GetStatisticsBadRequest.java | 37 +- .../models/errors/GetStatisticsErrors.java | 47 +- .../errors/GetStatisticsStatisticsErrors.java | 47 +- .../errors/GetStatisticsUnauthorized.java | 37 +- .../errors/GetThumbImageBadRequest.java | 37 +- .../models/errors/GetThumbImageErrors.java | 47 +- .../errors/GetThumbImageMediaErrors.java | 47 +- .../errors/GetThumbImageUnauthorized.java | 37 +- .../models/errors/GetTimelineBadRequest.java | 37 +- .../sdk/models/errors/GetTimelineErrors.java | 47 +- .../errors/GetTimelineUnauthorized.java | 37 +- .../models/errors/GetTimelineVideoErrors.java | 47 +- .../errors/GetTokenByPinIdBadRequest.java | 37 +- .../models/errors/GetTokenByPinIdErrors.java | 47 +- .../errors/GetTokenByPinIdPlexErrors.java | 38 +- .../errors/GetTokenByPinIdResponseBody.java | 37 +- .../GetTokenDetailsAuthenticationErrors.java | 47 +- .../errors/GetTokenDetailsBadRequest.java | 37 +- .../models/errors/GetTokenDetailsErrors.java | 47 +- .../errors/GetTokenDetailsUnauthorized.java | 37 +- .../GetTopWatchedContentBadRequest.java | 37 +- .../errors/GetTopWatchedContentErrors.java | 47 +- .../GetTopWatchedContentLibraryErrors.java | 47 +- .../GetTopWatchedContentUnauthorized.java | 37 +- .../GetTranscodeSessionsBadRequest.java | 37 +- .../errors/GetTranscodeSessionsErrors.java | 47 +- .../GetTranscodeSessionsSessionsErrors.java | 47 +- .../GetTranscodeSessionsUnauthorized.java | 37 +- ...GetTransientTokenAuthenticationErrors.java | 47 +- .../errors/GetTransientTokenBadRequest.java | 37 +- .../errors/GetTransientTokenErrors.java | 47 +- .../errors/GetTransientTokenUnauthorized.java | 37 +- .../errors/GetUpdateStatusBadRequest.java | 37 +- .../models/errors/GetUpdateStatusErrors.java | 47 +- .../errors/GetUpdateStatusUnauthorized.java | 37 +- .../errors/GetUpdateStatusUpdaterErrors.java | 47 +- .../errors/GetUserFriendsBadRequest.java | 37 +- .../models/errors/GetUserFriendsErrors.java | 47 +- .../errors/GetUserFriendsPlexErrors.java | 47 +- .../errors/GetUserFriendsUnauthorized.java | 37 +- .../sdk/models/errors/GetUsersBadRequest.java | 37 +- .../sdk/models/errors/GetUsersErrors.java | 47 +- .../models/errors/GetUsersUnauthorized.java | 37 +- .../models/errors/GetUsersUsersErrors.java | 47 +- .../models/errors/GetWatchListBadRequest.java | 37 +- .../sdk/models/errors/GetWatchListErrors.java | 47 +- .../errors/GetWatchListUnauthorized.java | 37 +- .../errors/GetWatchListWatchlistErrors.java | 47 +- .../sdk/models/errors/LogLineBadRequest.java | 37 +- .../sdk/models/errors/LogLineErrors.java | 47 +- .../sdk/models/errors/LogLineLogErrors.java | 47 +- .../models/errors/LogLineUnauthorized.java | 37 +- .../models/errors/LogMultiLineBadRequest.java | 37 +- .../sdk/models/errors/LogMultiLineErrors.java | 47 +- .../models/errors/LogMultiLineLogErrors.java | 47 +- .../errors/LogMultiLineUnauthorized.java | 37 +- .../models/errors/MarkPlayedBadRequest.java | 37 +- .../sdk/models/errors/MarkPlayedErrors.java | 47 +- .../models/errors/MarkPlayedMediaErrors.java | 47 +- .../models/errors/MarkPlayedUnauthorized.java | 37 +- .../models/errors/MarkUnplayedBadRequest.java | 37 +- .../sdk/models/errors/MarkUnplayedErrors.java | 47 +- .../errors/MarkUnplayedMediaErrors.java | 47 +- .../errors/MarkUnplayedUnauthorized.java | 37 +- .../errors/PerformSearchBadRequest.java | 37 +- .../models/errors/PerformSearchErrors.java | 47 +- .../errors/PerformSearchSearchErrors.java | 47 +- .../errors/PerformSearchUnauthorized.java | 37 +- .../errors/PerformVoiceSearchBadRequest.java | 37 +- .../errors/PerformVoiceSearchErrors.java | 47 +- .../PerformVoiceSearchSearchErrors.java | 47 +- .../PerformVoiceSearchUnauthorized.java | 37 +- ...stUsersSignInDataAuthenticationErrors.java | 47 +- .../errors/PostUsersSignInDataBadRequest.java | 37 +- .../errors/PostUsersSignInDataErrors.java | 47 +- .../PostUsersSignInDataUnauthorized.java | 37 +- .../plexapi/sdk/models/errors/SDKError.java | 14 +- .../errors/StartAllTasksBadRequest.java | 37 +- .../errors/StartAllTasksButlerErrors.java | 47 +- .../models/errors/StartAllTasksErrors.java | 47 +- .../errors/StartAllTasksUnauthorized.java | 37 +- .../models/errors/StartTaskBadRequest.java | 37 +- .../models/errors/StartTaskButlerErrors.java | 47 +- .../sdk/models/errors/StartTaskErrors.java | 47 +- .../models/errors/StartTaskUnauthorized.java | 37 +- .../StartUniversalTranscodeBadRequest.java | 37 +- .../errors/StartUniversalTranscodeErrors.java | 47 +- .../StartUniversalTranscodeUnauthorized.java | 37 +- .../StartUniversalTranscodeVideoErrors.java | 47 +- .../models/errors/StopAllTasksBadRequest.java | 37 +- .../errors/StopAllTasksButlerErrors.java | 47 +- .../sdk/models/errors/StopAllTasksErrors.java | 47 +- .../errors/StopAllTasksUnauthorized.java | 37 +- .../sdk/models/errors/StopTaskBadRequest.java | 37 +- .../models/errors/StopTaskButlerErrors.java | 47 +- .../sdk/models/errors/StopTaskErrors.java | 47 +- .../models/errors/StopTaskUnauthorized.java | 37 +- .../StopTranscodeSessionBadRequest.java | 37 +- .../errors/StopTranscodeSessionErrors.java | 47 +- .../StopTranscodeSessionSessionsErrors.java | 47 +- .../StopTranscodeSessionUnauthorized.java | 37 +- .../sdk/models/errors/UncheckedSDKError.java | 93 + .../errors/UpdatePlayProgressBadRequest.java | 37 +- .../errors/UpdatePlayProgressErrors.java | 47 +- .../errors/UpdatePlayProgressMediaErrors.java | 47 +- .../UpdatePlayProgressUnauthorized.java | 37 +- .../errors/UpdatePlaylistBadRequest.java | 37 +- .../models/errors/UpdatePlaylistErrors.java | 47 +- .../errors/UpdatePlaylistPlaylistsErrors.java | 47 +- .../errors/UpdatePlaylistUnauthorized.java | 37 +- .../errors/UploadPlaylistBadRequest.java | 37 +- .../models/errors/UploadPlaylistErrors.java | 47 +- .../errors/UploadPlaylistPlaylistsErrors.java | 47 +- .../errors/UploadPlaylistUnauthorized.java | 37 +- .../async/AddPlaylistContentsBadRequest.java | 186 + .../AddPlaylistContentsUnauthorized.java | 186 + .../errors/async/ApplyUpdatesBadRequest.java | 186 + .../async/ApplyUpdatesUnauthorized.java | 186 + .../CancelServerActivitiesBadRequest.java | 186 + .../CancelServerActivitiesUnauthorized.java | 186 + .../async/CheckForUpdatesBadRequest.java | 186 + .../async/CheckForUpdatesUnauthorized.java | 186 + .../ClearPlaylistContentsBadRequest.java | 186 + .../ClearPlaylistContentsUnauthorized.java | 186 + .../async/CreatePlaylistBadRequest.java | 186 + .../async/CreatePlaylistUnauthorized.java | 186 + .../errors/async/DeleteLibraryBadRequest.java | 186 + .../async/DeleteLibraryUnauthorized.java | 186 + .../async/DeletePlaylistBadRequest.java | 186 + .../async/DeletePlaylistUnauthorized.java | 186 + .../async/EnablePaperTrailBadRequest.java | 186 + .../async/EnablePaperTrailUnauthorized.java | 186 + .../async/GetActorsLibraryBadRequest.java | 186 + .../async/GetActorsLibraryUnauthorized.java | 186 + .../async/GetAllLibrariesBadRequest.java | 186 + .../async/GetAllLibrariesUnauthorized.java | 186 + .../async/GetAvailableClientsBadRequest.java | 186 + .../GetAvailableClientsUnauthorized.java | 186 + .../GetBandwidthStatisticsBadRequest.java | 186 + .../GetBandwidthStatisticsUnauthorized.java | 186 + .../async/GetBannerImageBadRequest.java | 186 + .../async/GetBannerImageUnauthorized.java | 186 + .../async/GetButlerTasksBadRequest.java | 186 + .../async/GetButlerTasksUnauthorized.java | 186 + .../async/GetCompanionsDataBadRequest.java | 186 + .../async/GetCompanionsDataUnauthorized.java | 186 + .../async/GetCountriesLibraryBadRequest.java | 186 + .../GetCountriesLibraryUnauthorized.java | 186 + .../errors/async/GetDevicesBadRequest.java | 186 + .../errors/async/GetDevicesUnauthorized.java | 186 + .../errors/async/GetFileHashBadRequest.java | 186 + .../errors/async/GetFileHashUnauthorized.java | 186 + .../async/GetGenresLibraryBadRequest.java | 186 + .../async/GetGenresLibraryUnauthorized.java | 186 + .../errors/async/GetGeoDataBadRequest.java | 186 + .../errors/async/GetGeoDataUnauthorized.java | 186 + .../errors/async/GetGlobalHubsBadRequest.java | 186 + .../async/GetGlobalHubsUnauthorized.java | 186 + .../errors/async/GetHomeDataBadRequest.java | 186 + .../errors/async/GetHomeDataUnauthorized.java | 186 + .../async/GetLibraryDetailsBadRequest.java | 186 + .../async/GetLibraryDetailsUnauthorized.java | 186 + .../async/GetLibraryHubsBadRequest.java | 186 + .../async/GetLibraryHubsUnauthorized.java | 186 + .../async/GetLibraryItemsBadRequest.java | 186 + .../async/GetLibraryItemsUnauthorized.java | 186 + .../GetLibrarySectionsAllBadRequest.java | 186 + .../GetLibrarySectionsAllUnauthorized.java | 186 + .../async/GetMediaMetaDataBadRequest.java | 186 + .../async/GetMediaMetaDataUnauthorized.java | 186 + .../async/GetMediaProvidersBadRequest.java | 186 + .../async/GetMediaProvidersUnauthorized.java | 186 + .../async/GetMetadataChildrenBadRequest.java | 186 + .../GetMetadataChildrenUnauthorized.java | 186 + .../async/GetMyPlexAccountBadRequest.java | 186 + .../async/GetMyPlexAccountUnauthorized.java | 186 + .../models/errors/async/GetPinBadRequest.java | 186 + .../errors/async/GetPlaylistBadRequest.java | 186 + .../async/GetPlaylistContentsBadRequest.java | 186 + .../GetPlaylistContentsUnauthorized.java | 186 + .../errors/async/GetPlaylistUnauthorized.java | 186 + .../errors/async/GetPlaylistsBadRequest.java | 186 + .../async/GetPlaylistsUnauthorized.java | 186 + .../GetRecentlyAddedLibraryBadRequest.java | 186 + .../GetRecentlyAddedLibraryUnauthorized.java | 186 + .../GetRefreshLibraryMetadataBadRequest.java | 186 + ...GetRefreshLibraryMetadataUnauthorized.java | 186 + .../async/GetResizedPhotoBadRequest.java | 186 + .../async/GetResizedPhotoUnauthorized.java | 186 + .../GetResourcesStatisticsBadRequest.java | 186 + .../GetResourcesStatisticsUnauthorized.java | 186 + .../GetSearchAllLibrariesBadRequest.java | 186 + .../GetSearchAllLibrariesUnauthorized.java | 186 + .../async/GetSearchLibraryBadRequest.java | 186 + .../async/GetSearchLibraryUnauthorized.java | 186 + .../async/GetSearchResultsBadRequest.java | 186 + .../async/GetSearchResultsUnauthorized.java | 186 + .../async/GetServerActivitiesBadRequest.java | 186 + .../GetServerActivitiesUnauthorized.java | 186 + .../GetServerCapabilitiesBadRequest.java | 186 + .../GetServerCapabilitiesUnauthorized.java | 186 + .../GetServerIdentityRequestTimeout.java | 233 ++ .../errors/async/GetServerListBadRequest.java | 186 + .../async/GetServerListUnauthorized.java | 186 + .../async/GetServerPreferencesBadRequest.java | 186 + .../GetServerPreferencesUnauthorized.java | 186 + .../async/GetServerResourcesBadRequest.java | 186 + .../async/GetServerResourcesUnauthorized.java | 186 + .../async/GetSessionHistoryBadRequest.java | 186 + .../async/GetSessionHistoryUnauthorized.java | 186 + .../errors/async/GetSessionsBadRequest.java | 186 + .../errors/async/GetSessionsUnauthorized.java | 186 + ...SourceConnectionInformationBadRequest.java | 186 + ...urceConnectionInformationUnauthorized.java | 186 + .../errors/async/GetStatisticsBadRequest.java | 186 + .../async/GetStatisticsUnauthorized.java | 186 + .../errors/async/GetThumbImageBadRequest.java | 186 + .../async/GetThumbImageUnauthorized.java | 186 + .../errors/async/GetTimelineBadRequest.java | 186 + .../errors/async/GetTimelineUnauthorized.java | 186 + .../async/GetTokenByPinIdBadRequest.java | 186 + .../async/GetTokenByPinIdResponseBody.java | 186 + .../async/GetTokenDetailsBadRequest.java | 186 + .../async/GetTokenDetailsUnauthorized.java | 186 + .../async/GetTopWatchedContentBadRequest.java | 186 + .../GetTopWatchedContentUnauthorized.java | 186 + .../async/GetTranscodeSessionsBadRequest.java | 186 + .../GetTranscodeSessionsUnauthorized.java | 186 + .../async/GetTransientTokenBadRequest.java | 186 + .../async/GetTransientTokenUnauthorized.java | 186 + .../async/GetUpdateStatusBadRequest.java | 186 + .../async/GetUpdateStatusUnauthorized.java | 186 + .../async/GetUserFriendsBadRequest.java | 186 + .../async/GetUserFriendsUnauthorized.java | 186 + .../errors/async/GetUsersBadRequest.java | 186 + .../errors/async/GetUsersUnauthorized.java | 186 + .../errors/async/GetWatchListBadRequest.java | 186 + .../async/GetWatchListUnauthorized.java | 186 + .../errors/async/LogLineBadRequest.java | 186 + .../errors/async/LogLineUnauthorized.java | 186 + .../errors/async/LogMultiLineBadRequest.java | 186 + .../async/LogMultiLineUnauthorized.java | 186 + .../errors/async/MarkPlayedBadRequest.java | 186 + .../errors/async/MarkPlayedUnauthorized.java | 186 + .../errors/async/MarkUnplayedBadRequest.java | 186 + .../async/MarkUnplayedUnauthorized.java | 186 + .../errors/async/PerformSearchBadRequest.java | 186 + .../async/PerformSearchUnauthorized.java | 186 + .../async/PerformVoiceSearchBadRequest.java | 186 + .../async/PerformVoiceSearchUnauthorized.java | 186 + .../async/PostUsersSignInDataBadRequest.java | 186 + .../PostUsersSignInDataUnauthorized.java | 186 + .../errors/async/StartAllTasksBadRequest.java | 186 + .../async/StartAllTasksUnauthorized.java | 186 + .../errors/async/StartTaskBadRequest.java | 186 + .../errors/async/StartTaskUnauthorized.java | 186 + .../StartUniversalTranscodeBadRequest.java | 186 + .../StartUniversalTranscodeUnauthorized.java | 186 + .../errors/async/StopAllTasksBadRequest.java | 186 + .../async/StopAllTasksUnauthorized.java | 186 + .../errors/async/StopTaskBadRequest.java | 186 + .../errors/async/StopTaskUnauthorized.java | 186 + .../async/StopTranscodeSessionBadRequest.java | 186 + .../StopTranscodeSessionUnauthorized.java | 186 + .../async/UpdatePlayProgressBadRequest.java | 186 + .../async/UpdatePlayProgressUnauthorized.java | 186 + .../async/UpdatePlaylistBadRequest.java | 186 + .../async/UpdatePlaylistUnauthorized.java | 186 + .../async/UploadPlaylistBadRequest.java | 186 + .../async/UploadPlaylistUnauthorized.java | 186 + .../sdk/models/operations/Account.java | 100 +- .../plexapi/sdk/models/operations/Action.java | 36 +- .../models/operations/ActiveDirection.java | 2 +- .../sdk/models/operations/Activity.java | 100 +- .../AddPlaylistContentsMediaContainer.java | 57 +- .../AddPlaylistContentsMetadata.java | 147 +- .../AddPlaylistContentsRequest.java | 44 +- .../AddPlaylistContentsRequestBuilder.java | 27 +- .../AddPlaylistContentsResponse.java | 52 +- .../AddPlaylistContentsResponseBody.java | 24 +- .../sdk/models/operations/AllLibraries.java | 2 +- .../models/operations/AllowCameraUpload.java | 2 +- .../sdk/models/operations/AllowChannels.java | 2 +- .../models/operations/AllowSubtitleAdmin.java | 2 +- .../sdk/models/operations/AllowSync.java | 2 +- .../sdk/models/operations/AllowTuners.java | 2 +- .../operations/ApplyUpdatesRequest.java | 38 +- .../ApplyUpdatesRequestBuilder.java | 27 +- .../operations/ApplyUpdatesResponse.java | 43 +- .../sdk/models/operations/Attributes.java | 36 +- .../models/operations/AutoSelectSubtitle.java | 2 +- .../sdk/models/operations/Billing.java | 37 +- .../sdk/models/operations/ButlerTask.java | 79 +- .../sdk/models/operations/ButlerTasks.java | 25 +- .../CancelServerActivitiesRequest.java | 25 +- .../CancelServerActivitiesRequestBuilder.java | 27 +- .../CancelServerActivitiesResponse.java | 43 +- .../sdk/models/operations/Chapter.java | 69 +- .../operations/CheckForUpdatesRequest.java | 26 +- .../CheckForUpdatesRequestBuilder.java | 27 +- .../operations/CheckForUpdatesResponse.java | 43 +- .../ClearPlaylistContentsRequest.java | 25 +- .../ClearPlaylistContentsRequestBuilder.java | 27 +- .../ClearPlaylistContentsResponse.java | 43 +- .../sdk/models/operations/Collection.java | 25 +- .../sdk/models/operations/Connections.java | 71 +- .../sdk/models/operations/Context.java | 25 +- .../sdk/models/operations/Country.java | 43 +- .../CreatePlaylistMediaContainer.java | 38 +- .../operations/CreatePlaylistMetadata.java | 177 +- .../operations/CreatePlaylistRequest.java | 63 +- .../CreatePlaylistRequestBuilder.java | 16 +- .../operations/CreatePlaylistResponse.java | 52 +- .../CreatePlaylistResponseBody.java | 24 +- .../models/operations/DefaultDirection.java | 2 +- .../DefaultSubtitleAccessibility.java | 2 +- .../operations/DefaultSubtitleForced.java | 2 +- .../operations/DeleteLibraryRequest.java | 25 +- .../DeleteLibraryRequestBuilder.java | 27 +- .../operations/DeleteLibraryResponse.java | 43 +- .../operations/DeletePlaylistRequest.java | 25 +- .../DeletePlaylistRequestBuilder.java | 27 +- .../operations/DeletePlaylistResponse.java | 43 +- .../plexapi/sdk/models/operations/Device.java | 70 +- .../sdk/models/operations/Director.java | 63 +- .../sdk/models/operations/Directory.java | 47 +- .../sdk/models/operations/Download.java | 2 +- .../EnablePaperTrailRequestBuilder.java | 15 +- .../operations/EnablePaperTrailResponse.java | 43 +- .../plexapi/sdk/models/operations/Extras.java | 26 +- .../sdk/models/operations/Feature.java | 86 +- .../plexapi/sdk/models/operations/Field.java | 54 +- .../sdk/models/operations/FieldType.java | 36 +- .../plexapi/sdk/models/operations/Force.java | 2 +- .../plexapi/sdk/models/operations/Friend.java | 121 +- .../plexapi/sdk/models/operations/Genre.java | 43 +- .../sdk/models/operations/GeoData.java | 112 +- .../operations/GetActorsLibraryDirectory.java | 48 +- .../GetActorsLibraryMediaContainer.java | 125 +- .../operations/GetActorsLibraryRequest.java | 36 +- .../GetActorsLibraryRequestBuilder.java | 27 +- .../operations/GetActorsLibraryResponse.java | 52 +- .../GetActorsLibraryResponseBody.java | 24 +- .../operations/GetAllLibrariesDirectory.java | 194 +- .../operations/GetAllLibrariesLocation.java | 36 +- .../GetAllLibrariesMediaContainer.java | 53 +- .../GetAllLibrariesRequestBuilder.java | 15 +- .../operations/GetAllLibrariesResponse.java | 52 +- .../GetAllLibrariesResponseBody.java | 24 +- .../GetAvailableClientsMediaContainer.java | 38 +- .../GetAvailableClientsRequestBuilder.java | 15 +- .../GetAvailableClientsResponse.java | 52 +- .../GetAvailableClientsResponseBody.java | 24 +- .../GetBandwidthStatisticsAccount.java | 100 +- .../GetBandwidthStatisticsDevice.java | 70 +- .../GetBandwidthStatisticsMediaContainer.java | 57 +- .../GetBandwidthStatisticsRequest.java | 26 +- .../GetBandwidthStatisticsRequestBuilder.java | 27 +- .../GetBandwidthStatisticsResponse.java | 52 +- .../GetBandwidthStatisticsResponseBody.java | 24 +- .../operations/GetBannerImageRequest.java | 70 +- .../GetBannerImageRequestBuilder.java | 16 +- .../operations/GetBannerImageResponse.java | 65 +- .../GetButlerTasksRequestBuilder.java | 15 +- .../operations/GetButlerTasksResponse.java | 52 +- .../GetButlerTasksResponseBody.java | 24 +- .../GetCompanionsDataRequestBuilder.java | 16 +- .../operations/GetCompanionsDataResponse.java | 52 +- .../GetCountriesLibraryDirectory.java | 44 +- .../GetCountriesLibraryMediaContainer.java | 125 +- .../GetCountriesLibraryRequest.java | 36 +- .../GetCountriesLibraryRequestBuilder.java | 27 +- .../GetCountriesLibraryResponse.java | 52 +- .../GetCountriesLibraryResponseBody.java | 24 +- .../operations/GetDevicesMediaContainer.java | 47 +- .../operations/GetDevicesRequestBuilder.java | 15 +- .../models/operations/GetDevicesResponse.java | 52 +- .../operations/GetDevicesResponseBody.java | 24 +- .../models/operations/GetFileHashRequest.java | 37 +- .../operations/GetFileHashRequestBuilder.java | 27 +- .../operations/GetFileHashResponse.java | 43 +- .../operations/GetGenresLibraryDirectory.java | 50 +- .../GetGenresLibraryMediaContainer.java | 125 +- .../operations/GetGenresLibraryRequest.java | 36 +- .../GetGenresLibraryRequestBuilder.java | 27 +- .../operations/GetGenresLibraryResponse.java | 52 +- .../GetGenresLibraryResponseBody.java | 24 +- .../models/operations/GetGeoDataGeoData.java | 112 +- .../operations/GetGeoDataRequestBuilder.java | 16 +- .../models/operations/GetGeoDataResponse.java | 52 +- .../GetGlobalHubsMediaContainer.java | 57 +- .../operations/GetGlobalHubsMetadata.java | 190 +- .../operations/GetGlobalHubsRequest.java | 38 +- .../GetGlobalHubsRequestBuilder.java | 27 +- .../operations/GetGlobalHubsResponse.java | 52 +- .../operations/GetGlobalHubsResponseBody.java | 24 +- .../operations/GetHomeDataRequestBuilder.java | 15 +- .../operations/GetHomeDataResponse.java | 52 +- .../operations/GetHomeDataResponseBody.java | 78 +- .../GetLibraryDetailsDirectory.java | 70 +- .../operations/GetLibraryDetailsField.java | 57 +- .../GetLibraryDetailsFieldType.java | 38 +- .../operations/GetLibraryDetailsFilter.java | 70 +- .../GetLibraryDetailsMediaContainer.java | 169 +- .../operations/GetLibraryDetailsOperator.java | 38 +- .../operations/GetLibraryDetailsRequest.java | 37 +- .../GetLibraryDetailsRequestBuilder.java | 28 +- .../operations/GetLibraryDetailsResponse.java | 52 +- .../GetLibraryDetailsResponseBody.java | 24 +- .../operations/GetLibraryDetailsSort.java | 79 +- .../operations/GetLibraryDetailsType.java | 87 +- .../operations/GetLibraryHubsCountry.java | 25 +- .../operations/GetLibraryHubsDirector.java | 25 +- .../operations/GetLibraryHubsGenre.java | 25 +- .../models/operations/GetLibraryHubsHub.java | 139 +- .../operations/GetLibraryHubsMedia.java | 190 +- .../GetLibraryHubsMediaContainer.java | 87 +- .../operations/GetLibraryHubsMetadata.java | 357 +- .../models/operations/GetLibraryHubsPart.java | 117 +- .../operations/GetLibraryHubsRequest.java | 45 +- .../GetLibraryHubsRequestBuilder.java | 27 +- .../operations/GetLibraryHubsResponse.java | 52 +- .../GetLibraryHubsResponseBody.java | 24 +- .../models/operations/GetLibraryHubsRole.java | 25 +- .../operations/GetLibraryHubsWriter.java | 25 +- .../GetLibraryItemsActiveDirection.java | 2 +- .../operations/GetLibraryItemsCollection.java | 25 +- .../operations/GetLibraryItemsCountry.java | 36 +- .../GetLibraryItemsDefaultDirection.java | 2 +- .../operations/GetLibraryItemsDirector.java | 44 +- .../operations/GetLibraryItemsField.java | 54 +- .../operations/GetLibraryItemsFieldType.java | 36 +- .../operations/GetLibraryItemsFilter.java | 62 +- .../operations/GetLibraryItemsGenre.java | 36 +- .../operations/GetLibraryItemsGuids.java | 25 +- .../GetLibraryItemsHasThumbnail.java | 2 +- .../operations/GetLibraryItemsImage.java | 44 +- ...raryItemsLibraryOptimizedForStreaming.java | 5 +- .../GetLibraryItemsLibraryType.java | 83 +- .../operations/GetLibraryItemsLocation.java | 23 +- .../operations/GetLibraryItemsMedia.java | 191 +- .../GetLibraryItemsMediaContainer.java | 195 +- .../operations/GetLibraryItemsMeta.java | 37 +- .../operations/GetLibraryItemsMetadata.java | 721 ++-- .../operations/GetLibraryItemsOperator.java | 36 +- .../GetLibraryItemsOptimizedForStreaming.java | 5 +- ...GetLibraryItemsOptimizedForStreaming1.java | 2 +- .../operations/GetLibraryItemsPart.java | 159 +- .../operations/GetLibraryItemsProducer.java | 71 +- .../GetLibraryItemsQueryParamIncludeMeta.java | 2 +- .../operations/GetLibraryItemsRequest.java | 79 +- .../GetLibraryItemsRequestBuilder.java | 16 +- .../operations/GetLibraryItemsResponse.java | 52 +- .../GetLibraryItemsResponseBody.java | 24 +- .../operations/GetLibraryItemsRole.java | 53 +- .../operations/GetLibraryItemsSimilar.java | 43 +- .../operations/GetLibraryItemsSort.java | 96 +- .../GetLibraryItemsUltraBlurColors.java | 50 +- .../operations/GetLibraryItemsWriter.java | 44 +- .../GetLibrarySectionsAllActiveDirection.java | 2 +- .../GetLibrarySectionsAllCollection.java | 25 +- .../GetLibrarySectionsAllCountry.java | 25 +- ...GetLibrarySectionsAllDefaultDirection.java | 2 +- .../GetLibrarySectionsAllDirector.java | 25 +- .../GetLibrarySectionsAllField.java | 54 +- .../GetLibrarySectionsAllFieldType.java | 36 +- .../GetLibrarySectionsAllFilter.java | 74 +- .../GetLibrarySectionsAllGenre.java | 25 +- .../GetLibrarySectionsAllGuids.java | 25 +- .../GetLibrarySectionsAllHasThumbnail.java | 2 +- .../GetLibrarySectionsAllImage.java | 44 +- ...ctionsAllLibraryOptimizedForStreaming.java | 5 +- .../GetLibrarySectionsAllMedia.java | 191 +- .../GetLibrarySectionsAllMediaContainer.java | 176 +- .../operations/GetLibrarySectionsAllMeta.java | 37 +- .../GetLibrarySectionsAllMetadata.java | 587 +-- .../GetLibrarySectionsAllOperator.java | 36 +- ...brarySectionsAllOptimizedForStreaming.java | 5 +- ...rarySectionsAllOptimizedForStreaming1.java | 2 +- ...tionsAllOptimizedForStreamingLibrary1.java | 2 +- .../operations/GetLibrarySectionsAllPart.java | 163 +- ...brarySectionsAllQueryParamIncludeMeta.java | 2 +- .../GetLibrarySectionsAllRequest.java | 103 +- .../GetLibrarySectionsAllRequestBuilder.java | 16 +- .../GetLibrarySectionsAllResponse.java | 52 +- .../GetLibrarySectionsAllResponseBody.java | 24 +- .../operations/GetLibrarySectionsAllRole.java | 25 +- .../operations/GetLibrarySectionsAllSort.java | 96 +- .../GetLibrarySectionsAllStream.java | 476 +-- .../operations/GetLibrarySectionsAllType.java | 96 +- .../GetLibrarySectionsAllUltraBlurColors.java | 50 +- .../GetLibrarySectionsAllWriter.java | 25 +- .../GetMediaArtsMediaContainer.java | 60 +- .../operations/GetMediaArtsMetadata.java | 63 +- .../operations/GetMediaArtsRequest.java | 25 +- .../GetMediaArtsRequestBuilder.java | 27 +- .../operations/GetMediaArtsResponse.java | 52 +- .../operations/GetMediaArtsResponseBody.java | 24 +- .../GetMediaMetaDataAttributes.java | 36 +- .../operations/GetMediaMetaDataChapter.java | 69 +- .../operations/GetMediaMetaDataCountry.java | 43 +- .../operations/GetMediaMetaDataDirector.java | 63 +- .../operations/GetMediaMetaDataExtras.java | 26 +- .../operations/GetMediaMetaDataGenre.java | 43 +- .../operations/GetMediaMetaDataGuids.java | 25 +- .../GetMediaMetaDataHasThumbnail.java | 2 +- .../operations/GetMediaMetaDataImage.java | 44 +- ...aMetaDataLibraryOptimizedForStreaming.java | 5 +- .../operations/GetMediaMetaDataLocation.java | 25 +- .../operations/GetMediaMetaDataMarker.java | 73 +- .../operations/GetMediaMetaDataMedia.java | 191 +- .../GetMediaMetaDataMediaContainer.java | 96 +- .../operations/GetMediaMetaDataMetadata.java | 674 ++-- ...GetMediaMetaDataOptimizedForStreaming.java | 5 +- ...etMediaMetaDataOptimizedForStreaming1.java | 2 +- ...MetaDataOptimizedForStreamingLibrary1.java | 2 +- .../operations/GetMediaMetaDataPart.java | 167 +- .../operations/GetMediaMetaDataProducer.java | 71 +- .../operations/GetMediaMetaDataRatings.java | 43 +- .../operations/GetMediaMetaDataRequest.java | 147 +- .../GetMediaMetaDataRequestBuilder.java | 16 +- .../operations/GetMediaMetaDataResponse.java | 52 +- .../GetMediaMetaDataResponseBody.java | 24 +- .../operations/GetMediaMetaDataRole.java | 71 +- .../operations/GetMediaMetaDataSimilar.java | 43 +- .../operations/GetMediaMetaDataStream.java | 479 +-- .../GetMediaMetaDataUltraBlurColors.java | 50 +- .../operations/GetMediaMetaDataWriter.java | 64 +- .../GetMediaPostersMediaContainer.java | 60 +- .../operations/GetMediaPostersMetadata.java | 63 +- .../operations/GetMediaPostersRequest.java | 25 +- .../GetMediaPostersRequestBuilder.java | 27 +- .../operations/GetMediaPostersResponse.java | 52 +- .../GetMediaPostersResponseBody.java | 24 +- .../GetMediaProvidersDirectory.java | 160 +- .../GetMediaProvidersMediaContainer.java | 460 ++- .../operations/GetMediaProvidersRequest.java | 25 +- .../GetMediaProvidersRequestBuilder.java | 27 +- .../operations/GetMediaProvidersResponse.java | 52 +- .../GetMediaProvidersResponseBody.java | 24 +- .../GetMetadataChildrenDirectory.java | 70 +- .../GetMetadataChildrenMediaContainer.java | 250 +- .../GetMetadataChildrenMetadata.java | 289 +- .../GetMetadataChildrenRequest.java | 37 +- .../GetMetadataChildrenRequestBuilder.java | 27 +- .../GetMetadataChildrenResponse.java | 52 +- .../GetMetadataChildrenResponseBody.java | 24 +- .../GetMyPlexAccountRequestBuilder.java | 15 +- .../operations/GetMyPlexAccountResponse.java | 52 +- .../GetMyPlexAccountResponseBody.java | 24 +- .../operations/GetPinAuthPinContainer.java | 125 +- .../sdk/models/operations/GetPinRequest.java | 74 +- .../operations/GetPinRequestBuilder.java | 17 +- .../sdk/models/operations/GetPinResponse.java | 52 +- .../GetPlaylistContentsCountry.java | 25 +- .../GetPlaylistContentsDirector.java | 25 +- .../operations/GetPlaylistContentsGenre.java | 25 +- .../operations/GetPlaylistContentsMedia.java | 190 +- .../GetPlaylistContentsMediaContainer.java | 109 +- .../GetPlaylistContentsMetadata.java | 340 +- .../operations/GetPlaylistContentsPart.java | 117 +- .../GetPlaylistContentsRequest.java | 36 +- .../GetPlaylistContentsRequestBuilder.java | 27 +- .../GetPlaylistContentsResponse.java | 52 +- .../GetPlaylistContentsResponseBody.java | 24 +- .../operations/GetPlaylistContentsRole.java | 25 +- .../operations/GetPlaylistContentsWriter.java | 25 +- .../operations/GetPlaylistMediaContainer.java | 38 +- .../operations/GetPlaylistMetadata.java | 169 +- .../models/operations/GetPlaylistRequest.java | 25 +- .../operations/GetPlaylistRequestBuilder.java | 27 +- .../operations/GetPlaylistResponse.java | 52 +- .../operations/GetPlaylistResponseBody.java | 24 +- .../GetPlaylistsMediaContainer.java | 38 +- .../operations/GetPlaylistsMetadata.java | 177 +- .../operations/GetPlaylistsRequest.java | 38 +- .../GetPlaylistsRequestBuilder.java | 27 +- .../operations/GetPlaylistsResponse.java | 52 +- .../operations/GetPlaylistsResponseBody.java | 24 +- .../GetRecentlyAddedActiveDirection.java | 2 +- .../GetRecentlyAddedDefaultDirection.java | 2 +- .../operations/GetRecentlyAddedField.java | 54 +- .../operations/GetRecentlyAddedFieldType.java | 36 +- .../operations/GetRecentlyAddedFilter.java | 74 +- .../operations/GetRecentlyAddedImage.java | 44 +- .../GetRecentlyAddedLibraryCountry.java | 25 +- .../GetRecentlyAddedLibraryDirector.java | 25 +- .../GetRecentlyAddedLibraryFilter.java | 74 +- .../GetRecentlyAddedLibraryGenre.java | 25 +- .../GetRecentlyAddedLibraryMedia.java | 177 +- ...GetRecentlyAddedLibraryMediaContainer.java | 108 +- .../GetRecentlyAddedLibraryMetadata.java | 340 +- .../GetRecentlyAddedLibraryPart.java | 117 +- .../GetRecentlyAddedLibraryRequest.java | 81 +- ...GetRecentlyAddedLibraryRequestBuilder.java | 16 +- .../GetRecentlyAddedLibraryResponse.java | 52 +- .../GetRecentlyAddedLibraryResponseBody.java | 24 +- .../GetRecentlyAddedLibraryRole.java | 25 +- .../GetRecentlyAddedLibraryType.java | 96 +- .../GetRecentlyAddedLibraryWriter.java | 25 +- .../GetRecentlyAddedMediaContainer.java | 77 +- .../operations/GetRecentlyAddedMetadata.java | 688 ++-- .../operations/GetRecentlyAddedOperator.java | 36 +- ...GetRecentlyAddedOptimizedForStreaming.java | 5 +- ...etRecentlyAddedOptimizedForStreaming1.java | 2 +- .../operations/GetRecentlyAddedRequest.java | 80 +- .../GetRecentlyAddedRequestBuilder.java | 16 +- .../operations/GetRecentlyAddedResponse.java | 52 +- .../GetRecentlyAddedResponseBody.java | 24 +- .../operations/GetRecentlyAddedSort.java | 96 +- .../operations/GetRecentlyAddedType.java | 96 +- .../GetRefreshLibraryMetadataRequest.java | 37 +- ...tRefreshLibraryMetadataRequestBuilder.java | 27 +- .../GetRefreshLibraryMetadataResponse.java | 43 +- .../operations/GetResizedPhotoRequest.java | 71 +- .../GetResizedPhotoRequestBuilder.java | 16 +- .../operations/GetResizedPhotoResponse.java | 43 +- .../GetResourcesStatisticsMediaContainer.java | 38 +- .../GetResourcesStatisticsRequest.java | 26 +- .../GetResourcesStatisticsRequestBuilder.java | 27 +- .../GetResourcesStatisticsResponse.java | 52 +- .../GetResourcesStatisticsResponseBody.java | 24 +- .../GetSearchAllLibrariesCountry.java | 36 +- .../GetSearchAllLibrariesDirector.java | 44 +- .../GetSearchAllLibrariesDirectory.java | 122 +- .../GetSearchAllLibrariesGenre.java | 36 +- .../GetSearchAllLibrariesGuids.java | 25 +- .../GetSearchAllLibrariesHasThumbnail.java | 2 +- .../GetSearchAllLibrariesImage.java | 44 +- ...LibrariesLibraryOptimizedForStreaming.java | 5 +- .../GetSearchAllLibrariesLocation.java | 23 +- .../GetSearchAllLibrariesMedia.java | 191 +- .../GetSearchAllLibrariesMediaContainer.java | 97 +- .../GetSearchAllLibrariesMetadata.java | 660 ++-- ...archAllLibrariesOptimizedForStreaming.java | 5 +- ...rchAllLibrariesOptimizedForStreaming1.java | 2 +- ...ibrariesOptimizedForStreamingLibrary1.java | 2 +- .../operations/GetSearchAllLibrariesPart.java | 159 +- ...LibrariesQueryParamIncludeCollections.java | 2 +- ...brariesQueryParamIncludeExternalMedia.java | 2 +- .../GetSearchAllLibrariesRequest.java | 73 +- .../GetSearchAllLibrariesRequestBuilder.java | 16 +- .../GetSearchAllLibrariesResponse.java | 52 +- .../GetSearchAllLibrariesResponseBody.java | 23 +- .../operations/GetSearchAllLibrariesRole.java | 53 +- .../GetSearchAllLibrariesUltraBlurColors.java | 50 +- .../GetSearchAllLibrariesWriter.java | 44 +- .../GetSearchLibraryMediaContainer.java | 147 +- .../operations/GetSearchLibraryMetadata.java | 220 +- .../operations/GetSearchLibraryRequest.java | 36 +- .../GetSearchLibraryRequestBuilder.java | 27 +- .../operations/GetSearchLibraryResponse.java | 52 +- .../GetSearchLibraryResponseBody.java | 24 +- .../operations/GetSearchResultsCountry.java | 25 +- .../operations/GetSearchResultsDirector.java | 25 +- .../operations/GetSearchResultsGenre.java | 25 +- .../operations/GetSearchResultsMedia.java | 169 +- .../GetSearchResultsMediaContainer.java | 79 +- .../operations/GetSearchResultsMetadata.java | 357 +- .../operations/GetSearchResultsPart.java | 100 +- .../operations/GetSearchResultsRequest.java | 25 +- .../GetSearchResultsRequestBuilder.java | 27 +- .../operations/GetSearchResultsResponse.java | 52 +- .../GetSearchResultsResponseBody.java | 24 +- .../operations/GetSearchResultsRole.java | 25 +- .../operations/GetSearchResultsWriter.java | 25 +- .../GetServerActivitiesMediaContainer.java | 38 +- .../GetServerActivitiesRequestBuilder.java | 15 +- .../GetServerActivitiesResponse.java | 52 +- .../GetServerActivitiesResponseBody.java | 24 +- .../GetServerCapabilitiesRequestBuilder.java | 15 +- .../GetServerCapabilitiesResponse.java | 52 +- .../GetServerCapabilitiesResponseBody.java | 24 +- .../GetServerIdentityMediaContainer.java | 57 +- .../GetServerIdentityRequestBuilder.java | 15 +- .../operations/GetServerIdentityResponse.java | 52 +- .../GetServerIdentityResponseBody.java | 24 +- .../GetServerListMediaContainer.java | 38 +- .../GetServerListRequestBuilder.java | 15 +- .../operations/GetServerListResponse.java | 52 +- .../operations/GetServerListResponseBody.java | 24 +- .../operations/GetServerListServer.java | 79 +- .../GetServerPreferencesMediaContainer.java | 38 +- .../GetServerPreferencesRequestBuilder.java | 15 +- .../GetServerPreferencesResponse.java | 52 +- .../GetServerPreferencesResponseBody.java | 24 +- .../operations/GetServerResourcesRequest.java | 54 +- .../GetServerResourcesRequestBuilder.java | 31 +- .../GetServerResourcesResponse.java | 52 +- .../GetSessionHistoryMediaContainer.java | 38 +- .../operations/GetSessionHistoryMetadata.java | 207 +- .../operations/GetSessionHistoryRequest.java | 55 +- .../GetSessionHistoryRequestBuilder.java | 27 +- .../operations/GetSessionHistoryResponse.java | 52 +- .../GetSessionHistoryResponseBody.java | 24 +- .../models/operations/GetSessionsMedia.java | 100 +- .../operations/GetSessionsMediaContainer.java | 38 +- .../operations/GetSessionsMetadata.java | 399 ++- .../models/operations/GetSessionsPart.java | 117 +- .../operations/GetSessionsRequestBuilder.java | 15 +- .../operations/GetSessionsResponse.java | 52 +- .../operations/GetSessionsResponseBody.java | 24 +- .../models/operations/GetSessionsStream.java | 220 +- .../models/operations/GetSessionsUser.java | 47 +- ...GetSourceConnectionInformationRequest.java | 25 +- ...ceConnectionInformationRequestBuilder.java | 27 +- ...etSourceConnectionInformationResponse.java | 43 +- .../operations/GetStatisticsDevice.java | 70 +- .../GetStatisticsMediaContainer.java | 57 +- .../operations/GetStatisticsRequest.java | 26 +- .../GetStatisticsRequestBuilder.java | 27 +- .../operations/GetStatisticsResponse.java | 52 +- .../operations/GetStatisticsResponseBody.java | 24 +- .../operations/GetThumbImageRequest.java | 70 +- .../GetThumbImageRequestBuilder.java | 16 +- .../operations/GetThumbImageResponse.java | 65 +- .../models/operations/GetTimelineRequest.java | 94 +- .../operations/GetTimelineRequestBuilder.java | 16 +- .../operations/GetTimelineResponse.java | 43 +- .../GetTokenByPinIdAuthPinContainer.java | 125 +- .../operations/GetTokenByPinIdGeoData.java | 112 +- .../operations/GetTokenByPinIdRequest.java | 73 +- .../GetTokenByPinIdRequestBuilder.java | 17 +- .../operations/GetTokenByPinIdResponse.java | 52 +- .../GetTokenDetailsRequestBuilder.java | 16 +- .../operations/GetTokenDetailsResponse.java | 52 +- .../GetTokenDetailsSubscription.java | 72 +- .../GetTokenDetailsUserPlexAccount.java | 376 +- .../GetTopWatchedContentCountry.java | 47 +- .../operations/GetTopWatchedContentGenre.java | 47 +- .../operations/GetTopWatchedContentGuids.java | 25 +- .../GetTopWatchedContentMediaContainer.java | 71 +- .../GetTopWatchedContentMetadata.java | 340 +- ...pWatchedContentQueryParamIncludeGuids.java | 2 +- .../GetTopWatchedContentRequest.java | 37 +- .../GetTopWatchedContentRequestBuilder.java | 28 +- .../GetTopWatchedContentResponse.java | 52 +- .../GetTopWatchedContentResponseBody.java | 24 +- .../operations/GetTopWatchedContentRole.java | 79 +- .../operations/GetTopWatchedContentUser.java | 25 +- .../GetTranscodeSessionsMediaContainer.java | 38 +- .../GetTranscodeSessionsRequestBuilder.java | 15 +- .../GetTranscodeSessionsResponse.java | 52 +- .../GetTranscodeSessionsResponseBody.java | 24 +- .../GetTransientTokenQueryParamType.java | 2 +- .../operations/GetTransientTokenRequest.java | 36 +- .../GetTransientTokenRequestBuilder.java | 27 +- .../operations/GetTransientTokenResponse.java | 43 +- .../GetUpdateStatusMediaContainer.java | 79 +- .../GetUpdateStatusRequestBuilder.java | 15 +- .../operations/GetUpdateStatusResponse.java | 52 +- .../GetUpdateStatusResponseBody.java | 24 +- .../GetUserFriendsRequestBuilder.java | 16 +- .../operations/GetUserFriendsResponse.java | 52 +- .../operations/GetUsersMediaContainer.java | 66 +- .../models/operations/GetUsersRequest.java | 134 +- .../operations/GetUsersRequestBuilder.java | 17 +- .../models/operations/GetUsersResponse.java | 70 +- .../operations/GetUsersResponseBody.java | 25 +- .../sdk/models/operations/GetUsersServer.java | 100 +- .../operations/GetWatchListRequest.java | 100 +- .../GetWatchListRequestBuilder.java | 17 +- .../operations/GetWatchListResponse.java | 52 +- .../operations/GetWatchListResponseBody.java | 86 +- .../plexapi/sdk/models/operations/Guids.java | 25 +- .../sdk/models/operations/HasThumbnail.java | 2 +- .../plexapi/sdk/models/operations/Hidden.java | 2 +- .../plexapi/sdk/models/operations/Home.java | 2 +- .../plexapi/sdk/models/operations/Hub.java | 130 +- .../plexapi/sdk/models/operations/Image.java | 47 +- .../models/operations/IncludeAdvanced.java | 2 +- .../models/operations/IncludeCollections.java | 2 +- .../sdk/models/operations/IncludeDetails.java | 2 +- .../operations/IncludeExternalMedia.java | 2 +- .../sdk/models/operations/IncludeGuids.java | 2 +- .../sdk/models/operations/IncludeHttps.java | 2 +- .../sdk/models/operations/IncludeIPv6.java | 2 +- .../sdk/models/operations/IncludeMeta.java | 2 +- .../sdk/models/operations/IncludeRelay.java | 2 +- .../operations/InternalPaymentMethod.java | 22 +- .../sdk/models/operations/Location.java | 23 +- .../sdk/models/operations/LogLineRequest.java | 43 +- .../operations/LogLineRequestBuilder.java | 27 +- .../models/operations/LogLineResponse.java | 43 +- .../LogMultiLineRequestBuilder.java | 16 +- .../operations/LogMultiLineResponse.java | 43 +- .../models/operations/MarkPlayedRequest.java | 25 +- .../operations/MarkPlayedRequestBuilder.java | 27 +- .../models/operations/MarkPlayedResponse.java | 43 +- .../operations/MarkUnplayedRequest.java | 25 +- .../MarkUnplayedRequestBuilder.java | 27 +- .../operations/MarkUnplayedResponse.java | 43 +- .../plexapi/sdk/models/operations/Marker.java | 73 +- .../plexapi/sdk/models/operations/Media.java | 191 +- .../sdk/models/operations/MediaContainer.java | 529 +-- .../sdk/models/operations/MediaProvider.java | 70 +- .../operations/MediaReviewsVisibility.java | 2 +- .../plexapi/sdk/models/operations/Meta.java | 37 +- .../sdk/models/operations/Metadata.java | 370 +- .../sdk/models/operations/MinSize.java | 2 +- .../plexapi/sdk/models/operations/MyPlex.java | 139 +- .../plexapi/sdk/models/operations/One.java | 2 +- .../sdk/models/operations/OnlyTransient.java | 2 +- .../sdk/models/operations/Operator.java | 36 +- .../operations/OptimizedForStreaming.java | 5 +- .../operations/OptimizedForStreaming1.java | 2 +- .../plexapi/sdk/models/operations/Owned.java | 2 +- .../plexapi/sdk/models/operations/Part.java | 163 +- .../models/operations/PastSubscription.java | 166 +- .../sdk/models/operations/Pending.java | 2 +- .../operations/PerformSearchRequest.java | 45 +- .../PerformSearchRequestBuilder.java | 28 +- .../operations/PerformSearchResponse.java | 43 +- .../operations/PerformVoiceSearchRequest.java | 45 +- .../PerformVoiceSearchRequestBuilder.java | 28 +- .../PerformVoiceSearchResponse.java | 43 +- .../plexapi/sdk/models/operations/Pivot.java | 79 +- .../plexapi/sdk/models/operations/Player.java | 169 +- .../sdk/models/operations/PlexDevice.java | 239 +- .../operations/PostMediaArtsRequest.java | 45 +- .../PostMediaArtsRequestBuilder.java | 27 +- .../operations/PostMediaArtsResponse.java | 43 +- .../operations/PostMediaPosterRequest.java | 45 +- .../PostMediaPosterRequestBuilder.java | 27 +- .../operations/PostMediaPosterResponse.java | 43 +- ...sSignInDataAuthenticationSubscription.java | 72 +- ...PostUsersSignInDataAutoSelectSubtitle.java | 2 +- ...ignInDataDefaultSubtitleAccessibility.java | 2 +- ...tUsersSignInDataDefaultSubtitleForced.java | 2 +- ...UsersSignInDataMediaReviewsVisibility.java | 2 +- .../PostUsersSignInDataRequest.java | 74 +- .../PostUsersSignInDataRequestBody.java | 54 +- .../PostUsersSignInDataRequestBuilder.java | 17 +- .../PostUsersSignInDataResponse.java | 52 +- .../PostUsersSignInDataServices.java | 67 +- .../PostUsersSignInDataSubscription.java | 71 +- .../PostUsersSignInDataUserPlexAccount.java | 391 +- .../PostUsersSignInDataUserProfile.java | 99 +- .../PostUsersSignInDataWatchedIndicator.java | 2 +- .../sdk/models/operations/Producer.java | 63 +- .../sdk/models/operations/Protected.java | 2 +- .../sdk/models/operations/Protocol.java | 2 +- .../sdk/models/operations/Provider.java | 47 +- .../models/operations/QueryParamFilter.java | 21 +- .../models/operations/QueryParamForce.java | 2 +- .../QueryParamIncludeCollections.java | 2 +- .../QueryParamIncludeExternalMedia.java | 2 +- .../operations/QueryParamIncludeGuids.java | 2 +- .../operations/QueryParamIncludeMeta.java | 2 +- .../operations/QueryParamOnlyTransient.java | 2 +- .../plexapi/sdk/models/operations/Rating.java | 44 +- .../sdk/models/operations/Ratings.java | 43 +- .../sdk/models/operations/Release.java | 79 +- .../sdk/models/operations/ResponseBody.java | 69 +- .../sdk/models/operations/Restricted.java | 2 +- .../plexapi/sdk/models/operations/Role.java | 71 +- .../operations/SDKMethodInterfaces.java | 462 --- .../plexapi/sdk/models/operations/Scope.java | 2 +- .../sdk/models/operations/SearchResult.java | 47 +- .../plexapi/sdk/models/operations/Server.java | 130 +- .../sdk/models/operations/Services.java | 67 +- .../sdk/models/operations/Session.java | 47 +- .../sdk/models/operations/Setting.java | 117 +- .../sdk/models/operations/SharedServers.java | 22 +- .../sdk/models/operations/SharedSources.java | 22 +- .../sdk/models/operations/Similar.java | 43 +- .../plexapi/sdk/models/operations/Skip.java | 2 +- .../plexapi/sdk/models/operations/Smart.java | 2 +- .../plexapi/sdk/models/operations/Sort.java | 96 +- .../StartAllTasksRequestBuilder.java | 15 +- .../operations/StartAllTasksResponse.java | 43 +- .../models/operations/StartTaskRequest.java | 25 +- .../operations/StartTaskRequestBuilder.java | 27 +- .../models/operations/StartTaskResponse.java | 43 +- .../StartUniversalTranscodeRequest.java | 158 +- ...StartUniversalTranscodeRequestBuilder.java | 16 +- .../StartUniversalTranscodeResponse.java | 43 +- .../operations/StatisticsBandwidth.java | 79 +- .../models/operations/StatisticsMedia.java | 87 +- .../operations/StatisticsResources.java | 79 +- .../StopAllTasksRequestBuilder.java | 15 +- .../operations/StopAllTasksResponse.java | 43 +- .../models/operations/StopTaskRequest.java | 25 +- .../operations/StopTaskRequestBuilder.java | 27 +- .../models/operations/StopTaskResponse.java | 43 +- .../StopTranscodeSessionRequest.java | 25 +- .../StopTranscodeSessionRequestBuilder.java | 27 +- .../StopTranscodeSessionResponse.java | 43 +- .../plexapi/sdk/models/operations/Stream.java | 476 +-- .../sdk/models/operations/Subscription.java | 71 +- .../sdk/models/operations/Tonight.java | 2 +- .../models/operations/TranscodeSession.java | 259 +- .../plexapi/sdk/models/operations/Trials.java | 22 +- .../models/operations/UltraBlurColors.java | 50 +- .../operations/UpdatePlayProgressRequest.java | 43 +- .../UpdatePlayProgressRequestBuilder.java | 27 +- .../UpdatePlayProgressResponse.java | 43 +- .../operations/UpdatePlaylistRequest.java | 45 +- .../UpdatePlaylistRequestBuilder.java | 27 +- .../operations/UpdatePlaylistResponse.java | 43 +- .../operations/UploadPlaylistRequest.java | 43 +- .../UploadPlaylistRequestBuilder.java | 28 +- .../operations/UploadPlaylistResponse.java | 43 +- .../sdk/models/operations/Upscale.java | 2 +- .../plexapi/sdk/models/operations/User.java | 199 +- .../sdk/models/operations/UserProfile.java | 99 +- .../models/operations/WatchedIndicator.java | 2 +- .../plexapi/sdk/models/operations/Writer.java | 64 +- .../AddPlaylistContentsRequestBuilder.java | 72 + .../async/AddPlaylistContentsResponse.java | 253 ++ .../async/ApplyUpdatesRequestBuilder.java | 70 + .../async/ApplyUpdatesResponse.java | 181 + .../CancelServerActivitiesRequestBuilder.java | 48 + .../async/CancelServerActivitiesResponse.java | 181 + .../async/CheckForUpdatesRequestBuilder.java | 55 + .../async/CheckForUpdatesResponse.java | 181 + .../ClearPlaylistContentsRequestBuilder.java | 48 + .../async/ClearPlaylistContentsResponse.java | 181 + .../async/CreatePlaylistRequestBuilder.java | 38 + .../async/CreatePlaylistResponse.java | 253 ++ .../async/DeleteLibraryRequestBuilder.java | 48 + .../async/DeleteLibraryResponse.java | 181 + .../async/DeletePlaylistRequestBuilder.java | 48 + .../async/DeletePlaylistResponse.java | 181 + .../async/EnablePaperTrailRequestBuilder.java | 29 + .../async/EnablePaperTrailResponse.java | 181 + .../async/GetActorsLibraryRequestBuilder.java | 57 + .../async/GetActorsLibraryResponse.java | 253 ++ .../async/GetAllLibrariesRequestBuilder.java | 29 + .../async/GetAllLibrariesResponse.java | 253 ++ .../GetAvailableClientsRequestBuilder.java | 29 + .../async/GetAvailableClientsResponse.java | 253 ++ .../GetBandwidthStatisticsRequestBuilder.java | 55 + .../async/GetBandwidthStatisticsResponse.java | 253 ++ .../async/GetBannerImageRequestBuilder.java | 38 + .../async/GetBannerImageResponse.java | 284 ++ .../async/GetButlerTasksRequestBuilder.java | 29 + .../async/GetButlerTasksResponse.java | 253 ++ .../GetCompanionsDataRequestBuilder.java | 45 + .../async/GetCompanionsDataResponse.java | 254 ++ .../GetCountriesLibraryRequestBuilder.java | 57 + .../async/GetCountriesLibraryResponse.java | 253 ++ .../async/GetDevicesRequestBuilder.java | 29 + .../operations/async/GetDevicesResponse.java | 253 ++ .../async/GetFileHashRequestBuilder.java | 64 + .../operations/async/GetFileHashResponse.java | 181 + .../async/GetGenresLibraryRequestBuilder.java | 57 + .../async/GetGenresLibraryResponse.java | 253 ++ .../async/GetGeoDataRequestBuilder.java | 45 + .../operations/async/GetGeoDataResponse.java | 253 ++ .../async/GetGlobalHubsRequestBuilder.java | 70 + .../async/GetGlobalHubsResponse.java | 253 ++ .../async/GetHomeDataRequestBuilder.java | 29 + .../operations/async/GetHomeDataResponse.java | 253 ++ .../GetLibraryDetailsRequestBuilder.java | 78 + .../async/GetLibraryDetailsResponse.java | 253 ++ .../async/GetLibraryHubsRequestBuilder.java | 78 + .../async/GetLibraryHubsResponse.java | 253 ++ .../async/GetLibraryItemsRequestBuilder.java | 38 + .../async/GetLibraryItemsResponse.java | 253 ++ .../GetLibrarySectionsAllRequestBuilder.java | 38 + .../async/GetLibrarySectionsAllResponse.java | 253 ++ .../async/GetMediaArtsRequestBuilder.java | 48 + .../async/GetMediaArtsResponse.java | 253 ++ .../async/GetMediaMetaDataRequestBuilder.java | 38 + .../async/GetMediaMetaDataResponse.java | 253 ++ .../async/GetMediaPostersRequestBuilder.java | 48 + .../async/GetMediaPostersResponse.java | 253 ++ .../GetMediaProvidersRequestBuilder.java | 48 + .../async/GetMediaProvidersResponse.java | 253 ++ .../GetMetadataChildrenRequestBuilder.java | 64 + .../async/GetMetadataChildrenResponse.java | 253 ++ .../async/GetMyPlexAccountRequestBuilder.java | 29 + .../async/GetMyPlexAccountResponse.java | 253 ++ .../async/GetPinRequestBuilder.java | 53 + .../operations/async/GetPinResponse.java | 253 ++ .../GetPlaylistContentsRequestBuilder.java | 57 + .../async/GetPlaylistContentsResponse.java | 253 ++ .../async/GetPlaylistRequestBuilder.java | 48 + .../operations/async/GetPlaylistResponse.java | 253 ++ .../async/GetPlaylistsRequestBuilder.java | 70 + .../async/GetPlaylistsResponse.java | 253 ++ ...GetRecentlyAddedLibraryRequestBuilder.java | 38 + .../GetRecentlyAddedLibraryResponse.java | 253 ++ .../async/GetRecentlyAddedRequestBuilder.java | 38 + .../async/GetRecentlyAddedResponse.java | 253 ++ ...tRefreshLibraryMetadataRequestBuilder.java | 64 + .../GetRefreshLibraryMetadataResponse.java | 181 + .../async/GetResizedPhotoRequestBuilder.java | 38 + .../async/GetResizedPhotoResponse.java | 181 + .../GetResourcesStatisticsRequestBuilder.java | 55 + .../async/GetResourcesStatisticsResponse.java | 253 ++ .../GetSearchAllLibrariesRequestBuilder.java | 38 + .../async/GetSearchAllLibrariesResponse.java | 253 ++ .../async/GetSearchLibraryRequestBuilder.java | 57 + .../async/GetSearchLibraryResponse.java | 253 ++ .../async/GetSearchResultsRequestBuilder.java | 48 + .../async/GetSearchResultsResponse.java | 253 ++ .../GetServerActivitiesRequestBuilder.java | 29 + .../async/GetServerActivitiesResponse.java | 253 ++ .../GetServerCapabilitiesRequestBuilder.java | 29 + .../async/GetServerCapabilitiesResponse.java | 253 ++ .../GetServerIdentityRequestBuilder.java | 29 + .../async/GetServerIdentityResponse.java | 253 ++ .../async/GetServerListRequestBuilder.java | 29 + .../async/GetServerListResponse.java | 253 ++ .../GetServerPreferencesRequestBuilder.java | 29 + .../async/GetServerPreferencesResponse.java | 253 ++ .../GetServerResourcesRequestBuilder.java | 145 + .../async/GetServerResourcesResponse.java | 254 ++ .../GetSessionHistoryRequestBuilder.java | 99 + .../async/GetSessionHistoryResponse.java | 253 ++ .../async/GetSessionsRequestBuilder.java | 29 + .../operations/async/GetSessionsResponse.java | 253 ++ ...ceConnectionInformationRequestBuilder.java | 48 + ...etSourceConnectionInformationResponse.java | 181 + .../async/GetStatisticsRequestBuilder.java | 55 + .../async/GetStatisticsResponse.java | 253 ++ .../async/GetThumbImageRequestBuilder.java | 38 + .../async/GetThumbImageResponse.java | 284 ++ .../async/GetTimelineRequestBuilder.java | 38 + .../operations/async/GetTimelineResponse.java | 181 + .../async/GetTokenByPinIdRequestBuilder.java | 53 + .../async/GetTokenByPinIdResponse.java | 253 ++ .../async/GetTokenDetailsRequestBuilder.java | 45 + .../async/GetTokenDetailsResponse.java | 253 ++ .../GetTopWatchedContentRequestBuilder.java | 78 + .../async/GetTopWatchedContentResponse.java | 253 ++ .../GetTranscodeSessionsRequestBuilder.java | 29 + .../async/GetTranscodeSessionsResponse.java | 253 ++ .../GetTransientTokenRequestBuilder.java | 57 + .../async/GetTransientTokenResponse.java | 181 + .../async/GetUpdateStatusRequestBuilder.java | 29 + .../async/GetUpdateStatusResponse.java | 253 ++ .../async/GetUserFriendsRequestBuilder.java | 45 + .../async/GetUserFriendsResponse.java | 254 ++ .../async/GetUsersRequestBuilder.java | 53 + .../operations/async/GetUsersResponse.java | 233 ++ .../async/GetWatchListRequestBuilder.java | 53 + .../async/GetWatchListResponse.java | 253 ++ .../async/LogLineRequestBuilder.java | 65 + .../operations/async/LogLineResponse.java | 181 + .../async/LogMultiLineRequestBuilder.java | 38 + .../async/LogMultiLineResponse.java | 181 + .../async/MarkPlayedRequestBuilder.java | 48 + .../operations/async/MarkPlayedResponse.java | 181 + .../async/MarkUnplayedRequestBuilder.java | 48 + .../async/MarkUnplayedResponse.java | 181 + .../async/PerformSearchRequestBuilder.java | 92 + .../async/PerformSearchResponse.java | 181 + .../PerformVoiceSearchRequestBuilder.java | 92 + .../async/PerformVoiceSearchResponse.java | 181 + .../async/PostMediaArtsRequestBuilder.java | 78 + .../async/PostMediaArtsResponse.java | 181 + .../async/PostMediaPosterRequestBuilder.java | 78 + .../async/PostMediaPosterResponse.java | 181 + .../PostUsersSignInDataRequestBuilder.java | 53 + .../async/PostUsersSignInDataResponse.java | 253 ++ .../async/StartAllTasksRequestBuilder.java | 29 + .../async/StartAllTasksResponse.java | 181 + .../async/StartTaskRequestBuilder.java | 48 + .../operations/async/StartTaskResponse.java | 181 + ...StartUniversalTranscodeRequestBuilder.java | 38 + .../StartUniversalTranscodeResponse.java | 181 + .../async/StopAllTasksRequestBuilder.java | 29 + .../async/StopAllTasksResponse.java | 181 + .../async/StopTaskRequestBuilder.java | 48 + .../operations/async/StopTaskResponse.java | 181 + .../StopTranscodeSessionRequestBuilder.java | 48 + .../async/StopTranscodeSessionResponse.java | 181 + .../UpdatePlayProgressRequestBuilder.java | 65 + .../async/UpdatePlayProgressResponse.java | 181 + .../async/UpdatePlaylistRequestBuilder.java | 78 + .../async/UpdatePlaylistResponse.java | 181 + .../async/UploadPlaylistRequestBuilder.java | 77 + .../async/UploadPlaylistResponse.java | 181 + .../plexapi/sdk/models/shared/Security.java | 25 +- .../sdk/operations/AddPlaylistContents.java | 362 ++ .../plexapi/sdk/operations/ApplyUpdates.java | 333 ++ .../operations/CancelServerActivities.java | 330 ++ .../sdk/operations/CheckForUpdates.java | 333 ++ .../sdk/operations/ClearPlaylistContents.java | 330 ++ .../sdk/operations/CreatePlaylist.java | 360 ++ .../plexapi/sdk/operations/DeleteLibrary.java | 330 ++ .../sdk/operations/DeletePlaylist.java | 330 ++ .../sdk/operations/EnablePaperTrail.java | 327 ++ .../sdk/operations/GetActorsLibrary.java | 362 ++ .../sdk/operations/GetAllLibraries.java | 354 ++ .../sdk/operations/GetAvailableClients.java | 354 ++ .../operations/GetBandwidthStatistics.java | 360 ++ .../sdk/operations/GetBannerImage.java | 354 ++ .../sdk/operations/GetButlerTasks.java | 354 ++ .../sdk/operations/GetCompanionsData.java | 366 ++ .../sdk/operations/GetCountriesLibrary.java | 362 ++ .../plexapi/sdk/operations/GetDevices.java | 354 ++ .../plexapi/sdk/operations/GetFileHash.java | 333 ++ .../sdk/operations/GetGenresLibrary.java | 362 ++ .../plexapi/sdk/operations/GetGeoData.java | 364 ++ .../plexapi/sdk/operations/GetGlobalHubs.java | 360 ++ .../plexapi/sdk/operations/GetHomeData.java | 354 ++ .../sdk/operations/GetLibraryDetails.java | 362 ++ .../sdk/operations/GetLibraryHubs.java | 362 ++ .../sdk/operations/GetLibraryItems.java | 362 ++ .../sdk/operations/GetLibrarySectionsAll.java | 362 ++ .../plexapi/sdk/operations/GetMediaArts.java | 279 ++ .../sdk/operations/GetMediaMetaData.java | 362 ++ .../sdk/operations/GetMediaPosters.java | 279 ++ .../sdk/operations/GetMediaProviders.java | 356 ++ .../sdk/operations/GetMetadataChildren.java | 362 ++ .../sdk/operations/GetMyPlexAccount.java | 354 ++ .../dev/plexapi/sdk/operations/GetPin.java | 332 ++ .../plexapi/sdk/operations/GetPlaylist.java | 357 ++ .../sdk/operations/GetPlaylistContents.java | 362 ++ .../plexapi/sdk/operations/GetPlaylists.java | 360 ++ .../sdk/operations/GetRecentlyAdded.java | 282 ++ .../operations/GetRecentlyAddedLibrary.java | 360 ++ .../operations/GetRefreshLibraryMetadata.java | 335 ++ .../sdk/operations/GetResizedPhoto.java | 333 ++ .../operations/GetResourcesStatistics.java | 360 ++ .../sdk/operations/GetSearchAllLibraries.java | 361 ++ .../sdk/operations/GetSearchLibrary.java | 362 ++ .../sdk/operations/GetSearchResults.java | 360 ++ .../sdk/operations/GetServerActivities.java | 354 ++ .../sdk/operations/GetServerCapabilities.java | 354 ++ .../sdk/operations/GetServerIdentity.java | 314 ++ .../plexapi/sdk/operations/GetServerList.java | 354 ++ .../sdk/operations/GetServerPreferences.java | 354 ++ .../sdk/operations/GetServerResources.java | 373 ++ .../sdk/operations/GetSessionHistory.java | 360 ++ .../plexapi/sdk/operations/GetSessions.java | 354 ++ .../GetSourceConnectionInformation.java | 333 ++ .../plexapi/sdk/operations/GetStatistics.java | 360 ++ .../plexapi/sdk/operations/GetThumbImage.java | 354 ++ .../plexapi/sdk/operations/GetTimeline.java | 333 ++ .../sdk/operations/GetTokenByPinId.java | 368 ++ .../sdk/operations/GetTokenDetails.java | 365 ++ .../sdk/operations/GetTopWatchedContent.java | 360 ++ .../sdk/operations/GetTranscodeSessions.java | 354 ++ .../sdk/operations/GetTransientToken.java | 333 ++ .../sdk/operations/GetUpdateStatus.java | 354 ++ .../sdk/operations/GetUserFriends.java | 366 ++ .../dev/plexapi/sdk/operations/GetUsers.java | 349 ++ .../plexapi/sdk/operations/GetWatchList.java | 377 ++ .../dev/plexapi/sdk/operations/LogLine.java | 333 ++ .../plexapi/sdk/operations/LogMultiLine.java | 343 ++ .../plexapi/sdk/operations/MarkPlayed.java | 333 ++ .../plexapi/sdk/operations/MarkUnplayed.java | 333 ++ .../plexapi/sdk/operations/Operations.java | 56 + .../plexapi/sdk/operations/PerformSearch.java | 333 ++ .../sdk/operations/PerformVoiceSearch.java | 333 ++ .../plexapi/sdk/operations/PostMediaArts.java | 269 ++ .../sdk/operations/PostMediaPoster.java | 269 ++ .../sdk/operations/PostUsersSignInData.java | 379 ++ .../plexapi/sdk/operations/StartAllTasks.java | 327 ++ .../dev/plexapi/sdk/operations/StartTask.java | 330 ++ .../operations/StartUniversalTranscode.java | 333 ++ .../plexapi/sdk/operations/StopAllTasks.java | 327 ++ .../dev/plexapi/sdk/operations/StopTask.java | 330 ++ .../sdk/operations/StopTranscodeSession.java | 330 ++ .../sdk/operations/UpdatePlayProgress.java | 333 ++ .../sdk/operations/UpdatePlaylist.java | 335 ++ .../sdk/operations/UploadPlaylist.java | 333 ++ .../java/dev/plexapi/sdk/utils/AsyncHook.java | 100 + .../dev/plexapi/sdk/utils/AsyncHooks.java | 166 + .../dev/plexapi/sdk/utils/AsyncResponse.java | 24 + .../dev/plexapi/sdk/utils/AsyncRetries.java | 204 ++ .../sdk/utils/AsyncRetryableException.java | 20 + src/main/java/dev/plexapi/sdk/utils/Blob.java | 299 ++ .../dev/plexapi/sdk/utils/BlockingParser.java | 85 + .../sdk/utils/CopiableInputStream.java | 26 + .../dev/plexapi/sdk/utils/EventStream.java | 182 +- .../sdk/utils/EventStreamLineReader.java | 70 - .../plexapi/sdk/utils/EventStreamReader.java | 155 - .../dev/plexapi/sdk/utils/Exceptions.java | 95 + .../java/dev/plexapi/sdk/utils/Globals.java | 89 + .../dev/plexapi/sdk/utils/HTTPClient.java | 77 +- .../java/dev/plexapi/sdk/utils/Helpers.java | 2 +- .../dev/plexapi/sdk/utils/HookAdapters.java | 181 + .../java/dev/plexapi/sdk/utils/Hooks.java | 2 +- src/main/java/dev/plexapi/sdk/utils/JSON.java | 6 +- .../java/dev/plexapi/sdk/utils/Multipart.java | 292 +- .../sdk/utils/NonRetryableException.java | 17 + .../plexapi/sdk/utils/QueryParameters.java | 32 +- .../dev/plexapi/sdk/utils/Reflections.java | 138 + .../dev/plexapi/sdk/utils/RequestBody.java | 41 +- .../java/dev/plexapi/sdk/utils/Response.java | 1 - .../plexapi/sdk/utils/ResponseWithBody.java | 95 + .../java/dev/plexapi/sdk/utils/Retries.java | 30 +- .../plexapi/sdk/utils/RetryableException.java | 19 + .../dev/plexapi/sdk/utils/SessionManager.java | 2 +- .../sdk/utils/SpeakeasyHTTPClient.java | 43 +- .../plexapi/sdk/utils/StreamingParser.java | 322 ++ .../java/dev/plexapi/sdk/utils/Utils.java | 314 +- .../sdk/utils/reactive/EventStream.java | 363 ++ .../sdk/utils/reactive/ReactiveUtils.java | 512 +++ 1706 files changed, 122642 insertions(+), 37790 deletions(-) create mode 100644 docs/utils/Blob.md create mode 100644 src/main/java/dev/plexapi/sdk/AsyncActivities.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncAuthentication.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncButler.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncHubs.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncLibrary.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncLog.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncMedia.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncPlaylists.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncPlex.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncPlexAPI.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncSearch.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncServer.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncSessions.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncStatistics.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncUpdater.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncUsers.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncVideo.java create mode 100644 src/main/java/dev/plexapi/sdk/AsyncWatchlist.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/UncheckedSDKError.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetPinBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerIdentityRequestTimeout.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdResponseBody.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/LogLineBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/LogLineUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistUnauthorized.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistBadRequest.java create mode 100644 src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistUnauthorized.java delete mode 100644 src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetPinRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetPinResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/LogLineRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/LogLineResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistRequestBuilder.java create mode 100644 src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/AddPlaylistContents.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/ApplyUpdates.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/CancelServerActivities.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/CheckForUpdates.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/ClearPlaylistContents.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/CreatePlaylist.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/DeleteLibrary.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/DeletePlaylist.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/EnablePaperTrail.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetActorsLibrary.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetAllLibraries.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetAvailableClients.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetBandwidthStatistics.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetBannerImage.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetButlerTasks.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetCompanionsData.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetCountriesLibrary.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetDevices.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetFileHash.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetGenresLibrary.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetGeoData.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetGlobalHubs.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetHomeData.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetLibraryDetails.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetLibraryHubs.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetLibraryItems.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetLibrarySectionsAll.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetMediaArts.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetMediaMetaData.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetMediaPosters.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetMediaProviders.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetMetadataChildren.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetMyPlexAccount.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetPin.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetPlaylist.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetPlaylistContents.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetPlaylists.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetRecentlyAdded.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetRecentlyAddedLibrary.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetRefreshLibraryMetadata.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetResizedPhoto.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetResourcesStatistics.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetSearchAllLibraries.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetSearchLibrary.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetSearchResults.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetServerActivities.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetServerCapabilities.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetServerIdentity.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetServerList.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetServerPreferences.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetServerResources.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetSessionHistory.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetSessions.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetSourceConnectionInformation.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetStatistics.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetThumbImage.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetTimeline.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetTokenByPinId.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetTokenDetails.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetTopWatchedContent.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetTranscodeSessions.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetTransientToken.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetUpdateStatus.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetUserFriends.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetUsers.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/GetWatchList.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/LogLine.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/LogMultiLine.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/MarkPlayed.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/MarkUnplayed.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/Operations.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/PerformSearch.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/PerformVoiceSearch.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/PostMediaArts.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/PostMediaPoster.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/PostUsersSignInData.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/StartAllTasks.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/StartTask.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/StartUniversalTranscode.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/StopAllTasks.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/StopTask.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/StopTranscodeSession.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/UpdatePlayProgress.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/UpdatePlaylist.java create mode 100644 src/main/java/dev/plexapi/sdk/operations/UploadPlaylist.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/AsyncHook.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/AsyncHooks.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/AsyncResponse.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/AsyncRetries.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/AsyncRetryableException.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/Blob.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/BlockingParser.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/CopiableInputStream.java delete mode 100644 src/main/java/dev/plexapi/sdk/utils/EventStreamLineReader.java delete mode 100644 src/main/java/dev/plexapi/sdk/utils/EventStreamReader.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/Exceptions.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/Globals.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/HookAdapters.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/NonRetryableException.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/Reflections.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/ResponseWithBody.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/RetryableException.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/StreamingParser.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/reactive/EventStream.java create mode 100644 src/main/java/dev/plexapi/sdk/utils/reactive/ReactiveUtils.java diff --git a/.gitignore b/.gitignore index 25d5bbb1..2bacb101 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.env +.env.local **/.speakeasy/temp/ **/.speakeasy/logs/ .speakeasy/reports diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 112ac17a..ee241331 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,25 +1,25 @@ lockVersion: 2.0.0 id: 1732900d-e173-47c1-a90d-d45182eb35d9 management: - docChecksum: 77bdddd188d0778dc73b7f7906e1677c + docChecksum: addaf2dfdac23cef2e234b64492b9c90 docVersion: 0.0.3 - speakeasyVersion: 1.557.0 - generationVersion: 2.623.0 - releaseVersion: 0.17.1 - configChecksum: f865745905f2269f88f086ce18e82519 + speakeasyVersion: 1.615.2 + generationVersion: 2.698.4 + releaseVersion: 0.18.0 + configChecksum: 334e78bbbc1d2066c9f2041346a79b94 repoURL: https://github.com/LukeHagar/plexjava.git published: true features: java: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.1 - core: 3.37.4 + core: 3.47.2 deprecations: 2.81.1 downloadStreams: 0.1.1 enums: 2.81.2 - errors: 0.3.0 + errors: 0.5.0 flattening: 2.81.1 - globalSecurity: 2.82.8 + globalSecurity: 2.83.1 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.2 @@ -29,6 +29,7 @@ features: openEnums: 0.2.0 sdkHooks: 1.1.0 unions: 0.0.6 + uploadStreams: 0.1.0 generatedFiles: - .gitattributes - USAGE.md @@ -962,6 +963,7 @@ generatedFiles: - docs/sdks/users/README.md - docs/sdks/video/README.md - docs/sdks/watchlist/README.md + - docs/utils/Blob.md - gradle.properties - gradle/wrapper/gradle-wrapper.jar - gradle/wrapper/gradle-wrapper.properties @@ -969,6 +971,24 @@ generatedFiles: - gradlew.bat - settings.gradle - src/main/java/dev/plexapi/sdk/Activities.java + - src/main/java/dev/plexapi/sdk/AsyncActivities.java + - src/main/java/dev/plexapi/sdk/AsyncAuthentication.java + - src/main/java/dev/plexapi/sdk/AsyncButler.java + - src/main/java/dev/plexapi/sdk/AsyncHubs.java + - src/main/java/dev/plexapi/sdk/AsyncLibrary.java + - src/main/java/dev/plexapi/sdk/AsyncLog.java + - src/main/java/dev/plexapi/sdk/AsyncMedia.java + - src/main/java/dev/plexapi/sdk/AsyncPlaylists.java + - src/main/java/dev/plexapi/sdk/AsyncPlex.java + - src/main/java/dev/plexapi/sdk/AsyncPlexAPI.java + - src/main/java/dev/plexapi/sdk/AsyncSearch.java + - src/main/java/dev/plexapi/sdk/AsyncServer.java + - src/main/java/dev/plexapi/sdk/AsyncSessions.java + - src/main/java/dev/plexapi/sdk/AsyncStatistics.java + - src/main/java/dev/plexapi/sdk/AsyncUpdater.java + - src/main/java/dev/plexapi/sdk/AsyncUsers.java + - src/main/java/dev/plexapi/sdk/AsyncVideo.java + - src/main/java/dev/plexapi/sdk/AsyncWatchlist.java - src/main/java/dev/plexapi/sdk/Authentication.java - src/main/java/dev/plexapi/sdk/Butler.java - src/main/java/dev/plexapi/sdk/Hubs.java @@ -1289,6 +1309,7 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionErrors.java - src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionSessionsErrors.java - src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/UncheckedSDKError.java - src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressBadRequest.java - src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressErrors.java - src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressMediaErrors.java @@ -1301,6 +1322,246 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistErrors.java - src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistPlaylistsErrors.java - src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetPinBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerIdentityRequestTimeout.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdResponseBody.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/LogLineBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/LogLineUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistBadRequest.java + - src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistUnauthorized.java + - src/main/java/dev/plexapi/sdk/models/operations//async/AddPlaylistContentsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/ApplyUpdatesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/CancelServerActivitiesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/CheckForUpdatesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/ClearPlaylistContentsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/CreatePlaylistRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/DeleteLibraryRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/DeletePlaylistRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/EnablePaperTrailRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetActorsLibraryRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetAllLibrariesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetAvailableClientsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetBandwidthStatisticsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetBannerImageRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetButlerTasksRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetCompanionsDataRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetCountriesLibraryRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetDevicesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetFileHashRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetGenresLibraryRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetGeoDataRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetGlobalHubsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetHomeDataRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetLibraryDetailsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetLibraryHubsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetLibraryItemsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetLibrarySectionsAllRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetMediaArtsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetMediaMetaDataRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetMediaPostersRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetMediaProvidersRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetMetadataChildrenRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetMyPlexAccountRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetPinRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetPlaylistContentsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetPlaylistRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetPlaylistsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetRecentlyAddedLibraryRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetRecentlyAddedRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetRefreshLibraryMetadataRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetResizedPhotoRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetResourcesStatisticsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetSearchAllLibrariesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetSearchLibraryRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetSearchResultsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetServerActivitiesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetServerCapabilitiesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetServerIdentityRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetServerListRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetServerPreferencesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetServerResourcesRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetSessionHistoryRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetSessionsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetSourceConnectionInformationRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetStatisticsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetThumbImageRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetTimelineRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetTokenByPinIdRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetTokenDetailsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetTopWatchedContentRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetTranscodeSessionsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetTransientTokenRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetUpdateStatusRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetUserFriendsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetUsersRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/GetWatchListRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/LogLineRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/LogMultiLineRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/MarkPlayedRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/MarkUnplayedRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/PerformSearchRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/PerformVoiceSearchRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/PostMediaArtsRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/PostMediaPosterRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/PostUsersSignInDataRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/StartAllTasksRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/StartTaskRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/StartUniversalTranscodeRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/StopAllTasksRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/StopTaskRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/StopTranscodeSessionRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/UpdatePlayProgressRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/UpdatePlaylistRequestBuilder.java + - src/main/java/dev/plexapi/sdk/models/operations//async/UploadPlaylistRequestBuilder.java - src/main/java/dev/plexapi/sdk/models/operations/Account.java - src/main/java/dev/plexapi/sdk/models/operations/Action.java - src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java @@ -1926,7 +2187,6 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/ResponseBody.java - src/main/java/dev/plexapi/sdk/models/operations/Restricted.java - src/main/java/dev/plexapi/sdk/models/operations/Role.java - - src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java - src/main/java/dev/plexapi/sdk/models/operations/Scope.java - src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java - src/main/java/dev/plexapi/sdk/models/operations/SearchTypes.java @@ -1985,23 +2245,201 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/models/operations/UserProfile.java - src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java - src/main/java/dev/plexapi/sdk/models/operations/Writer.java + - src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetPinResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/LogLineResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistResponse.java + - src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistResponse.java - src/main/java/dev/plexapi/sdk/models/shared/Security.java + - src/main/java/dev/plexapi/sdk/operations/AddPlaylistContents.java + - src/main/java/dev/plexapi/sdk/operations/ApplyUpdates.java + - src/main/java/dev/plexapi/sdk/operations/CancelServerActivities.java + - src/main/java/dev/plexapi/sdk/operations/CheckForUpdates.java + - src/main/java/dev/plexapi/sdk/operations/ClearPlaylistContents.java + - src/main/java/dev/plexapi/sdk/operations/CreatePlaylist.java + - src/main/java/dev/plexapi/sdk/operations/DeleteLibrary.java + - src/main/java/dev/plexapi/sdk/operations/DeletePlaylist.java + - src/main/java/dev/plexapi/sdk/operations/EnablePaperTrail.java + - src/main/java/dev/plexapi/sdk/operations/GetActorsLibrary.java + - src/main/java/dev/plexapi/sdk/operations/GetAllLibraries.java + - src/main/java/dev/plexapi/sdk/operations/GetAvailableClients.java + - src/main/java/dev/plexapi/sdk/operations/GetBandwidthStatistics.java + - src/main/java/dev/plexapi/sdk/operations/GetBannerImage.java + - src/main/java/dev/plexapi/sdk/operations/GetButlerTasks.java + - src/main/java/dev/plexapi/sdk/operations/GetCompanionsData.java + - src/main/java/dev/plexapi/sdk/operations/GetCountriesLibrary.java + - src/main/java/dev/plexapi/sdk/operations/GetDevices.java + - src/main/java/dev/plexapi/sdk/operations/GetFileHash.java + - src/main/java/dev/plexapi/sdk/operations/GetGenresLibrary.java + - src/main/java/dev/plexapi/sdk/operations/GetGeoData.java + - src/main/java/dev/plexapi/sdk/operations/GetGlobalHubs.java + - src/main/java/dev/plexapi/sdk/operations/GetHomeData.java + - src/main/java/dev/plexapi/sdk/operations/GetLibraryDetails.java + - src/main/java/dev/plexapi/sdk/operations/GetLibraryHubs.java + - src/main/java/dev/plexapi/sdk/operations/GetLibraryItems.java + - src/main/java/dev/plexapi/sdk/operations/GetLibrarySectionsAll.java + - src/main/java/dev/plexapi/sdk/operations/GetMediaArts.java + - src/main/java/dev/plexapi/sdk/operations/GetMediaMetaData.java + - src/main/java/dev/plexapi/sdk/operations/GetMediaPosters.java + - src/main/java/dev/plexapi/sdk/operations/GetMediaProviders.java + - src/main/java/dev/plexapi/sdk/operations/GetMetadataChildren.java + - src/main/java/dev/plexapi/sdk/operations/GetMyPlexAccount.java + - src/main/java/dev/plexapi/sdk/operations/GetPin.java + - src/main/java/dev/plexapi/sdk/operations/GetPlaylist.java + - src/main/java/dev/plexapi/sdk/operations/GetPlaylistContents.java + - src/main/java/dev/plexapi/sdk/operations/GetPlaylists.java + - src/main/java/dev/plexapi/sdk/operations/GetRecentlyAdded.java + - src/main/java/dev/plexapi/sdk/operations/GetRecentlyAddedLibrary.java + - src/main/java/dev/plexapi/sdk/operations/GetRefreshLibraryMetadata.java + - src/main/java/dev/plexapi/sdk/operations/GetResizedPhoto.java + - src/main/java/dev/plexapi/sdk/operations/GetResourcesStatistics.java + - src/main/java/dev/plexapi/sdk/operations/GetSearchAllLibraries.java + - src/main/java/dev/plexapi/sdk/operations/GetSearchLibrary.java + - src/main/java/dev/plexapi/sdk/operations/GetSearchResults.java + - src/main/java/dev/plexapi/sdk/operations/GetServerActivities.java + - src/main/java/dev/plexapi/sdk/operations/GetServerCapabilities.java + - src/main/java/dev/plexapi/sdk/operations/GetServerIdentity.java + - src/main/java/dev/plexapi/sdk/operations/GetServerList.java + - src/main/java/dev/plexapi/sdk/operations/GetServerPreferences.java + - src/main/java/dev/plexapi/sdk/operations/GetServerResources.java + - src/main/java/dev/plexapi/sdk/operations/GetSessionHistory.java + - src/main/java/dev/plexapi/sdk/operations/GetSessions.java + - src/main/java/dev/plexapi/sdk/operations/GetSourceConnectionInformation.java + - src/main/java/dev/plexapi/sdk/operations/GetStatistics.java + - src/main/java/dev/plexapi/sdk/operations/GetThumbImage.java + - src/main/java/dev/plexapi/sdk/operations/GetTimeline.java + - src/main/java/dev/plexapi/sdk/operations/GetTokenByPinId.java + - src/main/java/dev/plexapi/sdk/operations/GetTokenDetails.java + - src/main/java/dev/plexapi/sdk/operations/GetTopWatchedContent.java + - src/main/java/dev/plexapi/sdk/operations/GetTranscodeSessions.java + - src/main/java/dev/plexapi/sdk/operations/GetTransientToken.java + - src/main/java/dev/plexapi/sdk/operations/GetUpdateStatus.java + - src/main/java/dev/plexapi/sdk/operations/GetUserFriends.java + - src/main/java/dev/plexapi/sdk/operations/GetUsers.java + - src/main/java/dev/plexapi/sdk/operations/GetWatchList.java + - src/main/java/dev/plexapi/sdk/operations/LogLine.java + - src/main/java/dev/plexapi/sdk/operations/LogMultiLine.java + - src/main/java/dev/plexapi/sdk/operations/MarkPlayed.java + - src/main/java/dev/plexapi/sdk/operations/MarkUnplayed.java + - src/main/java/dev/plexapi/sdk/operations/Operations.java + - src/main/java/dev/plexapi/sdk/operations/PerformSearch.java + - src/main/java/dev/plexapi/sdk/operations/PerformVoiceSearch.java + - src/main/java/dev/plexapi/sdk/operations/PostMediaArts.java + - src/main/java/dev/plexapi/sdk/operations/PostMediaPoster.java + - src/main/java/dev/plexapi/sdk/operations/PostUsersSignInData.java + - src/main/java/dev/plexapi/sdk/operations/StartAllTasks.java + - src/main/java/dev/plexapi/sdk/operations/StartTask.java + - src/main/java/dev/plexapi/sdk/operations/StartUniversalTranscode.java + - src/main/java/dev/plexapi/sdk/operations/StopAllTasks.java + - src/main/java/dev/plexapi/sdk/operations/StopTask.java + - src/main/java/dev/plexapi/sdk/operations/StopTranscodeSession.java + - src/main/java/dev/plexapi/sdk/operations/UpdatePlayProgress.java + - src/main/java/dev/plexapi/sdk/operations/UpdatePlaylist.java + - src/main/java/dev/plexapi/sdk/operations/UploadPlaylist.java + - src/main/java/dev/plexapi/sdk/utils/AsyncHook.java + - src/main/java/dev/plexapi/sdk/utils/AsyncHooks.java + - src/main/java/dev/plexapi/sdk/utils/AsyncResponse.java + - src/main/java/dev/plexapi/sdk/utils/AsyncRetries.java + - src/main/java/dev/plexapi/sdk/utils/AsyncRetryableException.java - src/main/java/dev/plexapi/sdk/utils/BackoffStrategy.java - src/main/java/dev/plexapi/sdk/utils/BigDecimalString.java - src/main/java/dev/plexapi/sdk/utils/BigIntegerString.java + - src/main/java/dev/plexapi/sdk/utils/Blob.java + - src/main/java/dev/plexapi/sdk/utils/BlockingParser.java - src/main/java/dev/plexapi/sdk/utils/Constants.java + - src/main/java/dev/plexapi/sdk/utils/CopiableInputStream.java - src/main/java/dev/plexapi/sdk/utils/Deserializers.java - src/main/java/dev/plexapi/sdk/utils/EventStream.java - - src/main/java/dev/plexapi/sdk/utils/EventStreamLineReader.java - src/main/java/dev/plexapi/sdk/utils/EventStreamMessage.java - - src/main/java/dev/plexapi/sdk/utils/EventStreamReader.java + - src/main/java/dev/plexapi/sdk/utils/Exceptions.java - src/main/java/dev/plexapi/sdk/utils/FormMetadata.java + - src/main/java/dev/plexapi/sdk/utils/Globals.java - src/main/java/dev/plexapi/sdk/utils/HTTPClient.java - src/main/java/dev/plexapi/sdk/utils/HTTPRequest.java - src/main/java/dev/plexapi/sdk/utils/HasSecurity.java - src/main/java/dev/plexapi/sdk/utils/HeaderMetadata.java - src/main/java/dev/plexapi/sdk/utils/Helpers.java - src/main/java/dev/plexapi/sdk/utils/Hook.java + - src/main/java/dev/plexapi/sdk/utils/HookAdapters.java - src/main/java/dev/plexapi/sdk/utils/Hooks.java - src/main/java/dev/plexapi/sdk/utils/JSON.java - src/main/java/dev/plexapi/sdk/utils/LazySingletonValue.java @@ -2009,6 +2447,7 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/utils/Multipart.java - src/main/java/dev/plexapi/sdk/utils/MultipartFormMetadata.java - src/main/java/dev/plexapi/sdk/utils/NameValue.java + - src/main/java/dev/plexapi/sdk/utils/NonRetryableException.java - src/main/java/dev/plexapi/sdk/utils/OneOfDeserializer.java - src/main/java/dev/plexapi/sdk/utils/Options.java - src/main/java/dev/plexapi/sdk/utils/PathParamsMetadata.java @@ -2017,21 +2456,27 @@ generatedFiles: - src/main/java/dev/plexapi/sdk/utils/QueryParameters.java - src/main/java/dev/plexapi/sdk/utils/QueryParamsMetadata.java - src/main/java/dev/plexapi/sdk/utils/RecordingClient.java + - src/main/java/dev/plexapi/sdk/utils/Reflections.java - src/main/java/dev/plexapi/sdk/utils/RequestBody.java - src/main/java/dev/plexapi/sdk/utils/RequestMetadata.java - src/main/java/dev/plexapi/sdk/utils/Response.java + - src/main/java/dev/plexapi/sdk/utils/ResponseWithBody.java - src/main/java/dev/plexapi/sdk/utils/Retries.java - src/main/java/dev/plexapi/sdk/utils/RetryConfig.java + - src/main/java/dev/plexapi/sdk/utils/RetryableException.java - src/main/java/dev/plexapi/sdk/utils/Security.java - src/main/java/dev/plexapi/sdk/utils/SecurityMetadata.java - src/main/java/dev/plexapi/sdk/utils/SerializedBody.java - src/main/java/dev/plexapi/sdk/utils/SessionManager.java - src/main/java/dev/plexapi/sdk/utils/SpeakeasyHTTPClient.java - src/main/java/dev/plexapi/sdk/utils/SpeakeasyMetadata.java + - src/main/java/dev/plexapi/sdk/utils/StreamingParser.java - src/main/java/dev/plexapi/sdk/utils/TypedObject.java - src/main/java/dev/plexapi/sdk/utils/Types.java - src/main/java/dev/plexapi/sdk/utils/Utf8UrlEncoder.java - src/main/java/dev/plexapi/sdk/utils/Utils.java + - src/main/java/dev/plexapi/sdk/utils/reactive/EventStream.java + - src/main/java/dev/plexapi/sdk/utils/reactive/ReactiveUtils.java examples: getServerCapabilities: speakeasy-default-get-server-capabilities: @@ -2154,6 +2599,17 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-update-play-progress: + parameters: + query: + key: "" + time: 90000 + state: "played" + responses: + "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-banner-image: speakeasy-default-get-banner-image: parameters: @@ -2211,6 +2667,24 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-get-timeline: + parameters: + query: + ratingKey: 23409 + key: "/library/metadata/23409" + state: "playing" + hasMDE: 1 + time: 2000 + duration: 10000 + context: "home:hub.continueWatching" + playQueueItemID: 1 + playBackTime: 2000 + row: 1 + responses: + "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}]} startUniversalTranscode: "": parameters: @@ -2236,6 +2710,30 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-start-universal-transcode: + parameters: + query: + hasMDE: 1 + path: "/library/metadata/23409" + mediaIndex: 0 + partIndex: 0 + protocol: "hls" + fastSeek: 0 + directPlay: 0 + directStream: 0 + subtitleSize: 100 + subtites: "burn" + audioBoost: 100 + location: "lan" + mediaBufferSize: 102400 + session: "zvcage8b7rkioqcm8f4uns4c" + addDebugOverlay: 0 + autoAdjustQuality: 0 + responses: + "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}]} getServerActivities: speakeasy-default-get-server-activities: responses: @@ -2255,6 +2753,15 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-cancel-server-activities: + parameters: + path: + activityUUID: "25b71ed5-0f9d-461c-baa7-d404e9e10d3e" + responses: + "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}]} getButlerTasks: speakeasy-default-get-butler-tasks: responses: @@ -2350,6 +2857,21 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-get-server-resources: + parameters: + query: + includeHttps: 1 + includeRelay: 1 + includeIPv6: 1 + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + responses: + "200": + application/json: [{"name": "", "product": "Ergonomic Plastic Hat", "productVersion": "", "platform": "", "platformVersion": "", "device": "Mobile", "clientIdentifier": "", "createdAt": "2019-06-24T11:38:02Z", "lastSeenAt": "2019-06-24T11:38:02Z", "provides": "", "ownerId": null, "sourceTitle": "", "publicAddress": "", "accessToken": "", "owned": true, "home": false, "synced": false, "relay": true, "presence": false, "httpsRequired": true, "publicAddressMatches": false, "dnsRebindingProtection": true, "natLoopbackSupported": false, "connections": [{"protocol": "http", "address": "5746 Mount Street", "port": 441996, "uri": "https://wide-kick.name/", "local": false, "relay": true, "IPv6": true}]}] + "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}]} getPin: "": parameters: @@ -2366,6 +2888,21 @@ examples: 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} "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + speakeasy-default-get-pin: + parameters: + query: + strong: false + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + responses: + "201": + 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} + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} getTokenByPinId: "": parameters: @@ -2380,6 +2917,23 @@ examples: responses: "404": application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]} + speakeasy-default-get-token-by-pin-id: + parameters: + path: + pinID: 232248 + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + responses: + "200": + application/json: {"id": 308667304, "code": "7RQZ", "product": "0", "trusted": false, "qr": "https://plex.tv/api/v2/pins/qr/7RQZ", "clientIdentifier": "string", "location": {"code": "VI", "continent_code": "NA", "country": "United States Virgin Islands", "city": "Amsterdam", "european_union_member": true, "time_zone": "America/St_Thomas", "postal_code": "802", "in_privacy_restricted_country": true, "in_privacy_restricted_region": true, "subdivisions": "Saint Thomas", "coordinates": "18.3381, -64.8941"}, "expiresIn": 876, "createdAt": "2024-07-16T17:03:05Z", "expiresAt": "2024-07-16T17:18:05Z", "authToken": null, "newRegistration": null} + "400": + application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} + "404": + application/json: {"errors": [{"code": 1020, "message": "Code not found or expired"}]} getGlobalHubs: speakeasy-default-get-global-hubs: responses: @@ -2634,6 +3188,22 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-get-search-all-libraries: + parameters: + query: + query: "" + searchTypes: ["people"] + includeCollections: 1 + includeExternalMedia: 1 + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + responses: + "200": + application/json: {"MediaContainer": {"size": 50, "allowSync": false, "identifier": "com.plexapp.plugins.library", "librarySectionID": 2, "librarySectionTitle": "TV Series", "librarySectionUUID": "e69655a2-ef48-4aba-bb19-0cc34d1e7d36", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "SearchResult": [{"score": 0.92, "Directory": {"key": "/library/sections/3/all?actor=197429", "librarySectionID": 1, "librarySectionKey": "/library/sections/1", "librarySectionTitle": "Movies", "librarySectionType": 1, "type": "tag", "id": 197429, "filter": "actor=197429", "tag": "Ben Stiller", "tagType": 4, "tagKey": "5d776826999c64001ec2c606", "thumb": "https://metadata-static.plex.tv/5/people/57bd7c7d6c5c9e2881251b30e5603d3d.jpg", "count": 10}, "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "slug": "4-for-texas", "studio": "20th Century Studios", "type": "movie", "title": "Avatar: The Way of Water", "banner": "/library/metadata/58683/banner/1703239236", "titleSort": "Whale", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora.\nOnce a familiar threat returns to finish what was previously started, Jake must\nwork with Neytiri and the army of the Na'vi race to protect their home.\n", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "tagline": "Return to Pandora.", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "theme": "/library/metadata/1/theme/1705636920", "index": 1, "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "seasonCount": 2022, "duration": 11558112, "originallyAvailableAt": "2022-12-14", "addedAt": 1556281940, "updatedAt": 1556281940, "parentYear": 2010, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "parentRatingKey": "66", "grandparentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentSlug": "alice-in-borderland-2020", "grandparentKey": "/library/metadata/66", "parentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "grandparentArt": "/library/metadata/66/art/1705716261", "parentTitle": "Caprica", "parentIndex": 1, "parentThumb": "/library/metadata/66/thumb/1705716261", "ratingImage": "rottentomatoes://image.rating.ripe", "viewCount": 1, "viewOffset": 5222500, "skipCount": 1, "subtype": "clip", "lastRatedAt": 1721813113, "createdAtAccuracy": "epoch,local", "createdAtTZOffset": "0", "lastViewedAt": 1682752242, "userRating": 10, "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Guid": [{"id": "{\"imdbExample\":{\"summary\":\"IMDB example\",\"value\":\"imdb://tt13015952\"},\"tmdbExample\":{\"summary\":\"TMDB example\",\"value\":\"tmdb://2434012\"},\"tvdbExample\":{\"summary\":\"TVDB example\",\"value\":\"tvdb://7945991\"}}"}], "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "showOrdering": "absolute", "flattenSeasons": "1", "skipChildren": false, "Media": [{"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "aac", "videoCodec": "hevc", "videoResolution": "4k", "container": "mp4", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1"}]}], "Genre": [{"id": 259, "tag": "Crime"}], "Country": [{"id": 259, "tag": "United States of America"}], "Director": [{"id": 126522, "tag": "Danny Boyle", "thumb": "https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg"}], "Writer": [{"id": 126522, "tag": "Jamie P. Hanson", "thumb": "https://metadata-static.plex.tv/8/people/8d65fa96804802e08f2de09fe014408e.jpg"}], "Role": [{"id": 126522, "tag": "Teller", "role": "Self - Judge", "thumb": "https://metadata-static.plex.tv/7/people/708568fd018d7aa8b1032dcf867747e8.jpg"}], "Location": [{"path": "/TV Shows/Clarkson's Farm"}]}}]}} + "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-media-meta-data: speakeasy-default-get-media-meta-data: parameters: @@ -2943,6 +3513,23 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-post-users-sign-in-data: + parameters: + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + requestBody: + application/x-www-form-urlencoded: {"login": "username@email.com", "password": "password123", "rememberMe": false, "verificationCode": "123456"} + responses: + "201": + application/json: {"adsConsent": null, "adsConsentReminderAt": 1556281940, "adsConsentSetAt": 1556281940, "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": "ru", "mailingListActive": false, "mailingListStatus": "active", "maxHomeSize": 15, "profile": {"autoSelectAudio": true, "defaultAudioLanguage": "ja", "defaultSubtitleLanguage": "en", "autoSelectSubtitle": 1, "defaultSubtitleAccessibility": 1, "defaultSubtitleForced": 1, "watchedIndicator": 1, "mediaReviewsVisibility": 1}, "protected": false, "rememberExpiresAt": 1556281940, "restricted": false, "scrobbleTypes": "", "services": [], "subscription": {"active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive"}, "subscriptionDescription": "", "subscriptions": [{"active": true, "subscribedAt": "2021-04-12T18:21:12Z", "status": "Inactive"}], "thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101", "title": "UsernameTitle", "twoFactorEnabled": false, "username": "Username", "uuid": "dae343c1f45beb4f", "attributionPartner": null, "pastSubscriptions": [], "trials": []} + "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}]} getStatistics: "": parameters: @@ -2955,6 +3542,17 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-get-statistics: + parameters: + query: + timespan: 4 + responses: + "200": + application/json: {"MediaContainer": {"size": 5497, "Device": [{"id": 208, "name": "Roku Express", "platform": "Roku", "clientIdentifier": "793095d235660625108ef785cc7646e9", "createdAt": 1706470556}], "Account": [{"id": 238960586, "key": "/accounts/238960586", "name": "Diane", "defaultAudioLanguage": "en", "autoSelectAudio": true, "defaultSubtitleLanguage": "en", "subtitleMode": 1, "thumb": "https://plex.tv/users/50d83634246da1de/avatar?c=1707110967"}], "StatisticsMedia": [{"accountID": 1, "deviceID": 13, "timespan": 4, "at": 1707141600, "metadataType": 4, "count": 1, "duration": 1555}]}} + "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}]} getResourcesStatistics: "": parameters: @@ -2967,6 +3565,17 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-get-resources-statistics: + parameters: + query: + timespan: 4 + responses: + "200": + application/json: {"MediaContainer": {"size": 5497, "StatisticsResources": [{"timespan": 6, "at": 1718384427, "hostCpuUtilization": 1.276, "processCpuUtilization": 0.025, "hostMemoryUtilization": 17.026, "processMemoryUtilization": 0.493}]}} + "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}]} getBandwidthStatistics: "": parameters: @@ -2979,6 +3588,17 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-get-bandwidth-statistics: + parameters: + query: + timespan: 4 + responses: + "200": + application/json: {"MediaContainer": {"size": 5497, "Device": [{"id": 208, "name": "Roku Express", "platform": "Roku", "clientIdentifier": "793095d235660625108ef785cc7646e9", "createdAt": 1706470556}], "Account": [{"id": 238960586, "key": "/accounts/238960586", "name": "Diane", "defaultAudioLanguage": "en", "autoSelectAudio": true, "defaultSubtitleLanguage": "en", "subtitleMode": 1, "thumb": "https://plex.tv/users/50d83634246da1de/avatar?c=1707110967"}], "StatisticsBandwidth": [{"accountID": 238960586, "deviceID": 208, "timespan": 6, "at": 1718387650, "lan": true, "bytes": 22}]}} + "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}]} getSessions: speakeasy-default-get-sessions: responses: @@ -3071,6 +3691,19 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-get-session-history: + parameters: + query: + accountId: 1 + filter: {} + librarySectionID: 12 + responses: + "200": + application/json: {"MediaContainer": {"size": 10855, "Metadata": [{"historyKey": "/status/sessions/history/1", "key": "/library/metadata/32171", "ratingKey": "32171", "librarySectionID": "2", "parentKey": "/library/metadata/32170", "grandparentKey": "/library/metadata/32132", "title": "The Noise That Blue Makes", "grandparentTitle": "Taskmaster", "type": "episode", "thumb": "/library/metadata/32171/thumb/-1", "parentThumb": "/library/metadata/32170/thumb/1654134301", "grandparentThumb": "/library/metadata/32132/thumb/1703933346", "grandparentArt": "/library/metadata/32132/art/1703933346", "index": 1, "parentIndex": 13, "originallyAvailableAt": "2022-04-14T00:00:00Z", "viewedAt": 1654139223, "accountID": 1, "deviceID": 5}]}} + "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}]} getTranscodeSessions: speakeasy-default-get-transcode-sessions: responses: @@ -3109,6 +3742,15 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-check-for-updates: + parameters: + query: + download: 1 + responses: + "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}]} applyUpdates: "": parameters: @@ -3120,6 +3762,16 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-apply-updates: + parameters: + query: + tonight: 1 + skip: 1 + responses: + "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-users: "": parameters: @@ -3144,5 +3796,28 @@ examples: application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": application/json: {"errors": [{"code": 1001, "message": "User could not be authenticated", "status": 401}]} + speakeasy-default-get-users: + parameters: + header: + X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" + X-Plex-Product: "Plex for Roku" + X-Plex-Device: "Roku 3" + X-Plex-Device-Name: "Chrome" + X-Plex-Device-Screen-Resolution: "1487x1165,2560x1440" + X-Plex-Version: "2.4.1" + X-Plex-Platform: "Roku" + X-Plex-Features: "external-media,indirect-media,hub-style-list" + X-Plex-Model: "4200X" + X-Plex-Session-Id: "97e136ef-4ddd-4ff3-89a7-a5820c96c2ca" + X-Plex-Language: "en" + X-Plex-Platform-Version: "4.3 build 1057" + X-Plex-Token: "CV5xoxjTpFKUzBTShsaf" + responses: + "200": + application/xml: "0xfD5052DbD1" + "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}]} examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e676eea1..d74752e3 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,17 +16,25 @@ generation: auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + tests: + generateTests: true + generateNewTests: false + skipResponseBodyAssertions: false java: - version: 0.17.1 + version: 0.18.0 additionalDependencies: [] additionalPlugins: [] artifactID: plexapi + asyncMode: enabled baseErrorName: PlexAPIError clientServerStatusCodesAsErrors: true companyEmail: lukeslakemail@gmail.com companyName: plexapi companyURL: plexapi.dev defaultErrorName: SDKError + enableCustomCodeRegions: false + enableStreamingUploads: false flattenGlobalSecurity: true githubURL: github.com/LukeHagar/plexjava groupID: dev.plexapi @@ -39,11 +47,13 @@ java: shared: models/shared webhooks: models/webhooks inputModelSuffix: input + languageVersion: 11 license: name: The MIT License (MIT) shortName: MIT url: https://mit-license.org/ maxMethodParams: 4 + nullFriendlyParameters: false outputModelSuffix: output packageName: dev.plexapi.sdk projectName: plexapi diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1841b102..672395e6 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.557.0 +speakeasyVersion: 1.615.2 sources: my-source: sourceNamespace: my-source @@ -8,19 +8,19 @@ sources: - latest plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:dafcc1192236829b85bc924e0462432c0eb7318a17c542f46e3dd05a9a6265df - sourceBlobDigest: sha256:bc072115d585e1695cb8393db901a3d36be1dcd57a69bad2b91a1ba7ac3c9c4b + sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787 + sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0 tags: - latest - - speakeasy-sdk-regen-1749429180 + - speakeasy-sdk-regen-1757982495 targets: plexjava: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:dafcc1192236829b85bc924e0462432c0eb7318a17c542f46e3dd05a9a6265df - sourceBlobDigest: sha256:bc072115d585e1695cb8393db901a3d36be1dcd57a69bad2b91a1ba7ac3c9c4b + sourceRevisionDigest: sha256:5125adfea1b0daea399c6ecf755e32795de6b4131465ae6a1f32ad73b3bc7787 + sourceBlobDigest: sha256:95cea18b6e5f7d76d35db0aba5bcb59e72cf204451a2b09a99be0e3e9ec1f4c0 codeSamplesNamespace: code-samples-java-plexjava - codeSamplesRevisionDigest: sha256:9a3449eb22007686202d7d579803f2444900048695cc795361b72f801f88a98a + codeSamplesRevisionDigest: sha256:8b12917dc69cedbce837d23b4200b61d0bcb2984e40cd44ce83aac6211a8f206 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index b5e3ec10..10d97eb7 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,9 @@ The following SDKs are generated from the OpenAPI Specification. They are automa * [Available Resources and Operations](#available-resources-and-operations) * [Error Handling](#error-handling) * [Server Selection](#server-selection) + * [Asynchronous Support](#asynchronous-support) * [Authentication](#authentication) + * [Debugging](#debugging) * [Development](#development) * [Maturity](#maturity) * [Contributions](#contributions) @@ -69,7 +71,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'dev.plexapi:plexapi:0.17.1' +implementation 'dev.plexapi:plexapi:0.18.0' ``` Maven: @@ -77,7 +79,7 @@ Maven: dev.plexapi plexapi - 0.17.1 + 0.18.0 ``` @@ -94,29 +96,6 @@ On Windows: ```bash gradlew.bat publishToMavenLocal -Pskip.signing ``` - -### Logging -A logging framework/facade has not yet been adopted but is under consideration. - -For request and response logging (especially json bodies) use: -```java -SpeakeasyHTTPClient.setDebugLogging(true); // experimental API only (may change without warning) -``` -Example output: -``` -Sending request: http://localhost:35123/bearer#global GET -Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]} -Received response: (GET http://localhost:35123/bearer#global) 200 -Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]} -Response body: -{ - "authenticated": true, - "token": "global" -} -``` -WARNING: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`. - -Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies. @@ -138,7 +117,7 @@ public class Application { public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -150,6 +129,38 @@ public class Application { } } ``` +#### Asynchronous Call +An asynchronous SDK client is also available that returns a [`CompletableFuture`][comp-fut]. See [Asynchronous Support](#asynchronous-support) for more details on async benefits and reactive library integration. +```java +package hello.world; + +import dev.plexapi.sdk.AsyncPlexAPI; +import dev.plexapi.sdk.PlexAPI; +import dev.plexapi.sdk.models.operations.async.GetServerCapabilitiesResponse; +import java.util.concurrent.CompletableFuture; + +public class Application { + + public static void main(String[] args) { + + AsyncPlexAPI sdk = PlexAPI.builder() + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) + .build() + .async(); + + CompletableFuture resFut = sdk.server().getServerCapabilities() + .call(); + + resFut.thenAccept(res -> { + if (res.object().isPresent()) { + // handle response + } + }); + } +} +``` + +[comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html @@ -326,7 +337,7 @@ public class Application { public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -373,7 +384,7 @@ public class Application { .protocol(ServerProtocol.HTTPS) .ip("4982:bc2a:b4f8:efb5:2394:5bc3:ab4f:0e6d") .port("44765") - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -404,7 +415,7 @@ public class Application { PlexAPI sdk = PlexAPI.builder() .serverURL("https://10.10.10.47:32400") - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -434,7 +445,7 @@ public class Application { public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -449,6 +460,72 @@ public class Application { ``` + +## Asynchronous Support + +The SDK provides comprehensive asynchronous support using Java's [`CompletableFuture`][comp-fut] and [Reactive Streams `Publisher`][reactive-streams] APIs. This design makes no assumptions about your choice of reactive toolkit, allowing seamless integration with any reactive library. + +
+Why Use Async? + +Asynchronous operations provide several key benefits: + +- **Non-blocking I/O**: Your threads stay free for other work while operations are in flight +- **Better resource utilization**: Handle more concurrent operations with fewer threads +- **Improved scalability**: Build highly responsive applications that can handle thousands of concurrent requests +- **Reactive integration**: Works seamlessly with reactive streams and backpressure handling + +
+ +
+Reactive Library Integration + +The SDK returns [Reactive Streams `Publisher`][reactive-streams] instances for operations dealing with streams involving multiple I/O interactions. We use Reactive Streams instead of JDK Flow API to provide broader compatibility with the reactive ecosystem, as most reactive libraries natively support Reactive Streams. + +**Why Reactive Streams over JDK Flow?** +- **Broader ecosystem compatibility**: Most reactive libraries (Project Reactor, RxJava, Akka Streams, etc.) natively support Reactive Streams +- **Industry standard**: Reactive Streams is the de facto standard for reactive programming in Java +- **Better interoperability**: Seamless integration without additional adapters for most use cases + +**Integration with Popular Libraries:** +- **Project Reactor**: Use `Flux.from(publisher)` to convert to Reactor types +- **RxJava**: Use `Flowable.fromPublisher(publisher)` for RxJava integration +- **Akka Streams**: Use `Source.fromPublisher(publisher)` for Akka Streams integration +- **Vert.x**: Use `ReadStream.fromPublisher(vertx, publisher)` for Vert.x reactive streams +- **Mutiny**: Use `Multi.createFrom().publisher(publisher)` for Quarkus Mutiny integration + +**For JDK Flow API Integration:** +If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use adapters: +```java +// Convert Reactive Streams Publisher to Flow Publisher +Flow.Publisher flowPublisher = FlowAdapters.toFlowPublisher(reactiveStreamsPublisher); + +// Convert Flow Publisher to Reactive Streams Publisher +Publisher reactiveStreamsPublisher = FlowAdapters.toPublisher(flowPublisher); +``` + +For standard single-response operations, the SDK returns `CompletableFuture` for straightforward async execution. + +
+ +
+Supported Operations + +Async support is available for: + +- **[Server-sent Events](#server-sent-event-streaming)**: Stream real-time events with Reactive Streams `Publisher` +- **[JSONL Streaming](#jsonl-streaming)**: Process streaming JSON lines asynchronously +- **[Pagination](#pagination)**: Iterate through paginated results using `callAsPublisher()` and `callAsPublisherUnwrapped()` +- **[File Uploads](#file-uploads)**: Upload files asynchronously with progress tracking +- **[File Downloads](#file-downloads)**: Download files asynchronously with streaming support +- **[Standard Operations](#example)**: All regular API calls return `CompletableFuture` for async execution + +
+ +[comp-fut]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html +[reactive-streams]: https://www.reactive-streams.org/ + + ## Authentication @@ -475,7 +552,7 @@ public class Application { public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -489,6 +566,37 @@ public class Application { ``` + +## Debugging + +### Debug +You can setup your SDK to emit debug logs for SDK requests and responses. + +For request and response logging (especially json bodies), call `enableHTTPDebugLogging(boolean)` on the SDK builder like so: +```java +SDK.builder() + .enableHTTPDebugLogging(true) + .build(); +``` +Example output: +``` +Sending request: http://localhost:35123/bearer#global GET +Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]} +Received response: (GET http://localhost:35123/bearer#global) 200 +Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]} +Response body: +{ + "authenticated": true, + "token": "global" +} +``` +__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`. + +__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting. + +Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies. + + # Development diff --git a/RELEASES.md b/RELEASES.md index 51c21a02..c2a2643b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -368,4 +368,14 @@ Based on: ### Generated - [java v0.17.1] . ### Releases -- [Maven Central v0.17.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.17.1 - . \ No newline at end of file +- [Maven Central v0.17.1] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.17.1 - . + +## 2025-09-16 00:27:57 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.615.2 (2.698.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.18.0] . +### Releases +- [Maven Central v0.18.0] https://central.sonatype.com/artifact/dev.plexapi/plexapi/0.18.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 53a171a9..de3fe3a7 100644 --- a/USAGE.md +++ b/USAGE.md @@ -13,7 +13,7 @@ public class Application { public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() diff --git a/build.gradle b/build.gradle index 7d89b7ca..46ecae10 100644 --- a/build.gradle +++ b/build.gradle @@ -27,8 +27,6 @@ repositories { } java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 withSourcesJar() withJavadocJar() } @@ -61,10 +59,14 @@ javadoc { } tasks.withType(Javadoc) { - failOnError false + failOnError = false options.addStringOption('Xdoclint:none', '-quiet') } +tasks.withType(JavaCompile).configureEach { + options.release = 11 +} + sourcesJar { archiveBaseName = "${artifactId}" } @@ -103,11 +105,15 @@ publishing { // https://github.com/gradle/gradle/issues/18619 groupId = "dev.plexapi" artifactId = "plexapi" - version = "0.17.1" + version = "0.18.0" from components.java pom { + properties = [ + 'maven.compiler.source': '11', + 'maven.compiler.target': '11', + ] name = 'plexapi Java SDK' description = 'SDK enabling Java developers to easily integrate with the plexapi API.' url = 'https://github.com/LukeHagar/plexjava' @@ -155,6 +161,7 @@ dependencies { implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2' api('org.openapitools:jackson-databind-nullable:0.2.6') {exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'} implementation 'commons-io:commons-io:2.18.0' + api 'org.reactivestreams:reactive-streams:1.0.4' } -apply from: 'build-extras.gradle' +apply from: 'build-extras.gradle' \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 6ba45898..d5ad6584 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -22,7 +22,7 @@ actions: public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -52,7 +52,7 @@ actions: public static void main(String[] args) throws GetServerPreferencesBadRequest, GetServerPreferencesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerPreferencesResponse res = sdk.server().getServerPreferences() @@ -82,12 +82,12 @@ actions: public static void main(String[] args) throws UpdatePlayProgressBadRequest, UpdatePlayProgressUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() .key("") - .time(90000) + .time(90000d) .state("played") .call(); @@ -113,11 +113,11 @@ actions: public static void main(String[] args) throws MarkPlayedBadRequest, MarkPlayedUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); MarkPlayedResponse res = sdk.media().markPlayed() - .key(59398) + .key(59398d) .call(); // handle response @@ -142,20 +142,20 @@ actions: public static void main(String[] args) throws GetTimelineBadRequest, GetTimelineUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTimelineRequest req = GetTimelineRequest.builder() - .ratingKey(23409) + .ratingKey(23409d) .key("/library/metadata/23409") .state(State.PLAYING) - .hasMDE(1) - .time(2000) - .duration(10000) + .hasMDE(1d) + .time(2000d) + .duration(10000d) .context("home:hub.continueWatching") - .playQueueItemID(1) - .playBackTime(2000) - .row(1) + .playQueueItemID(1d) + .playBackTime(2000d) + .row(1d) .build(); GetTimelineResponse res = sdk.video().getTimeline() @@ -184,11 +184,11 @@ actions: public static void main(String[] args) throws MarkUnplayedBadRequest, MarkUnplayedUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); MarkUnplayedResponse res = sdk.media().markUnplayed() - .key(59398) + .key(59398d) .call(); // handle response @@ -213,7 +213,7 @@ actions: public static void main(String[] args) throws GetServerActivitiesBadRequest, GetServerActivitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerActivitiesResponse res = sdk.activities().getServerActivities() @@ -243,7 +243,7 @@ actions: public static void main(String[] args) throws CancelServerActivitiesBadRequest, CancelServerActivitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() @@ -272,7 +272,7 @@ actions: public static void main(String[] args) throws StopAllTasksBadRequest, StopAllTasksUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StopAllTasksResponse res = sdk.butler().stopAllTasks() @@ -300,7 +300,7 @@ actions: public static void main(String[] args) throws GetButlerTasksBadRequest, GetButlerTasksUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetButlerTasksResponse res = sdk.butler().getButlerTasks() @@ -330,7 +330,7 @@ actions: public static void main(String[] args) throws StartAllTasksBadRequest, StartAllTasksUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StartAllTasksResponse res = sdk.butler().startAllTasks() @@ -359,7 +359,7 @@ actions: public static void main(String[] args) throws StopTaskBadRequest, StopTaskUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StopTaskResponse res = sdk.butler().stopTask() @@ -389,7 +389,7 @@ actions: public static void main(String[] args) throws StartTaskBadRequest, StartTaskUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StartTaskResponse res = sdk.butler().startTask() @@ -418,7 +418,7 @@ actions: public static void main(String[] args) throws GetAvailableClientsBadRequest, GetAvailableClientsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetAvailableClientsResponse res = sdk.server().getAvailableClients() @@ -448,7 +448,7 @@ actions: public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -478,7 +478,7 @@ actions: public static void main(String[] args) throws GetDevicesBadRequest, GetDevicesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetDevicesResponse res = sdk.server().getDevices() @@ -508,7 +508,7 @@ actions: public static void main(String[] args) throws GetUserFriendsBadRequest, GetUserFriendsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetUserFriendsResponse res = sdk.plex().getUserFriends() @@ -567,7 +567,7 @@ actions: public static void main(String[] args) throws GetHomeDataBadRequest, GetHomeDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetHomeDataResponse res = sdk.plex().getHomeData() @@ -597,7 +597,7 @@ actions: public static void main(String[] args) throws GetGlobalHubsBadRequest, GetGlobalHubsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() @@ -625,7 +625,7 @@ actions: public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder() @@ -663,12 +663,12 @@ actions: public static void main(String[] args) throws PerformSearchBadRequest, PerformSearchUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); PerformSearchResponse res = sdk.search().performSearch() .query("arnold") - .limit(5) + .limit(5d) .call(); // handle response @@ -693,12 +693,12 @@ actions: public static void main(String[] args) throws PerformVoiceSearchBadRequest, PerformVoiceSearchUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() .query("dead+poop") - .limit(5) + .limit(5d) .call(); // handle response @@ -723,7 +723,7 @@ actions: public static void main(String[] args) throws GetLibraryHubsBadRequest, GetLibraryHubsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() @@ -782,7 +782,7 @@ actions: public static void main(String[] args) throws GetTopWatchedContentBadRequest, GetTopWatchedContentUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() @@ -814,11 +814,11 @@ actions: public static void main(String[] args) throws GetFileHashBadRequest, GetFileHashUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetFileHashResponse res = sdk.library().getFileHash() - .url("file://C:\Image.png&type=13") + .url("file://C:\\Image.png&type=13") .call(); // handle response @@ -844,7 +844,7 @@ actions: public static void main(String[] args) throws GetMediaMetaDataBadRequest, GetMediaMetaDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMediaMetaDataRequest req = GetMediaMetaDataRequest.builder() @@ -890,7 +890,7 @@ actions: public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMediaArtsResponse res = sdk.library().getMediaArts() @@ -919,7 +919,7 @@ actions: public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); PostMediaArtsResponse res = sdk.library().postMediaArts() @@ -927,7 +927,6 @@ actions: .url("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b") .call(); - // handle response } } - target: $["paths"]["/library/metadata/{ratingKey}/banner"]["get"] @@ -950,7 +949,7 @@ actions: public static void main(String[] args) throws GetBannerImageBadRequest, GetBannerImageUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetBannerImageRequest req = GetBannerImageRequest.builder() @@ -990,7 +989,7 @@ actions: public static void main(String[] args) throws GetMetadataChildrenBadRequest, GetMetadataChildrenUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() @@ -1020,7 +1019,7 @@ actions: public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMediaPostersResponse res = sdk.library().getMediaPosters() @@ -1049,7 +1048,7 @@ actions: public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); PostMediaPosterResponse res = sdk.library().postMediaPoster() @@ -1057,7 +1056,6 @@ actions: .url("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b") .call(); - // handle response } } - target: $["paths"]["/library/metadata/{ratingKey}/thumb"]["get"] @@ -1080,7 +1078,7 @@ actions: public static void main(String[] args) throws GetThumbImageBadRequest, GetThumbImageUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetThumbImageRequest req = GetThumbImageRequest.builder() @@ -1121,7 +1119,7 @@ actions: public static void main(String[] args) throws GetRecentlyAddedLibraryBadRequest, GetRecentlyAddedLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder() @@ -1173,7 +1171,7 @@ actions: public static void main(String[] args) throws GetSearchAllLibrariesBadRequest, GetSearchAllLibrariesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder() @@ -1213,7 +1211,7 @@ actions: public static void main(String[] args) throws GetAllLibrariesBadRequest, GetAllLibrariesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetAllLibrariesResponse res = sdk.library().getAllLibraries() @@ -1243,7 +1241,7 @@ actions: public static void main(String[] args) throws GetWatchListBadRequest, GetWatchListUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetWatchListRequest req = GetWatchListRequest.builder() @@ -1279,7 +1277,7 @@ actions: public static void main(String[] args) throws DeleteLibraryBadRequest, DeleteLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); DeleteLibraryResponse res = sdk.library().deleteLibrary() @@ -1309,7 +1307,7 @@ actions: public static void main(String[] args) throws GetLibraryDetailsBadRequest, GetLibraryDetailsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() @@ -1342,7 +1340,7 @@ actions: public static void main(String[] args) throws GetActorsLibraryBadRequest, GetActorsLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetActorsLibraryResponse res = sdk.library().getActorsLibrary() @@ -1374,7 +1372,7 @@ actions: public static void main(String[] args) throws GetLibrarySectionsAllBadRequest, GetLibrarySectionsAllUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetLibrarySectionsAllRequest req = GetLibrarySectionsAllRequest.builder() @@ -1416,7 +1414,7 @@ actions: public static void main(String[] args) throws GetCountriesLibraryBadRequest, GetCountriesLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetCountriesLibraryResponse res = sdk.library().getCountriesLibrary() @@ -1449,7 +1447,7 @@ actions: public static void main(String[] args) throws GetGenresLibraryBadRequest, GetGenresLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetGenresLibraryResponse res = sdk.library().getGenresLibrary() @@ -1482,7 +1480,7 @@ actions: public static void main(String[] args) throws GetRefreshLibraryMetadataBadRequest, GetRefreshLibraryMetadataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() @@ -1513,7 +1511,7 @@ actions: public static void main(String[] args) throws GetSearchLibraryBadRequest, GetSearchLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSearchLibraryResponse res = sdk.library().getSearchLibrary() @@ -1545,7 +1543,7 @@ actions: public static void main(String[] args) throws GetLibraryItemsBadRequest, GetLibraryItemsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() @@ -1585,7 +1583,7 @@ actions: public static void main(String[] args) throws LogLineBadRequest, LogLineUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); LogLineResponse res = sdk.log().logLine() @@ -1617,7 +1615,7 @@ actions: public static void main(String[] args) throws LogMultiLineBadRequest, LogMultiLineUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman"; @@ -1648,7 +1646,7 @@ actions: public static void main(String[] args) throws EnablePaperTrailBadRequest, EnablePaperTrailUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); EnablePaperTrailResponse res = sdk.log().enablePaperTrail() @@ -1676,7 +1674,7 @@ actions: public static void main(String[] args) throws GetMediaProvidersBadRequest, GetMediaProvidersUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMediaProvidersResponse res = sdk.server().getMediaProviders() @@ -1707,7 +1705,7 @@ actions: public static void main(String[] args) throws GetMyPlexAccountBadRequest, GetMyPlexAccountUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() @@ -1737,14 +1735,14 @@ actions: public static void main(String[] args) throws GetResizedPhotoBadRequest, GetResizedPhotoUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() - .width(110) - .height(165) + .width(110d) + .height(165d) .opacity(100L) - .blur(0) + .blur(0d) .minSize(MinSize.ZERO) .upscale(Upscale.ZERO) .url("/library/metadata/49564/thumb/1654258204") @@ -1854,7 +1852,7 @@ actions: public static void main(String[] args) throws GetPlaylistsBadRequest, GetPlaylistsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetPlaylistsResponse res = sdk.playlists().getPlaylists() @@ -1884,7 +1882,7 @@ actions: public static void main(String[] args) throws CreatePlaylistBadRequest, CreatePlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); CreatePlaylistRequest req = CreatePlaylistRequest.builder() @@ -1923,7 +1921,7 @@ actions: public static void main(String[] args) throws UploadPlaylistBadRequest, UploadPlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() @@ -1954,7 +1952,7 @@ actions: public static void main(String[] args) throws DeletePlaylistBadRequest, DeletePlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); DeletePlaylistResponse res = sdk.playlists().deletePlaylist() @@ -1983,7 +1981,7 @@ actions: public static void main(String[] args) throws GetPlaylistBadRequest, GetPlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetPlaylistResponse res = sdk.playlists().getPlaylist() @@ -2014,7 +2012,7 @@ actions: public static void main(String[] args) throws UpdatePlaylistBadRequest, UpdatePlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() @@ -2043,7 +2041,7 @@ actions: public static void main(String[] args) throws ClearPlaylistContentsBadRequest, ClearPlaylistContentsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() @@ -2073,7 +2071,7 @@ actions: public static void main(String[] args) throws GetPlaylistContentsBadRequest, GetPlaylistContentsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() @@ -2105,13 +2103,13 @@ actions: public static void main(String[] args) throws AddPlaylistContentsBadRequest, AddPlaylistContentsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() .playlistID(7013.44) .uri("server://12345/com.plexapp.plugins.library/library/metadata/1") - .playQueueID(123) + .playQueueID(123d) .call(); if (res.object().isPresent()) { @@ -2138,7 +2136,7 @@ actions: public static void main(String[] args) throws GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerResourcesResponse res = sdk.plex().getServerResources() @@ -2172,7 +2170,7 @@ actions: public static void main(String[] args) throws GetSearchResultsBadRequest, GetSearchResultsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSearchResultsResponse res = sdk.search().getSearchResults() @@ -2203,7 +2201,7 @@ actions: public static void main(String[] args) throws GetSourceConnectionInformationBadRequest, GetSourceConnectionInformationUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() @@ -2232,7 +2230,7 @@ actions: public static void main(String[] args) throws GetTransientTokenBadRequest, GetTransientTokenUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTransientTokenResponse res = sdk.authentication().getTransientToken() @@ -2262,7 +2260,7 @@ actions: public static void main(String[] args) throws GetServerListBadRequest, GetServerListUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerListResponse res = sdk.server().getServerList() @@ -2292,7 +2290,7 @@ actions: public static void main(String[] args) throws GetBandwidthStatisticsBadRequest, GetBandwidthStatisticsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() @@ -2323,7 +2321,7 @@ actions: public static void main(String[] args) throws GetStatisticsBadRequest, GetStatisticsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetStatisticsResponse res = sdk.statistics().getStatistics() @@ -2354,7 +2352,7 @@ actions: public static void main(String[] args) throws GetResourcesStatisticsBadRequest, GetResourcesStatisticsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() @@ -2385,7 +2383,7 @@ actions: public static void main(String[] args) throws GetSessionsBadRequest, GetSessionsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSessionsResponse res = sdk.sessions().getSessions() @@ -2416,7 +2414,7 @@ actions: public static void main(String[] args) throws GetSessionHistoryBadRequest, GetSessionHistoryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() @@ -2451,7 +2449,7 @@ actions: public static void main(String[] args) throws GetTranscodeSessionsBadRequest, GetTranscodeSessionsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() @@ -2481,7 +2479,7 @@ actions: public static void main(String[] args) throws StopTranscodeSessionBadRequest, StopTranscodeSessionUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() @@ -2510,7 +2508,7 @@ actions: public static void main(String[] args) throws ApplyUpdatesBadRequest, ApplyUpdatesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); ApplyUpdatesResponse res = sdk.updater().applyUpdates() @@ -2541,7 +2539,7 @@ actions: public static void main(String[] args) throws CheckForUpdatesBadRequest, CheckForUpdatesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); CheckForUpdatesResponse res = sdk.updater().checkForUpdates() @@ -2570,7 +2568,7 @@ actions: public static void main(String[] args) throws GetUpdateStatusBadRequest, GetUpdateStatusUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() @@ -2600,7 +2598,7 @@ actions: public static void main(String[] args) throws GetTokenDetailsBadRequest, GetTokenDetailsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() @@ -2721,26 +2719,26 @@ actions: public static void main(String[] args) throws StartUniversalTranscodeBadRequest, StartUniversalTranscodeUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() - .hasMDE(1) + .hasMDE(1d) .path("/library/metadata/23409") - .mediaIndex(0) - .partIndex(0) + .mediaIndex(0d) + .partIndex(0d) .protocol("hls") - .fastSeek(0) - .directPlay(0) - .directStream(0) - .subtitleSize(100) + .fastSeek(0d) + .directPlay(0d) + .directStream(0d) + .subtitleSize(100d) .subtites("burn") - .audioBoost(100) + .audioBoost(100d) .location("lan") - .mediaBufferSize(102400) + .mediaBufferSize(102400d) .session("zvcage8b7rkioqcm8f4uns4c") - .addDebugOverlay(0) - .autoAdjustQuality(0) + .addDebugOverlay(0d) + .autoAdjustQuality(0d) .build(); StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() diff --git a/docs/models/errors/AddPlaylistContentsBadRequest.md b/docs/models/errors/AddPlaylistContentsBadRequest.md index a8d90a39..684ee9ee 100644 --- a/docs/models/errors/AddPlaylistContentsBadRequest.md +++ b/docs/models/errors/AddPlaylistContentsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[AddPlaylistContentsErrors](../../models/errors/AddPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[AddPlaylistContentsErrors](../../models/errors/AddPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/AddPlaylistContentsUnauthorized.md b/docs/models/errors/AddPlaylistContentsUnauthorized.md index e9abb4ec..7ba3628e 100644 --- a/docs/models/errors/AddPlaylistContentsUnauthorized.md +++ b/docs/models/errors/AddPlaylistContentsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[AddPlaylistContentsPlaylistsErrors](../../models/errors/AddPlaylistContentsPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[AddPlaylistContentsPlaylistsErrors](../../models/errors/AddPlaylistContentsPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/ApplyUpdatesBadRequest.md b/docs/models/errors/ApplyUpdatesBadRequest.md index ea26b8aa..e61ef3f6 100644 --- a/docs/models/errors/ApplyUpdatesBadRequest.md +++ b/docs/models/errors/ApplyUpdatesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[ApplyUpdatesErrors](../../models/errors/ApplyUpdatesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[ApplyUpdatesErrors](../../models/errors/ApplyUpdatesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/ApplyUpdatesUnauthorized.md b/docs/models/errors/ApplyUpdatesUnauthorized.md index e07767f0..3bb1fffb 100644 --- a/docs/models/errors/ApplyUpdatesUnauthorized.md +++ b/docs/models/errors/ApplyUpdatesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[ApplyUpdatesUpdaterErrors](../../models/errors/ApplyUpdatesUpdaterErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[ApplyUpdatesUpdaterErrors](../../models/errors/ApplyUpdatesUpdaterErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/CancelServerActivitiesBadRequest.md b/docs/models/errors/CancelServerActivitiesBadRequest.md index 3bf1a89b..740db374 100644 --- a/docs/models/errors/CancelServerActivitiesBadRequest.md +++ b/docs/models/errors/CancelServerActivitiesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[CancelServerActivitiesErrors](../../models/errors/CancelServerActivitiesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[CancelServerActivitiesErrors](../../models/errors/CancelServerActivitiesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/CancelServerActivitiesUnauthorized.md b/docs/models/errors/CancelServerActivitiesUnauthorized.md index 31e48237..ba71e3db 100644 --- a/docs/models/errors/CancelServerActivitiesUnauthorized.md +++ b/docs/models/errors/CancelServerActivitiesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[CancelServerActivitiesActivitiesErrors](../../models/errors/CancelServerActivitiesActivitiesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[CancelServerActivitiesActivitiesErrors](../../models/errors/CancelServerActivitiesActivitiesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/CheckForUpdatesBadRequest.md b/docs/models/errors/CheckForUpdatesBadRequest.md index 5a82e251..d187ddeb 100644 --- a/docs/models/errors/CheckForUpdatesBadRequest.md +++ b/docs/models/errors/CheckForUpdatesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[CheckForUpdatesErrors](../../models/errors/CheckForUpdatesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[CheckForUpdatesErrors](../../models/errors/CheckForUpdatesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/CheckForUpdatesUnauthorized.md b/docs/models/errors/CheckForUpdatesUnauthorized.md index 74501eee..682c345f 100644 --- a/docs/models/errors/CheckForUpdatesUnauthorized.md +++ b/docs/models/errors/CheckForUpdatesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[CheckForUpdatesUpdaterErrors](../../models/errors/CheckForUpdatesUpdaterErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[CheckForUpdatesUpdaterErrors](../../models/errors/CheckForUpdatesUpdaterErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/ClearPlaylistContentsBadRequest.md b/docs/models/errors/ClearPlaylistContentsBadRequest.md index bce1e2d8..429958e6 100644 --- a/docs/models/errors/ClearPlaylistContentsBadRequest.md +++ b/docs/models/errors/ClearPlaylistContentsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[ClearPlaylistContentsErrors](../../models/errors/ClearPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[ClearPlaylistContentsErrors](../../models/errors/ClearPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/ClearPlaylistContentsUnauthorized.md b/docs/models/errors/ClearPlaylistContentsUnauthorized.md index b09e228a..f64f06d7 100644 --- a/docs/models/errors/ClearPlaylistContentsUnauthorized.md +++ b/docs/models/errors/ClearPlaylistContentsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[ClearPlaylistContentsPlaylistsErrors](../../models/errors/ClearPlaylistContentsPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[ClearPlaylistContentsPlaylistsErrors](../../models/errors/ClearPlaylistContentsPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/CreatePlaylistBadRequest.md b/docs/models/errors/CreatePlaylistBadRequest.md index f4aeaa0d..de015bec 100644 --- a/docs/models/errors/CreatePlaylistBadRequest.md +++ b/docs/models/errors/CreatePlaylistBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[CreatePlaylistErrors](../../models/errors/CreatePlaylistErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[CreatePlaylistErrors](../../models/errors/CreatePlaylistErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/CreatePlaylistUnauthorized.md b/docs/models/errors/CreatePlaylistUnauthorized.md index c5e1329d..c6979e93 100644 --- a/docs/models/errors/CreatePlaylistUnauthorized.md +++ b/docs/models/errors/CreatePlaylistUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[CreatePlaylistPlaylistsErrors](../../models/errors/CreatePlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[CreatePlaylistPlaylistsErrors](../../models/errors/CreatePlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/DeleteLibraryBadRequest.md b/docs/models/errors/DeleteLibraryBadRequest.md index 82e1782f..eb3e9195 100644 --- a/docs/models/errors/DeleteLibraryBadRequest.md +++ b/docs/models/errors/DeleteLibraryBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[DeleteLibraryErrors](../../models/errors/DeleteLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[DeleteLibraryErrors](../../models/errors/DeleteLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/DeleteLibraryUnauthorized.md b/docs/models/errors/DeleteLibraryUnauthorized.md index 331a4d2e..623b1c5b 100644 --- a/docs/models/errors/DeleteLibraryUnauthorized.md +++ b/docs/models/errors/DeleteLibraryUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[DeleteLibraryLibraryErrors](../../models/errors/DeleteLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[DeleteLibraryLibraryErrors](../../models/errors/DeleteLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/DeletePlaylistBadRequest.md b/docs/models/errors/DeletePlaylistBadRequest.md index f7b43179..97635f71 100644 --- a/docs/models/errors/DeletePlaylistBadRequest.md +++ b/docs/models/errors/DeletePlaylistBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[DeletePlaylistErrors](../../models/errors/DeletePlaylistErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[DeletePlaylistErrors](../../models/errors/DeletePlaylistErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/DeletePlaylistUnauthorized.md b/docs/models/errors/DeletePlaylistUnauthorized.md index dae687a2..e4caa586 100644 --- a/docs/models/errors/DeletePlaylistUnauthorized.md +++ b/docs/models/errors/DeletePlaylistUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[DeletePlaylistPlaylistsErrors](../../models/errors/DeletePlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[DeletePlaylistPlaylistsErrors](../../models/errors/DeletePlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/EnablePaperTrailBadRequest.md b/docs/models/errors/EnablePaperTrailBadRequest.md index f1a362a3..b61bc472 100644 --- a/docs/models/errors/EnablePaperTrailBadRequest.md +++ b/docs/models/errors/EnablePaperTrailBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[EnablePaperTrailErrors](../../models/errors/EnablePaperTrailErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[EnablePaperTrailErrors](../../models/errors/EnablePaperTrailErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/EnablePaperTrailUnauthorized.md b/docs/models/errors/EnablePaperTrailUnauthorized.md index 0968ede5..3bd2d9f4 100644 --- a/docs/models/errors/EnablePaperTrailUnauthorized.md +++ b/docs/models/errors/EnablePaperTrailUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[EnablePaperTrailLogErrors](../../models/errors/EnablePaperTrailLogErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[EnablePaperTrailLogErrors](../../models/errors/EnablePaperTrailLogErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetActorsLibraryBadRequest.md b/docs/models/errors/GetActorsLibraryBadRequest.md index 6980a6ed..637a541e 100644 --- a/docs/models/errors/GetActorsLibraryBadRequest.md +++ b/docs/models/errors/GetActorsLibraryBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetActorsLibraryErrors](../../models/errors/GetActorsLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetActorsLibraryErrors](../../models/errors/GetActorsLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetActorsLibraryUnauthorized.md b/docs/models/errors/GetActorsLibraryUnauthorized.md index b366f810..99a5336e 100644 --- a/docs/models/errors/GetActorsLibraryUnauthorized.md +++ b/docs/models/errors/GetActorsLibraryUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetActorsLibraryLibraryErrors](../../models/errors/GetActorsLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetActorsLibraryLibraryErrors](../../models/errors/GetActorsLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetAllLibrariesBadRequest.md b/docs/models/errors/GetAllLibrariesBadRequest.md index 2a9284db..51e29ca4 100644 --- a/docs/models/errors/GetAllLibrariesBadRequest.md +++ b/docs/models/errors/GetAllLibrariesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetAllLibrariesErrors](../../models/errors/GetAllLibrariesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetAllLibrariesErrors](../../models/errors/GetAllLibrariesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetAllLibrariesUnauthorized.md b/docs/models/errors/GetAllLibrariesUnauthorized.md index 258f5d01..976463d7 100644 --- a/docs/models/errors/GetAllLibrariesUnauthorized.md +++ b/docs/models/errors/GetAllLibrariesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetAllLibrariesLibraryErrors](../../models/errors/GetAllLibrariesLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetAllLibrariesLibraryErrors](../../models/errors/GetAllLibrariesLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetAvailableClientsBadRequest.md b/docs/models/errors/GetAvailableClientsBadRequest.md index 60bc53d5..0d92c76d 100644 --- a/docs/models/errors/GetAvailableClientsBadRequest.md +++ b/docs/models/errors/GetAvailableClientsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetAvailableClientsErrors](../../models/errors/GetAvailableClientsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetAvailableClientsErrors](../../models/errors/GetAvailableClientsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetAvailableClientsUnauthorized.md b/docs/models/errors/GetAvailableClientsUnauthorized.md index 80bac453..9e3f36b2 100644 --- a/docs/models/errors/GetAvailableClientsUnauthorized.md +++ b/docs/models/errors/GetAvailableClientsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetAvailableClientsServerErrors](../../models/errors/GetAvailableClientsServerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetAvailableClientsServerErrors](../../models/errors/GetAvailableClientsServerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetBandwidthStatisticsBadRequest.md b/docs/models/errors/GetBandwidthStatisticsBadRequest.md index b560b73f..bdbf58fc 100644 --- a/docs/models/errors/GetBandwidthStatisticsBadRequest.md +++ b/docs/models/errors/GetBandwidthStatisticsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetBandwidthStatisticsErrors](../../models/errors/GetBandwidthStatisticsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetBandwidthStatisticsErrors](../../models/errors/GetBandwidthStatisticsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetBandwidthStatisticsUnauthorized.md b/docs/models/errors/GetBandwidthStatisticsUnauthorized.md index 67770830..65767fb1 100644 --- a/docs/models/errors/GetBandwidthStatisticsUnauthorized.md +++ b/docs/models/errors/GetBandwidthStatisticsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetBandwidthStatisticsStatisticsErrors](../../models/errors/GetBandwidthStatisticsStatisticsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetBandwidthStatisticsStatisticsErrors](../../models/errors/GetBandwidthStatisticsStatisticsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetBannerImageBadRequest.md b/docs/models/errors/GetBannerImageBadRequest.md index 1791b335..dcd2672e 100644 --- a/docs/models/errors/GetBannerImageBadRequest.md +++ b/docs/models/errors/GetBannerImageBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetBannerImageErrors](../../models/errors/GetBannerImageErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetBannerImageErrors](../../models/errors/GetBannerImageErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetBannerImageUnauthorized.md b/docs/models/errors/GetBannerImageUnauthorized.md index 36256b11..dcc13586 100644 --- a/docs/models/errors/GetBannerImageUnauthorized.md +++ b/docs/models/errors/GetBannerImageUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetBannerImageMediaErrors](../../models/errors/GetBannerImageMediaErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetBannerImageMediaErrors](../../models/errors/GetBannerImageMediaErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetButlerTasksBadRequest.md b/docs/models/errors/GetButlerTasksBadRequest.md index 8e4be1a2..949555a5 100644 --- a/docs/models/errors/GetButlerTasksBadRequest.md +++ b/docs/models/errors/GetButlerTasksBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetButlerTasksErrors](../../models/errors/GetButlerTasksErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetButlerTasksErrors](../../models/errors/GetButlerTasksErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetButlerTasksUnauthorized.md b/docs/models/errors/GetButlerTasksUnauthorized.md index b937071c..043a772a 100644 --- a/docs/models/errors/GetButlerTasksUnauthorized.md +++ b/docs/models/errors/GetButlerTasksUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetButlerTasksButlerErrors](../../models/errors/GetButlerTasksButlerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetButlerTasksButlerErrors](../../models/errors/GetButlerTasksButlerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetCompanionsDataBadRequest.md b/docs/models/errors/GetCompanionsDataBadRequest.md index f84a93f7..31c65648 100644 --- a/docs/models/errors/GetCompanionsDataBadRequest.md +++ b/docs/models/errors/GetCompanionsDataBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetCompanionsDataErrors](../../models/errors/GetCompanionsDataErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetCompanionsDataErrors](../../models/errors/GetCompanionsDataErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetCompanionsDataUnauthorized.md b/docs/models/errors/GetCompanionsDataUnauthorized.md index cca2ee2b..3911dfee 100644 --- a/docs/models/errors/GetCompanionsDataUnauthorized.md +++ b/docs/models/errors/GetCompanionsDataUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetCompanionsDataPlexErrors](../../models/errors/GetCompanionsDataPlexErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetCompanionsDataPlexErrors](../../models/errors/GetCompanionsDataPlexErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetCountriesLibraryBadRequest.md b/docs/models/errors/GetCountriesLibraryBadRequest.md index d6b4576b..99066fa6 100644 --- a/docs/models/errors/GetCountriesLibraryBadRequest.md +++ b/docs/models/errors/GetCountriesLibraryBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetCountriesLibraryErrors](../../models/errors/GetCountriesLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetCountriesLibraryErrors](../../models/errors/GetCountriesLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetCountriesLibraryUnauthorized.md b/docs/models/errors/GetCountriesLibraryUnauthorized.md index a73a8247..fa45f531 100644 --- a/docs/models/errors/GetCountriesLibraryUnauthorized.md +++ b/docs/models/errors/GetCountriesLibraryUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetCountriesLibraryLibraryErrors](../../models/errors/GetCountriesLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetCountriesLibraryLibraryErrors](../../models/errors/GetCountriesLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetDevicesBadRequest.md b/docs/models/errors/GetDevicesBadRequest.md index fb17853e..d2cda149 100644 --- a/docs/models/errors/GetDevicesBadRequest.md +++ b/docs/models/errors/GetDevicesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetDevicesErrors](../../models/errors/GetDevicesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetDevicesErrors](../../models/errors/GetDevicesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetDevicesUnauthorized.md b/docs/models/errors/GetDevicesUnauthorized.md index ce0bd8f1..996c070c 100644 --- a/docs/models/errors/GetDevicesUnauthorized.md +++ b/docs/models/errors/GetDevicesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetDevicesServerErrors](../../models/errors/GetDevicesServerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetDevicesServerErrors](../../models/errors/GetDevicesServerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetFileHashBadRequest.md b/docs/models/errors/GetFileHashBadRequest.md index 11ba0d6b..ee7becb6 100644 --- a/docs/models/errors/GetFileHashBadRequest.md +++ b/docs/models/errors/GetFileHashBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetFileHashErrors](../../models/errors/GetFileHashErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetFileHashErrors](../../models/errors/GetFileHashErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetFileHashUnauthorized.md b/docs/models/errors/GetFileHashUnauthorized.md index 6a55639c..6b5be876 100644 --- a/docs/models/errors/GetFileHashUnauthorized.md +++ b/docs/models/errors/GetFileHashUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetFileHashLibraryErrors](../../models/errors/GetFileHashLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetFileHashLibraryErrors](../../models/errors/GetFileHashLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetGenresLibraryBadRequest.md b/docs/models/errors/GetGenresLibraryBadRequest.md index 611c08a2..cd173fbf 100644 --- a/docs/models/errors/GetGenresLibraryBadRequest.md +++ b/docs/models/errors/GetGenresLibraryBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetGenresLibraryErrors](../../models/errors/GetGenresLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetGenresLibraryErrors](../../models/errors/GetGenresLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetGenresLibraryUnauthorized.md b/docs/models/errors/GetGenresLibraryUnauthorized.md index 944083ba..e126b79c 100644 --- a/docs/models/errors/GetGenresLibraryUnauthorized.md +++ b/docs/models/errors/GetGenresLibraryUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetGenresLibraryLibraryErrors](../../models/errors/GetGenresLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetGenresLibraryLibraryErrors](../../models/errors/GetGenresLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetGeoDataBadRequest.md b/docs/models/errors/GetGeoDataBadRequest.md index 9d97b08f..24f2c0b7 100644 --- a/docs/models/errors/GetGeoDataBadRequest.md +++ b/docs/models/errors/GetGeoDataBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetGeoDataErrors](../../models/errors/GetGeoDataErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetGeoDataErrors](../../models/errors/GetGeoDataErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetGeoDataUnauthorized.md b/docs/models/errors/GetGeoDataUnauthorized.md index cbbc3523..b75b33ce 100644 --- a/docs/models/errors/GetGeoDataUnauthorized.md +++ b/docs/models/errors/GetGeoDataUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetGeoDataPlexErrors](../../models/errors/GetGeoDataPlexErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetGeoDataPlexErrors](../../models/errors/GetGeoDataPlexErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetGlobalHubsBadRequest.md b/docs/models/errors/GetGlobalHubsBadRequest.md index c5a246f7..3bff1e04 100644 --- a/docs/models/errors/GetGlobalHubsBadRequest.md +++ b/docs/models/errors/GetGlobalHubsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetGlobalHubsErrors](../../models/errors/GetGlobalHubsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetGlobalHubsErrors](../../models/errors/GetGlobalHubsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetGlobalHubsUnauthorized.md b/docs/models/errors/GetGlobalHubsUnauthorized.md index d4cb4907..0bd7f803 100644 --- a/docs/models/errors/GetGlobalHubsUnauthorized.md +++ b/docs/models/errors/GetGlobalHubsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetGlobalHubsHubsErrors](../../models/errors/GetGlobalHubsHubsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetGlobalHubsHubsErrors](../../models/errors/GetGlobalHubsHubsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetHomeDataBadRequest.md b/docs/models/errors/GetHomeDataBadRequest.md index 7aff816c..7b5d117d 100644 --- a/docs/models/errors/GetHomeDataBadRequest.md +++ b/docs/models/errors/GetHomeDataBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetHomeDataErrors](../../models/errors/GetHomeDataErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetHomeDataErrors](../../models/errors/GetHomeDataErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetHomeDataUnauthorized.md b/docs/models/errors/GetHomeDataUnauthorized.md index 11a38628..71f10448 100644 --- a/docs/models/errors/GetHomeDataUnauthorized.md +++ b/docs/models/errors/GetHomeDataUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetHomeDataPlexErrors](../../models/errors/GetHomeDataPlexErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetHomeDataPlexErrors](../../models/errors/GetHomeDataPlexErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetLibraryDetailsBadRequest.md b/docs/models/errors/GetLibraryDetailsBadRequest.md index 5ca8302f..ef392e35 100644 --- a/docs/models/errors/GetLibraryDetailsBadRequest.md +++ b/docs/models/errors/GetLibraryDetailsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetLibraryDetailsErrors](../../models/errors/GetLibraryDetailsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetLibraryDetailsErrors](../../models/errors/GetLibraryDetailsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetLibraryDetailsUnauthorized.md b/docs/models/errors/GetLibraryDetailsUnauthorized.md index dcda372d..44249ff7 100644 --- a/docs/models/errors/GetLibraryDetailsUnauthorized.md +++ b/docs/models/errors/GetLibraryDetailsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetLibraryDetailsLibraryErrors](../../models/errors/GetLibraryDetailsLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetLibraryDetailsLibraryErrors](../../models/errors/GetLibraryDetailsLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetLibraryHubsBadRequest.md b/docs/models/errors/GetLibraryHubsBadRequest.md index 4fc1f8fc..17a70f2a 100644 --- a/docs/models/errors/GetLibraryHubsBadRequest.md +++ b/docs/models/errors/GetLibraryHubsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetLibraryHubsErrors](../../models/errors/GetLibraryHubsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetLibraryHubsErrors](../../models/errors/GetLibraryHubsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetLibraryHubsUnauthorized.md b/docs/models/errors/GetLibraryHubsUnauthorized.md index 1284fbae..611050c8 100644 --- a/docs/models/errors/GetLibraryHubsUnauthorized.md +++ b/docs/models/errors/GetLibraryHubsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetLibraryHubsHubsErrors](../../models/errors/GetLibraryHubsHubsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetLibraryHubsHubsErrors](../../models/errors/GetLibraryHubsHubsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetLibraryItemsBadRequest.md b/docs/models/errors/GetLibraryItemsBadRequest.md index d7b21b1c..3018a61d 100644 --- a/docs/models/errors/GetLibraryItemsBadRequest.md +++ b/docs/models/errors/GetLibraryItemsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetLibraryItemsErrors](../../models/errors/GetLibraryItemsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetLibraryItemsErrors](../../models/errors/GetLibraryItemsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetLibraryItemsUnauthorized.md b/docs/models/errors/GetLibraryItemsUnauthorized.md index b1910259..35d8ed1b 100644 --- a/docs/models/errors/GetLibraryItemsUnauthorized.md +++ b/docs/models/errors/GetLibraryItemsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetLibraryItemsLibraryErrors](../../models/errors/GetLibraryItemsLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetLibraryItemsLibraryErrors](../../models/errors/GetLibraryItemsLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetLibrarySectionsAllBadRequest.md b/docs/models/errors/GetLibrarySectionsAllBadRequest.md index b5315bb1..2ff2f522 100644 --- a/docs/models/errors/GetLibrarySectionsAllBadRequest.md +++ b/docs/models/errors/GetLibrarySectionsAllBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetLibrarySectionsAllErrors](../../models/errors/GetLibrarySectionsAllErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetLibrarySectionsAllErrors](../../models/errors/GetLibrarySectionsAllErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetLibrarySectionsAllUnauthorized.md b/docs/models/errors/GetLibrarySectionsAllUnauthorized.md index c2438998..abb2353f 100644 --- a/docs/models/errors/GetLibrarySectionsAllUnauthorized.md +++ b/docs/models/errors/GetLibrarySectionsAllUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetLibrarySectionsAllLibraryErrors](../../models/errors/GetLibrarySectionsAllLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetLibrarySectionsAllLibraryErrors](../../models/errors/GetLibrarySectionsAllLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetMediaMetaDataBadRequest.md b/docs/models/errors/GetMediaMetaDataBadRequest.md index d911b75a..8880470d 100644 --- a/docs/models/errors/GetMediaMetaDataBadRequest.md +++ b/docs/models/errors/GetMediaMetaDataBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetMediaMetaDataErrors](../../models/errors/GetMediaMetaDataErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetMediaMetaDataErrors](../../models/errors/GetMediaMetaDataErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetMediaMetaDataUnauthorized.md b/docs/models/errors/GetMediaMetaDataUnauthorized.md index 9565317e..bd7ff981 100644 --- a/docs/models/errors/GetMediaMetaDataUnauthorized.md +++ b/docs/models/errors/GetMediaMetaDataUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetMediaMetaDataLibraryErrors](../../models/errors/GetMediaMetaDataLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetMediaMetaDataLibraryErrors](../../models/errors/GetMediaMetaDataLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetMediaProvidersBadRequest.md b/docs/models/errors/GetMediaProvidersBadRequest.md index ba641284..9d37cbfc 100644 --- a/docs/models/errors/GetMediaProvidersBadRequest.md +++ b/docs/models/errors/GetMediaProvidersBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetMediaProvidersErrors](../../models/errors/GetMediaProvidersErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetMediaProvidersErrors](../../models/errors/GetMediaProvidersErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetMediaProvidersUnauthorized.md b/docs/models/errors/GetMediaProvidersUnauthorized.md index 4419a5e2..7966e91c 100644 --- a/docs/models/errors/GetMediaProvidersUnauthorized.md +++ b/docs/models/errors/GetMediaProvidersUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetMediaProvidersServerErrors](../../models/errors/GetMediaProvidersServerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetMediaProvidersServerErrors](../../models/errors/GetMediaProvidersServerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetMetadataChildrenBadRequest.md b/docs/models/errors/GetMetadataChildrenBadRequest.md index 7f895497..b7a3a188 100644 --- a/docs/models/errors/GetMetadataChildrenBadRequest.md +++ b/docs/models/errors/GetMetadataChildrenBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetMetadataChildrenErrors](../../models/errors/GetMetadataChildrenErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetMetadataChildrenErrors](../../models/errors/GetMetadataChildrenErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetMetadataChildrenUnauthorized.md b/docs/models/errors/GetMetadataChildrenUnauthorized.md index d229cc38..b85e97cb 100644 --- a/docs/models/errors/GetMetadataChildrenUnauthorized.md +++ b/docs/models/errors/GetMetadataChildrenUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetMetadataChildrenLibraryErrors](../../models/errors/GetMetadataChildrenLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetMetadataChildrenLibraryErrors](../../models/errors/GetMetadataChildrenLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetMyPlexAccountBadRequest.md b/docs/models/errors/GetMyPlexAccountBadRequest.md index f0289297..37d97972 100644 --- a/docs/models/errors/GetMyPlexAccountBadRequest.md +++ b/docs/models/errors/GetMyPlexAccountBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetMyPlexAccountErrors](../../models/errors/GetMyPlexAccountErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetMyPlexAccountErrors](../../models/errors/GetMyPlexAccountErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetMyPlexAccountUnauthorized.md b/docs/models/errors/GetMyPlexAccountUnauthorized.md index e37095d0..995f1f32 100644 --- a/docs/models/errors/GetMyPlexAccountUnauthorized.md +++ b/docs/models/errors/GetMyPlexAccountUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetMyPlexAccountServerErrors](../../models/errors/GetMyPlexAccountServerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetMyPlexAccountServerErrors](../../models/errors/GetMyPlexAccountServerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetPinBadRequest.md b/docs/models/errors/GetPinBadRequest.md index 6c62db55..098f242d 100644 --- a/docs/models/errors/GetPinBadRequest.md +++ b/docs/models/errors/GetPinBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetPinErrors](../../models/errors/GetPinErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetPinErrors](../../models/errors/GetPinErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetPlaylistBadRequest.md b/docs/models/errors/GetPlaylistBadRequest.md index cb3a713e..de3bff2e 100644 --- a/docs/models/errors/GetPlaylistBadRequest.md +++ b/docs/models/errors/GetPlaylistBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetPlaylistErrors](../../models/errors/GetPlaylistErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetPlaylistErrors](../../models/errors/GetPlaylistErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetPlaylistContentsBadRequest.md b/docs/models/errors/GetPlaylistContentsBadRequest.md index 44a4a1f6..71d3e1dc 100644 --- a/docs/models/errors/GetPlaylistContentsBadRequest.md +++ b/docs/models/errors/GetPlaylistContentsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetPlaylistContentsErrors](../../models/errors/GetPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetPlaylistContentsErrors](../../models/errors/GetPlaylistContentsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetPlaylistContentsUnauthorized.md b/docs/models/errors/GetPlaylistContentsUnauthorized.md index c00a065c..74063100 100644 --- a/docs/models/errors/GetPlaylistContentsUnauthorized.md +++ b/docs/models/errors/GetPlaylistContentsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetPlaylistContentsPlaylistsErrors](../../models/errors/GetPlaylistContentsPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetPlaylistContentsPlaylistsErrors](../../models/errors/GetPlaylistContentsPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetPlaylistUnauthorized.md b/docs/models/errors/GetPlaylistUnauthorized.md index 10d51e50..7b3a6f5a 100644 --- a/docs/models/errors/GetPlaylistUnauthorized.md +++ b/docs/models/errors/GetPlaylistUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetPlaylistPlaylistsErrors](../../models/errors/GetPlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetPlaylistPlaylistsErrors](../../models/errors/GetPlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetPlaylistsBadRequest.md b/docs/models/errors/GetPlaylistsBadRequest.md index f6e5eb38..c79df6f4 100644 --- a/docs/models/errors/GetPlaylistsBadRequest.md +++ b/docs/models/errors/GetPlaylistsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetPlaylistsErrors](../../models/errors/GetPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetPlaylistsErrors](../../models/errors/GetPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetPlaylistsUnauthorized.md b/docs/models/errors/GetPlaylistsUnauthorized.md index d15b7cdb..e16c1087 100644 --- a/docs/models/errors/GetPlaylistsUnauthorized.md +++ b/docs/models/errors/GetPlaylistsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetPlaylistsPlaylistsErrors](../../models/errors/GetPlaylistsPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetPlaylistsPlaylistsErrors](../../models/errors/GetPlaylistsPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetRecentlyAddedLibraryBadRequest.md b/docs/models/errors/GetRecentlyAddedLibraryBadRequest.md index 558e30f2..5950525a 100644 --- a/docs/models/errors/GetRecentlyAddedLibraryBadRequest.md +++ b/docs/models/errors/GetRecentlyAddedLibraryBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetRecentlyAddedLibraryErrors](../../models/errors/GetRecentlyAddedLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetRecentlyAddedLibraryErrors](../../models/errors/GetRecentlyAddedLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetRecentlyAddedLibraryUnauthorized.md b/docs/models/errors/GetRecentlyAddedLibraryUnauthorized.md index dfcd115e..0079161d 100644 --- a/docs/models/errors/GetRecentlyAddedLibraryUnauthorized.md +++ b/docs/models/errors/GetRecentlyAddedLibraryUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetRecentlyAddedLibraryLibraryErrors](../../models/errors/GetRecentlyAddedLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetRecentlyAddedLibraryLibraryErrors](../../models/errors/GetRecentlyAddedLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetRefreshLibraryMetadataBadRequest.md b/docs/models/errors/GetRefreshLibraryMetadataBadRequest.md index 90711f04..bcb179c9 100644 --- a/docs/models/errors/GetRefreshLibraryMetadataBadRequest.md +++ b/docs/models/errors/GetRefreshLibraryMetadataBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetRefreshLibraryMetadataErrors](../../models/errors/GetRefreshLibraryMetadataErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetRefreshLibraryMetadataErrors](../../models/errors/GetRefreshLibraryMetadataErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetRefreshLibraryMetadataUnauthorized.md b/docs/models/errors/GetRefreshLibraryMetadataUnauthorized.md index bd1eacdc..2b030095 100644 --- a/docs/models/errors/GetRefreshLibraryMetadataUnauthorized.md +++ b/docs/models/errors/GetRefreshLibraryMetadataUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetRefreshLibraryMetadataLibraryErrors](../../models/errors/GetRefreshLibraryMetadataLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetRefreshLibraryMetadataLibraryErrors](../../models/errors/GetRefreshLibraryMetadataLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetResizedPhotoBadRequest.md b/docs/models/errors/GetResizedPhotoBadRequest.md index 89217273..6e13e5dd 100644 --- a/docs/models/errors/GetResizedPhotoBadRequest.md +++ b/docs/models/errors/GetResizedPhotoBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetResizedPhotoErrors](../../models/errors/GetResizedPhotoErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetResizedPhotoErrors](../../models/errors/GetResizedPhotoErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetResizedPhotoUnauthorized.md b/docs/models/errors/GetResizedPhotoUnauthorized.md index 3f3cb062..d824488b 100644 --- a/docs/models/errors/GetResizedPhotoUnauthorized.md +++ b/docs/models/errors/GetResizedPhotoUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetResizedPhotoServerErrors](../../models/errors/GetResizedPhotoServerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetResizedPhotoServerErrors](../../models/errors/GetResizedPhotoServerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetResourcesStatisticsBadRequest.md b/docs/models/errors/GetResourcesStatisticsBadRequest.md index 9729db82..a89571e2 100644 --- a/docs/models/errors/GetResourcesStatisticsBadRequest.md +++ b/docs/models/errors/GetResourcesStatisticsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetResourcesStatisticsErrors](../../models/errors/GetResourcesStatisticsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetResourcesStatisticsErrors](../../models/errors/GetResourcesStatisticsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetResourcesStatisticsUnauthorized.md b/docs/models/errors/GetResourcesStatisticsUnauthorized.md index 1a3d8474..f6befbef 100644 --- a/docs/models/errors/GetResourcesStatisticsUnauthorized.md +++ b/docs/models/errors/GetResourcesStatisticsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetResourcesStatisticsStatisticsErrors](../../models/errors/GetResourcesStatisticsStatisticsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetResourcesStatisticsStatisticsErrors](../../models/errors/GetResourcesStatisticsStatisticsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSearchAllLibrariesBadRequest.md b/docs/models/errors/GetSearchAllLibrariesBadRequest.md index 031cb99f..802a883c 100644 --- a/docs/models/errors/GetSearchAllLibrariesBadRequest.md +++ b/docs/models/errors/GetSearchAllLibrariesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSearchAllLibrariesErrors](../../models/errors/GetSearchAllLibrariesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSearchAllLibrariesErrors](../../models/errors/GetSearchAllLibrariesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSearchAllLibrariesUnauthorized.md b/docs/models/errors/GetSearchAllLibrariesUnauthorized.md index b4cc670c..40698e9d 100644 --- a/docs/models/errors/GetSearchAllLibrariesUnauthorized.md +++ b/docs/models/errors/GetSearchAllLibrariesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSearchAllLibrariesLibraryErrors](../../models/errors/GetSearchAllLibrariesLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSearchAllLibrariesLibraryErrors](../../models/errors/GetSearchAllLibrariesLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSearchLibraryBadRequest.md b/docs/models/errors/GetSearchLibraryBadRequest.md index 2ff15613..c1b7342c 100644 --- a/docs/models/errors/GetSearchLibraryBadRequest.md +++ b/docs/models/errors/GetSearchLibraryBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSearchLibraryErrors](../../models/errors/GetSearchLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSearchLibraryErrors](../../models/errors/GetSearchLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSearchLibraryUnauthorized.md b/docs/models/errors/GetSearchLibraryUnauthorized.md index 9624a84c..1bc10c4f 100644 --- a/docs/models/errors/GetSearchLibraryUnauthorized.md +++ b/docs/models/errors/GetSearchLibraryUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSearchLibraryLibraryErrors](../../models/errors/GetSearchLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSearchLibraryLibraryErrors](../../models/errors/GetSearchLibraryLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSearchResultsBadRequest.md b/docs/models/errors/GetSearchResultsBadRequest.md index 1dab9899..0ce17c84 100644 --- a/docs/models/errors/GetSearchResultsBadRequest.md +++ b/docs/models/errors/GetSearchResultsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSearchResultsErrors](../../models/errors/GetSearchResultsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSearchResultsErrors](../../models/errors/GetSearchResultsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSearchResultsUnauthorized.md b/docs/models/errors/GetSearchResultsUnauthorized.md index 6f5cc69f..18fdaa52 100644 --- a/docs/models/errors/GetSearchResultsUnauthorized.md +++ b/docs/models/errors/GetSearchResultsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSearchResultsSearchErrors](../../models/errors/GetSearchResultsSearchErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSearchResultsSearchErrors](../../models/errors/GetSearchResultsSearchErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerActivitiesBadRequest.md b/docs/models/errors/GetServerActivitiesBadRequest.md index 2645cffc..4426ff02 100644 --- a/docs/models/errors/GetServerActivitiesBadRequest.md +++ b/docs/models/errors/GetServerActivitiesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerActivitiesErrors](../../models/errors/GetServerActivitiesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerActivitiesErrors](../../models/errors/GetServerActivitiesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerActivitiesUnauthorized.md b/docs/models/errors/GetServerActivitiesUnauthorized.md index 69d33d26..00fa5b4b 100644 --- a/docs/models/errors/GetServerActivitiesUnauthorized.md +++ b/docs/models/errors/GetServerActivitiesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerActivitiesActivitiesErrors](../../models/errors/GetServerActivitiesActivitiesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerActivitiesActivitiesErrors](../../models/errors/GetServerActivitiesActivitiesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerCapabilitiesBadRequest.md b/docs/models/errors/GetServerCapabilitiesBadRequest.md index 9936f78e..74d1f3b0 100644 --- a/docs/models/errors/GetServerCapabilitiesBadRequest.md +++ b/docs/models/errors/GetServerCapabilitiesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[Errors](../../models/errors/Errors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[Errors](../../models/errors/Errors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerCapabilitiesUnauthorized.md b/docs/models/errors/GetServerCapabilitiesUnauthorized.md index 271bcb3a..af172822 100644 --- a/docs/models/errors/GetServerCapabilitiesUnauthorized.md +++ b/docs/models/errors/GetServerCapabilitiesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerCapabilitiesErrors](../../models/errors/GetServerCapabilitiesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerCapabilitiesErrors](../../models/errors/GetServerCapabilitiesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerIdentityRequestTimeout.md b/docs/models/errors/GetServerIdentityRequestTimeout.md index 87c59cf6..9878df55 100644 --- a/docs/models/errors/GetServerIdentityRequestTimeout.md +++ b/docs/models/errors/GetServerIdentityRequestTimeout.md @@ -5,8 +5,8 @@ Request Timeout ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `code` | *Optional\* | :heavy_minus_sign: | N/A | 408 | -| `message` | *Optional\* | :heavy_minus_sign: | N/A | The server timed out waiting for the request. | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `code` | *Optional\* | :heavy_minus_sign: | N/A | 408 | +| `message` | *Optional\* | :heavy_minus_sign: | N/A | The server timed out waiting for the request. | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/GetServerListBadRequest.md b/docs/models/errors/GetServerListBadRequest.md index 9dcc5628..a374e49d 100644 --- a/docs/models/errors/GetServerListBadRequest.md +++ b/docs/models/errors/GetServerListBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerListErrors](../../models/errors/GetServerListErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerListErrors](../../models/errors/GetServerListErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerListUnauthorized.md b/docs/models/errors/GetServerListUnauthorized.md index 8a93de5f..a2f0e2af 100644 --- a/docs/models/errors/GetServerListUnauthorized.md +++ b/docs/models/errors/GetServerListUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerListServerErrors](../../models/errors/GetServerListServerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerListServerErrors](../../models/errors/GetServerListServerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerPreferencesBadRequest.md b/docs/models/errors/GetServerPreferencesBadRequest.md index 21c7096f..88fe67c1 100644 --- a/docs/models/errors/GetServerPreferencesBadRequest.md +++ b/docs/models/errors/GetServerPreferencesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerPreferencesErrors](../../models/errors/GetServerPreferencesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerPreferencesErrors](../../models/errors/GetServerPreferencesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerPreferencesUnauthorized.md b/docs/models/errors/GetServerPreferencesUnauthorized.md index 3841ee04..d2920ac0 100644 --- a/docs/models/errors/GetServerPreferencesUnauthorized.md +++ b/docs/models/errors/GetServerPreferencesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerPreferencesServerErrors](../../models/errors/GetServerPreferencesServerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerPreferencesServerErrors](../../models/errors/GetServerPreferencesServerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerResourcesBadRequest.md b/docs/models/errors/GetServerResourcesBadRequest.md index dd67bf9b..ea85d567 100644 --- a/docs/models/errors/GetServerResourcesBadRequest.md +++ b/docs/models/errors/GetServerResourcesBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerResourcesErrors](../../models/errors/GetServerResourcesErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerResourcesErrors](../../models/errors/GetServerResourcesErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetServerResourcesUnauthorized.md b/docs/models/errors/GetServerResourcesUnauthorized.md index 0f082ad0..4a828424 100644 --- a/docs/models/errors/GetServerResourcesUnauthorized.md +++ b/docs/models/errors/GetServerResourcesUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetServerResourcesPlexErrors](../../models/errors/GetServerResourcesPlexErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetServerResourcesPlexErrors](../../models/errors/GetServerResourcesPlexErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSessionHistoryBadRequest.md b/docs/models/errors/GetSessionHistoryBadRequest.md index fee32af7..29caffa5 100644 --- a/docs/models/errors/GetSessionHistoryBadRequest.md +++ b/docs/models/errors/GetSessionHistoryBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSessionHistoryErrors](../../models/errors/GetSessionHistoryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSessionHistoryErrors](../../models/errors/GetSessionHistoryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSessionHistoryUnauthorized.md b/docs/models/errors/GetSessionHistoryUnauthorized.md index 80f0aea4..65033633 100644 --- a/docs/models/errors/GetSessionHistoryUnauthorized.md +++ b/docs/models/errors/GetSessionHistoryUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSessionHistorySessionsErrors](../../models/errors/GetSessionHistorySessionsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSessionHistorySessionsErrors](../../models/errors/GetSessionHistorySessionsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSessionsBadRequest.md b/docs/models/errors/GetSessionsBadRequest.md index f93f8e40..2718d055 100644 --- a/docs/models/errors/GetSessionsBadRequest.md +++ b/docs/models/errors/GetSessionsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSessionsErrors](../../models/errors/GetSessionsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSessionsErrors](../../models/errors/GetSessionsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSessionsUnauthorized.md b/docs/models/errors/GetSessionsUnauthorized.md index 094db48c..ceb68ee6 100644 --- a/docs/models/errors/GetSessionsUnauthorized.md +++ b/docs/models/errors/GetSessionsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSessionsSessionsErrors](../../models/errors/GetSessionsSessionsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSessionsSessionsErrors](../../models/errors/GetSessionsSessionsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSourceConnectionInformationBadRequest.md b/docs/models/errors/GetSourceConnectionInformationBadRequest.md index fb4c7d95..e9d48568 100644 --- a/docs/models/errors/GetSourceConnectionInformationBadRequest.md +++ b/docs/models/errors/GetSourceConnectionInformationBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetSourceConnectionInformationErrors](../../models/errors/GetSourceConnectionInformationErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetSourceConnectionInformationErrors](../../models/errors/GetSourceConnectionInformationErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetSourceConnectionInformationUnauthorized.md b/docs/models/errors/GetSourceConnectionInformationUnauthorized.md index e25abf67..6bc58500 100644 --- a/docs/models/errors/GetSourceConnectionInformationUnauthorized.md +++ b/docs/models/errors/GetSourceConnectionInformationUnauthorized.md @@ -8,4 +8,4 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | `errors` | List\<[GetSourceConnectionInformationAuthenticationErrors](../../models/errors/GetSourceConnectionInformationAuthenticationErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetStatisticsBadRequest.md b/docs/models/errors/GetStatisticsBadRequest.md index 62ebd895..8d831e9a 100644 --- a/docs/models/errors/GetStatisticsBadRequest.md +++ b/docs/models/errors/GetStatisticsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetStatisticsErrors](../../models/errors/GetStatisticsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetStatisticsErrors](../../models/errors/GetStatisticsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetStatisticsUnauthorized.md b/docs/models/errors/GetStatisticsUnauthorized.md index a20fa8ac..73d4d5af 100644 --- a/docs/models/errors/GetStatisticsUnauthorized.md +++ b/docs/models/errors/GetStatisticsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetStatisticsStatisticsErrors](../../models/errors/GetStatisticsStatisticsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetStatisticsStatisticsErrors](../../models/errors/GetStatisticsStatisticsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetThumbImageBadRequest.md b/docs/models/errors/GetThumbImageBadRequest.md index 27445404..a602bf25 100644 --- a/docs/models/errors/GetThumbImageBadRequest.md +++ b/docs/models/errors/GetThumbImageBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetThumbImageErrors](../../models/errors/GetThumbImageErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetThumbImageErrors](../../models/errors/GetThumbImageErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetThumbImageUnauthorized.md b/docs/models/errors/GetThumbImageUnauthorized.md index 9c41155f..dfe05b5e 100644 --- a/docs/models/errors/GetThumbImageUnauthorized.md +++ b/docs/models/errors/GetThumbImageUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetThumbImageMediaErrors](../../models/errors/GetThumbImageMediaErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetThumbImageMediaErrors](../../models/errors/GetThumbImageMediaErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTimelineBadRequest.md b/docs/models/errors/GetTimelineBadRequest.md index 65852551..57ec7d4f 100644 --- a/docs/models/errors/GetTimelineBadRequest.md +++ b/docs/models/errors/GetTimelineBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTimelineErrors](../../models/errors/GetTimelineErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTimelineErrors](../../models/errors/GetTimelineErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTimelineUnauthorized.md b/docs/models/errors/GetTimelineUnauthorized.md index e4c58498..6b0a2ab2 100644 --- a/docs/models/errors/GetTimelineUnauthorized.md +++ b/docs/models/errors/GetTimelineUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTimelineVideoErrors](../../models/errors/GetTimelineVideoErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTimelineVideoErrors](../../models/errors/GetTimelineVideoErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTokenByPinIdBadRequest.md b/docs/models/errors/GetTokenByPinIdBadRequest.md index cd561f45..5706bed6 100644 --- a/docs/models/errors/GetTokenByPinIdBadRequest.md +++ b/docs/models/errors/GetTokenByPinIdBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTokenByPinIdErrors](../../models/errors/GetTokenByPinIdErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTokenByPinIdErrors](../../models/errors/GetTokenByPinIdErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTokenByPinIdResponseBody.md b/docs/models/errors/GetTokenByPinIdResponseBody.md index 62efb855..76956d93 100644 --- a/docs/models/errors/GetTokenByPinIdResponseBody.md +++ b/docs/models/errors/GetTokenByPinIdResponseBody.md @@ -5,7 +5,7 @@ Not Found or Expired ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTokenByPinIdPlexErrors](../../models/errors/GetTokenByPinIdPlexErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTokenByPinIdPlexErrors](../../models/errors/GetTokenByPinIdPlexErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTokenDetailsBadRequest.md b/docs/models/errors/GetTokenDetailsBadRequest.md index cd1fa2d0..7606704d 100644 --- a/docs/models/errors/GetTokenDetailsBadRequest.md +++ b/docs/models/errors/GetTokenDetailsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTokenDetailsErrors](../../models/errors/GetTokenDetailsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTokenDetailsErrors](../../models/errors/GetTokenDetailsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTokenDetailsUnauthorized.md b/docs/models/errors/GetTokenDetailsUnauthorized.md index 51e84514..d63632f5 100644 --- a/docs/models/errors/GetTokenDetailsUnauthorized.md +++ b/docs/models/errors/GetTokenDetailsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTokenDetailsAuthenticationErrors](../../models/errors/GetTokenDetailsAuthenticationErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTokenDetailsAuthenticationErrors](../../models/errors/GetTokenDetailsAuthenticationErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTopWatchedContentBadRequest.md b/docs/models/errors/GetTopWatchedContentBadRequest.md index 1f8fe75e..17b1300d 100644 --- a/docs/models/errors/GetTopWatchedContentBadRequest.md +++ b/docs/models/errors/GetTopWatchedContentBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTopWatchedContentErrors](../../models/errors/GetTopWatchedContentErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTopWatchedContentErrors](../../models/errors/GetTopWatchedContentErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTopWatchedContentUnauthorized.md b/docs/models/errors/GetTopWatchedContentUnauthorized.md index a06d50e9..04421a4c 100644 --- a/docs/models/errors/GetTopWatchedContentUnauthorized.md +++ b/docs/models/errors/GetTopWatchedContentUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTopWatchedContentLibraryErrors](../../models/errors/GetTopWatchedContentLibraryErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTopWatchedContentLibraryErrors](../../models/errors/GetTopWatchedContentLibraryErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTranscodeSessionsBadRequest.md b/docs/models/errors/GetTranscodeSessionsBadRequest.md index 4d7f6d83..63949f4a 100644 --- a/docs/models/errors/GetTranscodeSessionsBadRequest.md +++ b/docs/models/errors/GetTranscodeSessionsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTranscodeSessionsErrors](../../models/errors/GetTranscodeSessionsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTranscodeSessionsErrors](../../models/errors/GetTranscodeSessionsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTranscodeSessionsUnauthorized.md b/docs/models/errors/GetTranscodeSessionsUnauthorized.md index 5d8c68fa..59e2bd97 100644 --- a/docs/models/errors/GetTranscodeSessionsUnauthorized.md +++ b/docs/models/errors/GetTranscodeSessionsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTranscodeSessionsSessionsErrors](../../models/errors/GetTranscodeSessionsSessionsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTranscodeSessionsSessionsErrors](../../models/errors/GetTranscodeSessionsSessionsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTransientTokenBadRequest.md b/docs/models/errors/GetTransientTokenBadRequest.md index b7648983..dd663a63 100644 --- a/docs/models/errors/GetTransientTokenBadRequest.md +++ b/docs/models/errors/GetTransientTokenBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTransientTokenErrors](../../models/errors/GetTransientTokenErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTransientTokenErrors](../../models/errors/GetTransientTokenErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetTransientTokenUnauthorized.md b/docs/models/errors/GetTransientTokenUnauthorized.md index 1d627b0b..8b8ee5e6 100644 --- a/docs/models/errors/GetTransientTokenUnauthorized.md +++ b/docs/models/errors/GetTransientTokenUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetTransientTokenAuthenticationErrors](../../models/errors/GetTransientTokenAuthenticationErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetTransientTokenAuthenticationErrors](../../models/errors/GetTransientTokenAuthenticationErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetUpdateStatusBadRequest.md b/docs/models/errors/GetUpdateStatusBadRequest.md index 2d1747e4..6a0a8ad1 100644 --- a/docs/models/errors/GetUpdateStatusBadRequest.md +++ b/docs/models/errors/GetUpdateStatusBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetUpdateStatusErrors](../../models/errors/GetUpdateStatusErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetUpdateStatusErrors](../../models/errors/GetUpdateStatusErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetUpdateStatusUnauthorized.md b/docs/models/errors/GetUpdateStatusUnauthorized.md index d9927324..6e4ce0d0 100644 --- a/docs/models/errors/GetUpdateStatusUnauthorized.md +++ b/docs/models/errors/GetUpdateStatusUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetUpdateStatusUpdaterErrors](../../models/errors/GetUpdateStatusUpdaterErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetUpdateStatusUpdaterErrors](../../models/errors/GetUpdateStatusUpdaterErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetUserFriendsBadRequest.md b/docs/models/errors/GetUserFriendsBadRequest.md index 561c02da..c8c931c5 100644 --- a/docs/models/errors/GetUserFriendsBadRequest.md +++ b/docs/models/errors/GetUserFriendsBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetUserFriendsErrors](../../models/errors/GetUserFriendsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetUserFriendsErrors](../../models/errors/GetUserFriendsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetUserFriendsUnauthorized.md b/docs/models/errors/GetUserFriendsUnauthorized.md index f002a31c..1b4f9063 100644 --- a/docs/models/errors/GetUserFriendsUnauthorized.md +++ b/docs/models/errors/GetUserFriendsUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetUserFriendsPlexErrors](../../models/errors/GetUserFriendsPlexErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetUserFriendsPlexErrors](../../models/errors/GetUserFriendsPlexErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetUsersBadRequest.md b/docs/models/errors/GetUsersBadRequest.md index 4a9a6b01..b1212684 100644 --- a/docs/models/errors/GetUsersBadRequest.md +++ b/docs/models/errors/GetUsersBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetUsersErrors](../../models/errors/GetUsersErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetUsersErrors](../../models/errors/GetUsersErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetUsersUnauthorized.md b/docs/models/errors/GetUsersUnauthorized.md index f5a4fb6c..3c154d28 100644 --- a/docs/models/errors/GetUsersUnauthorized.md +++ b/docs/models/errors/GetUsersUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetUsersUsersErrors](../../models/errors/GetUsersUsersErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetUsersUsersErrors](../../models/errors/GetUsersUsersErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetWatchListBadRequest.md b/docs/models/errors/GetWatchListBadRequest.md index 754fb677..b2fb74c1 100644 --- a/docs/models/errors/GetWatchListBadRequest.md +++ b/docs/models/errors/GetWatchListBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetWatchListErrors](../../models/errors/GetWatchListErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetWatchListErrors](../../models/errors/GetWatchListErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/GetWatchListUnauthorized.md b/docs/models/errors/GetWatchListUnauthorized.md index 349ed420..16a23fd6 100644 --- a/docs/models/errors/GetWatchListUnauthorized.md +++ b/docs/models/errors/GetWatchListUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[GetWatchListWatchlistErrors](../../models/errors/GetWatchListWatchlistErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[GetWatchListWatchlistErrors](../../models/errors/GetWatchListWatchlistErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/LogLineBadRequest.md b/docs/models/errors/LogLineBadRequest.md index 66b3fcd9..9169c16e 100644 --- a/docs/models/errors/LogLineBadRequest.md +++ b/docs/models/errors/LogLineBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[LogLineErrors](../../models/errors/LogLineErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[LogLineErrors](../../models/errors/LogLineErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/LogLineUnauthorized.md b/docs/models/errors/LogLineUnauthorized.md index 95be61ba..b38c2a21 100644 --- a/docs/models/errors/LogLineUnauthorized.md +++ b/docs/models/errors/LogLineUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[LogLineLogErrors](../../models/errors/LogLineLogErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[LogLineLogErrors](../../models/errors/LogLineLogErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/LogMultiLineBadRequest.md b/docs/models/errors/LogMultiLineBadRequest.md index db4f088e..42b91c57 100644 --- a/docs/models/errors/LogMultiLineBadRequest.md +++ b/docs/models/errors/LogMultiLineBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[LogMultiLineErrors](../../models/errors/LogMultiLineErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[LogMultiLineErrors](../../models/errors/LogMultiLineErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/LogMultiLineUnauthorized.md b/docs/models/errors/LogMultiLineUnauthorized.md index a2f10f0b..bdddfa1b 100644 --- a/docs/models/errors/LogMultiLineUnauthorized.md +++ b/docs/models/errors/LogMultiLineUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[LogMultiLineLogErrors](../../models/errors/LogMultiLineLogErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[LogMultiLineLogErrors](../../models/errors/LogMultiLineLogErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/MarkPlayedBadRequest.md b/docs/models/errors/MarkPlayedBadRequest.md index 4ef03fe8..57e97be5 100644 --- a/docs/models/errors/MarkPlayedBadRequest.md +++ b/docs/models/errors/MarkPlayedBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[MarkPlayedErrors](../../models/errors/MarkPlayedErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[MarkPlayedErrors](../../models/errors/MarkPlayedErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/MarkPlayedUnauthorized.md b/docs/models/errors/MarkPlayedUnauthorized.md index 2f723afa..e0472702 100644 --- a/docs/models/errors/MarkPlayedUnauthorized.md +++ b/docs/models/errors/MarkPlayedUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[MarkPlayedMediaErrors](../../models/errors/MarkPlayedMediaErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[MarkPlayedMediaErrors](../../models/errors/MarkPlayedMediaErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/MarkUnplayedBadRequest.md b/docs/models/errors/MarkUnplayedBadRequest.md index 0df81399..bf3ebb53 100644 --- a/docs/models/errors/MarkUnplayedBadRequest.md +++ b/docs/models/errors/MarkUnplayedBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[MarkUnplayedErrors](../../models/errors/MarkUnplayedErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[MarkUnplayedErrors](../../models/errors/MarkUnplayedErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/MarkUnplayedUnauthorized.md b/docs/models/errors/MarkUnplayedUnauthorized.md index 83a78989..0376b5b2 100644 --- a/docs/models/errors/MarkUnplayedUnauthorized.md +++ b/docs/models/errors/MarkUnplayedUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[MarkUnplayedMediaErrors](../../models/errors/MarkUnplayedMediaErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[MarkUnplayedMediaErrors](../../models/errors/MarkUnplayedMediaErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/PerformSearchBadRequest.md b/docs/models/errors/PerformSearchBadRequest.md index 05a83a4d..0324ed89 100644 --- a/docs/models/errors/PerformSearchBadRequest.md +++ b/docs/models/errors/PerformSearchBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[PerformSearchErrors](../../models/errors/PerformSearchErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[PerformSearchErrors](../../models/errors/PerformSearchErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/PerformSearchUnauthorized.md b/docs/models/errors/PerformSearchUnauthorized.md index e5662d3e..80e864c3 100644 --- a/docs/models/errors/PerformSearchUnauthorized.md +++ b/docs/models/errors/PerformSearchUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[PerformSearchSearchErrors](../../models/errors/PerformSearchSearchErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[PerformSearchSearchErrors](../../models/errors/PerformSearchSearchErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/PerformVoiceSearchBadRequest.md b/docs/models/errors/PerformVoiceSearchBadRequest.md index 9c292aef..2714a778 100644 --- a/docs/models/errors/PerformVoiceSearchBadRequest.md +++ b/docs/models/errors/PerformVoiceSearchBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[PerformVoiceSearchErrors](../../models/errors/PerformVoiceSearchErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[PerformVoiceSearchErrors](../../models/errors/PerformVoiceSearchErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/PerformVoiceSearchUnauthorized.md b/docs/models/errors/PerformVoiceSearchUnauthorized.md index 7e2f798f..477ca384 100644 --- a/docs/models/errors/PerformVoiceSearchUnauthorized.md +++ b/docs/models/errors/PerformVoiceSearchUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[PerformVoiceSearchSearchErrors](../../models/errors/PerformVoiceSearchSearchErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[PerformVoiceSearchSearchErrors](../../models/errors/PerformVoiceSearchSearchErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/PostUsersSignInDataBadRequest.md b/docs/models/errors/PostUsersSignInDataBadRequest.md index 551d5231..b9cc25b0 100644 --- a/docs/models/errors/PostUsersSignInDataBadRequest.md +++ b/docs/models/errors/PostUsersSignInDataBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[PostUsersSignInDataErrors](../../models/errors/PostUsersSignInDataErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[PostUsersSignInDataErrors](../../models/errors/PostUsersSignInDataErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/PostUsersSignInDataUnauthorized.md b/docs/models/errors/PostUsersSignInDataUnauthorized.md index 51e0b09c..20384591 100644 --- a/docs/models/errors/PostUsersSignInDataUnauthorized.md +++ b/docs/models/errors/PostUsersSignInDataUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[PostUsersSignInDataAuthenticationErrors](../../models/errors/PostUsersSignInDataAuthenticationErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[PostUsersSignInDataAuthenticationErrors](../../models/errors/PostUsersSignInDataAuthenticationErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StartAllTasksBadRequest.md b/docs/models/errors/StartAllTasksBadRequest.md index 1a8546ce..6d0ef47c 100644 --- a/docs/models/errors/StartAllTasksBadRequest.md +++ b/docs/models/errors/StartAllTasksBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StartAllTasksErrors](../../models/errors/StartAllTasksErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StartAllTasksErrors](../../models/errors/StartAllTasksErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StartAllTasksUnauthorized.md b/docs/models/errors/StartAllTasksUnauthorized.md index 6ed19d97..8cd8cc62 100644 --- a/docs/models/errors/StartAllTasksUnauthorized.md +++ b/docs/models/errors/StartAllTasksUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StartAllTasksButlerErrors](../../models/errors/StartAllTasksButlerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StartAllTasksButlerErrors](../../models/errors/StartAllTasksButlerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StartTaskBadRequest.md b/docs/models/errors/StartTaskBadRequest.md index 37a2de51..cd10734d 100644 --- a/docs/models/errors/StartTaskBadRequest.md +++ b/docs/models/errors/StartTaskBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StartTaskErrors](../../models/errors/StartTaskErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StartTaskErrors](../../models/errors/StartTaskErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StartTaskUnauthorized.md b/docs/models/errors/StartTaskUnauthorized.md index 7f22cd9f..4766ca75 100644 --- a/docs/models/errors/StartTaskUnauthorized.md +++ b/docs/models/errors/StartTaskUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StartTaskButlerErrors](../../models/errors/StartTaskButlerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StartTaskButlerErrors](../../models/errors/StartTaskButlerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StartUniversalTranscodeBadRequest.md b/docs/models/errors/StartUniversalTranscodeBadRequest.md index 14da563e..a659bef2 100644 --- a/docs/models/errors/StartUniversalTranscodeBadRequest.md +++ b/docs/models/errors/StartUniversalTranscodeBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StartUniversalTranscodeErrors](../../models/errors/StartUniversalTranscodeErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StartUniversalTranscodeErrors](../../models/errors/StartUniversalTranscodeErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StartUniversalTranscodeUnauthorized.md b/docs/models/errors/StartUniversalTranscodeUnauthorized.md index ebd91c13..f16d0820 100644 --- a/docs/models/errors/StartUniversalTranscodeUnauthorized.md +++ b/docs/models/errors/StartUniversalTranscodeUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StartUniversalTranscodeVideoErrors](../../models/errors/StartUniversalTranscodeVideoErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StartUniversalTranscodeVideoErrors](../../models/errors/StartUniversalTranscodeVideoErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StopAllTasksBadRequest.md b/docs/models/errors/StopAllTasksBadRequest.md index d246c495..95cce4c1 100644 --- a/docs/models/errors/StopAllTasksBadRequest.md +++ b/docs/models/errors/StopAllTasksBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StopAllTasksErrors](../../models/errors/StopAllTasksErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StopAllTasksErrors](../../models/errors/StopAllTasksErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StopAllTasksUnauthorized.md b/docs/models/errors/StopAllTasksUnauthorized.md index 5403c33e..c63df42e 100644 --- a/docs/models/errors/StopAllTasksUnauthorized.md +++ b/docs/models/errors/StopAllTasksUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StopAllTasksButlerErrors](../../models/errors/StopAllTasksButlerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StopAllTasksButlerErrors](../../models/errors/StopAllTasksButlerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StopTaskBadRequest.md b/docs/models/errors/StopTaskBadRequest.md index e8f58169..b956e7f4 100644 --- a/docs/models/errors/StopTaskBadRequest.md +++ b/docs/models/errors/StopTaskBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StopTaskErrors](../../models/errors/StopTaskErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StopTaskErrors](../../models/errors/StopTaskErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StopTaskUnauthorized.md b/docs/models/errors/StopTaskUnauthorized.md index 95bef83c..b695c538 100644 --- a/docs/models/errors/StopTaskUnauthorized.md +++ b/docs/models/errors/StopTaskUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StopTaskButlerErrors](../../models/errors/StopTaskButlerErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StopTaskButlerErrors](../../models/errors/StopTaskButlerErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StopTranscodeSessionBadRequest.md b/docs/models/errors/StopTranscodeSessionBadRequest.md index 23e2feb3..6bd7471c 100644 --- a/docs/models/errors/StopTranscodeSessionBadRequest.md +++ b/docs/models/errors/StopTranscodeSessionBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StopTranscodeSessionErrors](../../models/errors/StopTranscodeSessionErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StopTranscodeSessionErrors](../../models/errors/StopTranscodeSessionErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/StopTranscodeSessionUnauthorized.md b/docs/models/errors/StopTranscodeSessionUnauthorized.md index bc12a8cf..7d4a3702 100644 --- a/docs/models/errors/StopTranscodeSessionUnauthorized.md +++ b/docs/models/errors/StopTranscodeSessionUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[StopTranscodeSessionSessionsErrors](../../models/errors/StopTranscodeSessionSessionsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[StopTranscodeSessionSessionsErrors](../../models/errors/StopTranscodeSessionSessionsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/UpdatePlayProgressBadRequest.md b/docs/models/errors/UpdatePlayProgressBadRequest.md index ebfd8add..84c046f8 100644 --- a/docs/models/errors/UpdatePlayProgressBadRequest.md +++ b/docs/models/errors/UpdatePlayProgressBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[UpdatePlayProgressErrors](../../models/errors/UpdatePlayProgressErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[UpdatePlayProgressErrors](../../models/errors/UpdatePlayProgressErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/UpdatePlayProgressUnauthorized.md b/docs/models/errors/UpdatePlayProgressUnauthorized.md index be162045..34edbdcd 100644 --- a/docs/models/errors/UpdatePlayProgressUnauthorized.md +++ b/docs/models/errors/UpdatePlayProgressUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[UpdatePlayProgressMediaErrors](../../models/errors/UpdatePlayProgressMediaErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[UpdatePlayProgressMediaErrors](../../models/errors/UpdatePlayProgressMediaErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/UpdatePlaylistBadRequest.md b/docs/models/errors/UpdatePlaylistBadRequest.md index 0164e77a..1f7bf6bb 100644 --- a/docs/models/errors/UpdatePlaylistBadRequest.md +++ b/docs/models/errors/UpdatePlaylistBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[UpdatePlaylistErrors](../../models/errors/UpdatePlaylistErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[UpdatePlaylistErrors](../../models/errors/UpdatePlaylistErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/UpdatePlaylistUnauthorized.md b/docs/models/errors/UpdatePlaylistUnauthorized.md index 8240fc4c..5aee2551 100644 --- a/docs/models/errors/UpdatePlaylistUnauthorized.md +++ b/docs/models/errors/UpdatePlaylistUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[UpdatePlaylistPlaylistsErrors](../../models/errors/UpdatePlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[UpdatePlaylistPlaylistsErrors](../../models/errors/UpdatePlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/UploadPlaylistBadRequest.md b/docs/models/errors/UploadPlaylistBadRequest.md index 737b9408..3166acbd 100644 --- a/docs/models/errors/UploadPlaylistBadRequest.md +++ b/docs/models/errors/UploadPlaylistBadRequest.md @@ -5,7 +5,7 @@ Bad Request - A parameter was not specified, or was specified incorrectly. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[UploadPlaylistErrors](../../models/errors/UploadPlaylistErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[UploadPlaylistErrors](../../models/errors/UploadPlaylistErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/errors/UploadPlaylistUnauthorized.md b/docs/models/errors/UploadPlaylistUnauthorized.md index 5d10ff85..8d46c189 100644 --- a/docs/models/errors/UploadPlaylistUnauthorized.md +++ b/docs/models/errors/UploadPlaylistUnauthorized.md @@ -5,7 +5,7 @@ Unauthorized - Returned if the X-Plex-Token is missing from the header or query. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `errors` | List\<[UploadPlaylistPlaylistsErrors](../../models/errors/UploadPlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `errors` | List\<[UploadPlaylistPlaylistsErrors](../../models/errors/UploadPlaylistPlaylistsErrors.md)> | :heavy_minus_sign: | N/A | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/AddPlaylistContentsResponse.md b/docs/models/operations/AddPlaylistContentsResponse.md index 180d3c07..5c83a746 100644 --- a/docs/models/operations/AddPlaylistContentsResponse.md +++ b/docs/models/operations/AddPlaylistContentsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/AddPlaylistContentsResponseBody.md) | :heavy_minus_sign: | Playlist Updated | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/AddPlaylistContentsResponseBody.md) | :heavy_minus_sign: | Playlist Updated | \ No newline at end of file diff --git a/docs/models/operations/ApplyUpdatesResponse.md b/docs/models/operations/ApplyUpdatesResponse.md index 461ff39a..4c4bc629 100644 --- a/docs/models/operations/ApplyUpdatesResponse.md +++ b/docs/models/operations/ApplyUpdatesResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/CancelServerActivitiesResponse.md b/docs/models/operations/CancelServerActivitiesResponse.md index 1a09f2c1..2f8da9c2 100644 --- a/docs/models/operations/CancelServerActivitiesResponse.md +++ b/docs/models/operations/CancelServerActivitiesResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/CheckForUpdatesResponse.md b/docs/models/operations/CheckForUpdatesResponse.md index 1f8aad59..8ef61d6b 100644 --- a/docs/models/operations/CheckForUpdatesResponse.md +++ b/docs/models/operations/CheckForUpdatesResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/ClearPlaylistContentsResponse.md b/docs/models/operations/ClearPlaylistContentsResponse.md index 23c1bc9d..bd118d48 100644 --- a/docs/models/operations/ClearPlaylistContentsResponse.md +++ b/docs/models/operations/ClearPlaylistContentsResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/CreatePlaylistResponse.md b/docs/models/operations/CreatePlaylistResponse.md index c25edb1d..5bb04447 100644 --- a/docs/models/operations/CreatePlaylistResponse.md +++ b/docs/models/operations/CreatePlaylistResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/CreatePlaylistResponseBody.md) | :heavy_minus_sign: | returns all playlists | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/CreatePlaylistResponseBody.md) | :heavy_minus_sign: | returns all playlists | \ No newline at end of file diff --git a/docs/models/operations/DeleteLibraryResponse.md b/docs/models/operations/DeleteLibraryResponse.md index af4b4ccc..6a169c6d 100644 --- a/docs/models/operations/DeleteLibraryResponse.md +++ b/docs/models/operations/DeleteLibraryResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/DeletePlaylistResponse.md b/docs/models/operations/DeletePlaylistResponse.md index a366d140..4e082aaf 100644 --- a/docs/models/operations/DeletePlaylistResponse.md +++ b/docs/models/operations/DeletePlaylistResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/EnablePaperTrailResponse.md b/docs/models/operations/EnablePaperTrailResponse.md index 37ff8146..074517c2 100644 --- a/docs/models/operations/EnablePaperTrailResponse.md +++ b/docs/models/operations/EnablePaperTrailResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetActorsLibraryResponse.md b/docs/models/operations/GetActorsLibraryResponse.md index 043ab94c..9d25cbbd 100644 --- a/docs/models/operations/GetActorsLibraryResponse.md +++ b/docs/models/operations/GetActorsLibraryResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetActorsLibraryResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetActorsLibraryResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/GetAllLibrariesResponse.md b/docs/models/operations/GetAllLibrariesResponse.md index 0f3d77dd..c278db65 100644 --- a/docs/models/operations/GetAllLibrariesResponse.md +++ b/docs/models/operations/GetAllLibrariesResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetAllLibrariesResponseBody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetAllLibrariesResponseBody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file diff --git a/docs/models/operations/GetAvailableClientsResponse.md b/docs/models/operations/GetAvailableClientsResponse.md index 461a879c..a47368f6 100644 --- a/docs/models/operations/GetAvailableClientsResponse.md +++ b/docs/models/operations/GetAvailableClientsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetAvailableClientsResponseBody.md) | :heavy_minus_sign: | Available Clients | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetAvailableClientsResponseBody.md) | :heavy_minus_sign: | Available Clients | \ No newline at end of file diff --git a/docs/models/operations/GetBandwidthStatisticsResponse.md b/docs/models/operations/GetBandwidthStatisticsResponse.md index 92988d54..43d5e925 100644 --- a/docs/models/operations/GetBandwidthStatisticsResponse.md +++ b/docs/models/operations/GetBandwidthStatisticsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetBandwidthStatisticsResponseBody.md) | :heavy_minus_sign: | Bandwidth Statistics | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetBandwidthStatisticsResponseBody.md) | :heavy_minus_sign: | Bandwidth Statistics | \ No newline at end of file diff --git a/docs/models/operations/GetBannerImageResponse.md b/docs/models/operations/GetBannerImageResponse.md index bac5e329..e7ff686b 100644 --- a/docs/models/operations/GetBannerImageResponse.md +++ b/docs/models/operations/GetBannerImageResponse.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `responseStream` | *Optional\* | :heavy_minus_sign: | Successful response returning an image | -| `headers` | Map\> | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `responseStream` | *Optional\* | :heavy_minus_sign: | Successful response returning an image | +| `headers` | Map\> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetButlerTasksResponse.md b/docs/models/operations/GetButlerTasksResponse.md index 44b19ff4..4177a7b3 100644 --- a/docs/models/operations/GetButlerTasksResponse.md +++ b/docs/models/operations/GetButlerTasksResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetButlerTasksResponseBody.md) | :heavy_minus_sign: | All butler tasks | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetButlerTasksResponseBody.md) | :heavy_minus_sign: | All butler tasks | \ No newline at end of file diff --git a/docs/models/operations/GetCompanionsDataResponse.md b/docs/models/operations/GetCompanionsDataResponse.md index 8185f0af..d0effc3a 100644 --- a/docs/models/operations/GetCompanionsDataResponse.md +++ b/docs/models/operations/GetCompanionsDataResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `responseBodies` | List\<[ResponseBody](../../models/operations/ResponseBody.md)> | :heavy_minus_sign: | Companions Data | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `responseBodies` | List\<[ResponseBody](../../models/operations/ResponseBody.md)> | :heavy_minus_sign: | Companions Data | \ No newline at end of file diff --git a/docs/models/operations/GetCountriesLibraryResponse.md b/docs/models/operations/GetCountriesLibraryResponse.md index 40755bd1..ef889c78 100644 --- a/docs/models/operations/GetCountriesLibraryResponse.md +++ b/docs/models/operations/GetCountriesLibraryResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetCountriesLibraryResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetCountriesLibraryResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/GetDevicesResponse.md b/docs/models/operations/GetDevicesResponse.md index ce86f199..1c9bcec3 100644 --- a/docs/models/operations/GetDevicesResponse.md +++ b/docs/models/operations/GetDevicesResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetDevicesResponseBody.md) | :heavy_minus_sign: | Devices | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetDevicesResponseBody.md) | :heavy_minus_sign: | Devices | \ No newline at end of file diff --git a/docs/models/operations/GetFileHashResponse.md b/docs/models/operations/GetFileHashResponse.md index d3a6f73e..223d26af 100644 --- a/docs/models/operations/GetFileHashResponse.md +++ b/docs/models/operations/GetFileHashResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetGenresLibraryResponse.md b/docs/models/operations/GetGenresLibraryResponse.md index ae399767..9700a2f7 100644 --- a/docs/models/operations/GetGenresLibraryResponse.md +++ b/docs/models/operations/GetGenresLibraryResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetGenresLibraryResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetGenresLibraryResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/GetGeoDataResponse.md b/docs/models/operations/GetGeoDataResponse.md index 60cbaec7..a8db3888 100644 --- a/docs/models/operations/GetGeoDataResponse.md +++ b/docs/models/operations/GetGeoDataResponse.md @@ -7,5 +7,5 @@ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | | | `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | | `geoData` | [Optional\](../../models/operations/GetGeoDataGeoData.md) | :heavy_minus_sign: | Gets the geo location data of the user | {
"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"
} | \ No newline at end of file diff --git a/docs/models/operations/GetGlobalHubsResponse.md b/docs/models/operations/GetGlobalHubsResponse.md index 345c173c..b2e56c91 100644 --- a/docs/models/operations/GetGlobalHubsResponse.md +++ b/docs/models/operations/GetGlobalHubsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetGlobalHubsResponseBody.md) | :heavy_minus_sign: | returns global hubs | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetGlobalHubsResponseBody.md) | :heavy_minus_sign: | returns global hubs | \ No newline at end of file diff --git a/docs/models/operations/GetHomeDataResponse.md b/docs/models/operations/GetHomeDataResponse.md index 34935896..9b4828b3 100644 --- a/docs/models/operations/GetHomeDataResponse.md +++ b/docs/models/operations/GetHomeDataResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetHomeDataResponseBody.md) | :heavy_minus_sign: | Home Data | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetHomeDataResponseBody.md) | :heavy_minus_sign: | Home Data | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryDetailsResponse.md b/docs/models/operations/GetLibraryDetailsResponse.md index 5e0af78b..60bd9b43 100644 --- a/docs/models/operations/GetLibraryDetailsResponse.md +++ b/docs/models/operations/GetLibraryDetailsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetLibraryDetailsResponseBody.md) | :heavy_minus_sign: | The details of the library | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetLibraryDetailsResponseBody.md) | :heavy_minus_sign: | The details of the library | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryHubsResponse.md b/docs/models/operations/GetLibraryHubsResponse.md index ff4ef68a..9a5eefc2 100644 --- a/docs/models/operations/GetLibraryHubsResponse.md +++ b/docs/models/operations/GetLibraryHubsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetLibraryHubsResponseBody.md) | :heavy_minus_sign: | The hubs specific to the library | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetLibraryHubsResponseBody.md) | :heavy_minus_sign: | The hubs specific to the library | \ No newline at end of file diff --git a/docs/models/operations/GetLibraryItemsResponse.md b/docs/models/operations/GetLibraryItemsResponse.md index 7649114e..82533369 100644 --- a/docs/models/operations/GetLibraryItemsResponse.md +++ b/docs/models/operations/GetLibraryItemsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetLibraryItemsResponseBody.md) | :heavy_minus_sign: | The contents of the library by section and tag | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetLibraryItemsResponseBody.md) | :heavy_minus_sign: | The contents of the library by section and tag | \ No newline at end of file diff --git a/docs/models/operations/GetLibrarySectionsAllResponse.md b/docs/models/operations/GetLibrarySectionsAllResponse.md index 0f3c8f6e..343482b1 100644 --- a/docs/models/operations/GetLibrarySectionsAllResponse.md +++ b/docs/models/operations/GetLibrarySectionsAllResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetLibrarySectionsAllResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetLibrarySectionsAllResponseBody.md) | :heavy_minus_sign: | Successful response containing media container data. | \ No newline at end of file diff --git a/docs/models/operations/GetMediaArtsResponse.md b/docs/models/operations/GetMediaArtsResponse.md index 949547d4..f902ffe4 100644 --- a/docs/models/operations/GetMediaArtsResponse.md +++ b/docs/models/operations/GetMediaArtsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetMediaArtsResponseBody.md) | :heavy_minus_sign: | The available background artwork for the library item. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetMediaArtsResponseBody.md) | :heavy_minus_sign: | The available background artwork for the library item. | \ No newline at end of file diff --git a/docs/models/operations/GetMediaMetaDataResponse.md b/docs/models/operations/GetMediaMetaDataResponse.md index 4153ed55..2b8b9284 100644 --- a/docs/models/operations/GetMediaMetaDataResponse.md +++ b/docs/models/operations/GetMediaMetaDataResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetMediaMetaDataResponseBody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetMediaMetaDataResponseBody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file diff --git a/docs/models/operations/GetMediaPostersResponse.md b/docs/models/operations/GetMediaPostersResponse.md index afd70df5..6f272896 100644 --- a/docs/models/operations/GetMediaPostersResponse.md +++ b/docs/models/operations/GetMediaPostersResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetMediaPostersResponseBody.md) | :heavy_minus_sign: | The available posters for the library item. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetMediaPostersResponseBody.md) | :heavy_minus_sign: | The available posters for the library item. | \ No newline at end of file diff --git a/docs/models/operations/GetMediaProvidersResponse.md b/docs/models/operations/GetMediaProvidersResponse.md index a16c56f5..0f78927b 100644 --- a/docs/models/operations/GetMediaProvidersResponse.md +++ b/docs/models/operations/GetMediaProvidersResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetMediaProvidersResponseBody.md) | :heavy_minus_sign: | Media providers and their features | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetMediaProvidersResponseBody.md) | :heavy_minus_sign: | Media providers and their features | \ No newline at end of file diff --git a/docs/models/operations/GetMetadataChildrenResponse.md b/docs/models/operations/GetMetadataChildrenResponse.md index 86b6a3f7..7c4a3404 100644 --- a/docs/models/operations/GetMetadataChildrenResponse.md +++ b/docs/models/operations/GetMetadataChildrenResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetMetadataChildrenResponseBody.md) | :heavy_minus_sign: | The children of the library item. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetMetadataChildrenResponseBody.md) | :heavy_minus_sign: | The children of the library item. | \ No newline at end of file diff --git a/docs/models/operations/GetMyPlexAccountResponse.md b/docs/models/operations/GetMyPlexAccountResponse.md index adf3293e..c2303480 100644 --- a/docs/models/operations/GetMyPlexAccountResponse.md +++ b/docs/models/operations/GetMyPlexAccountResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetMyPlexAccountResponseBody.md) | :heavy_minus_sign: | MyPlex Account | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetMyPlexAccountResponseBody.md) | :heavy_minus_sign: | MyPlex Account | \ No newline at end of file diff --git a/docs/models/operations/GetPinResponse.md b/docs/models/operations/GetPinResponse.md index bfd332ea..2b7a60bc 100644 --- a/docs/models/operations/GetPinResponse.md +++ b/docs/models/operations/GetPinResponse.md @@ -7,5 +7,5 @@ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | | | `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | | `authPinContainer` | [Optional\](../../models/operations/GetPinAuthPinContainer.md) | :heavy_minus_sign: | Requests a new pin id used in the authentication flow | {
"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
} | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistContentsResponse.md b/docs/models/operations/GetPlaylistContentsResponse.md index 6fd92a1a..4f3ca46c 100644 --- a/docs/models/operations/GetPlaylistContentsResponse.md +++ b/docs/models/operations/GetPlaylistContentsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetPlaylistContentsResponseBody.md) | :heavy_minus_sign: | The playlist contents | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetPlaylistContentsResponseBody.md) | :heavy_minus_sign: | The playlist contents | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistResponse.md b/docs/models/operations/GetPlaylistResponse.md index 03f13f24..6941451b 100644 --- a/docs/models/operations/GetPlaylistResponse.md +++ b/docs/models/operations/GetPlaylistResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetPlaylistResponseBody.md) | :heavy_minus_sign: | The playlist | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetPlaylistResponseBody.md) | :heavy_minus_sign: | The playlist | \ No newline at end of file diff --git a/docs/models/operations/GetPlaylistsResponse.md b/docs/models/operations/GetPlaylistsResponse.md index 0900aec8..58683a75 100644 --- a/docs/models/operations/GetPlaylistsResponse.md +++ b/docs/models/operations/GetPlaylistsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetPlaylistsResponseBody.md) | :heavy_minus_sign: | returns all playlists | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetPlaylistsResponseBody.md) | :heavy_minus_sign: | returns all playlists | \ No newline at end of file diff --git a/docs/models/operations/GetRecentlyAddedLibraryResponse.md b/docs/models/operations/GetRecentlyAddedLibraryResponse.md index b844bd7f..0e7342e4 100644 --- a/docs/models/operations/GetRecentlyAddedLibraryResponse.md +++ b/docs/models/operations/GetRecentlyAddedLibraryResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetRecentlyAddedLibraryResponseBody.md) | :heavy_minus_sign: | The recently added content | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetRecentlyAddedLibraryResponseBody.md) | :heavy_minus_sign: | The recently added content | \ No newline at end of file diff --git a/docs/models/operations/GetRecentlyAddedResponse.md b/docs/models/operations/GetRecentlyAddedResponse.md index 8dcec977..73c9649d 100644 --- a/docs/models/operations/GetRecentlyAddedResponse.md +++ b/docs/models/operations/GetRecentlyAddedResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetRecentlyAddedResponseBody.md) | :heavy_minus_sign: | A successful response with recently added content. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetRecentlyAddedResponseBody.md) | :heavy_minus_sign: | A successful response with recently added content. | \ No newline at end of file diff --git a/docs/models/operations/GetRefreshLibraryMetadataResponse.md b/docs/models/operations/GetRefreshLibraryMetadataResponse.md index dba520d6..d1286023 100644 --- a/docs/models/operations/GetRefreshLibraryMetadataResponse.md +++ b/docs/models/operations/GetRefreshLibraryMetadataResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetResizedPhotoResponse.md b/docs/models/operations/GetResizedPhotoResponse.md index 72d7e3c8..34b52959 100644 --- a/docs/models/operations/GetResizedPhotoResponse.md +++ b/docs/models/operations/GetResizedPhotoResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetResourcesStatisticsResponse.md b/docs/models/operations/GetResourcesStatisticsResponse.md index e608ca0d..192f8474 100644 --- a/docs/models/operations/GetResourcesStatisticsResponse.md +++ b/docs/models/operations/GetResourcesStatisticsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetResourcesStatisticsResponseBody.md) | :heavy_minus_sign: | Resource Statistics | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetResourcesStatisticsResponseBody.md) | :heavy_minus_sign: | Resource Statistics | \ No newline at end of file diff --git a/docs/models/operations/GetSearchAllLibrariesResponse.md b/docs/models/operations/GetSearchAllLibrariesResponse.md index 8e33dd47..34d861d0 100644 --- a/docs/models/operations/GetSearchAllLibrariesResponse.md +++ b/docs/models/operations/GetSearchAllLibrariesResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetSearchAllLibrariesResponseBody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetSearchAllLibrariesResponseBody.md) | :heavy_minus_sign: | The libraries available on the Server | \ No newline at end of file diff --git a/docs/models/operations/GetSearchLibraryResponse.md b/docs/models/operations/GetSearchLibraryResponse.md index 4a46b7c1..996143d1 100644 --- a/docs/models/operations/GetSearchLibraryResponse.md +++ b/docs/models/operations/GetSearchLibraryResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetSearchLibraryResponseBody.md) | :heavy_minus_sign: | The contents of the library by section and type | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetSearchLibraryResponseBody.md) | :heavy_minus_sign: | The contents of the library by section and type | \ No newline at end of file diff --git a/docs/models/operations/GetSearchResultsResponse.md b/docs/models/operations/GetSearchResultsResponse.md index 81c39fba..055dc0c1 100644 --- a/docs/models/operations/GetSearchResultsResponse.md +++ b/docs/models/operations/GetSearchResultsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetSearchResultsResponseBody.md) | :heavy_minus_sign: | Search Results | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetSearchResultsResponseBody.md) | :heavy_minus_sign: | Search Results | \ No newline at end of file diff --git a/docs/models/operations/GetServerActivitiesResponse.md b/docs/models/operations/GetServerActivitiesResponse.md index fd591b09..d5743265 100644 --- a/docs/models/operations/GetServerActivitiesResponse.md +++ b/docs/models/operations/GetServerActivitiesResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetServerActivitiesResponseBody.md) | :heavy_minus_sign: | The Server Activities | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetServerActivitiesResponseBody.md) | :heavy_minus_sign: | The Server Activities | \ No newline at end of file diff --git a/docs/models/operations/GetServerCapabilitiesResponse.md b/docs/models/operations/GetServerCapabilitiesResponse.md index 380d7d89..7f3409bc 100644 --- a/docs/models/operations/GetServerCapabilitiesResponse.md +++ b/docs/models/operations/GetServerCapabilitiesResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetServerCapabilitiesResponseBody.md) | :heavy_minus_sign: | The Server Capabilities | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetServerCapabilitiesResponseBody.md) | :heavy_minus_sign: | The Server Capabilities | \ No newline at end of file diff --git a/docs/models/operations/GetServerIdentityResponse.md b/docs/models/operations/GetServerIdentityResponse.md index 63967428..c0499fd7 100644 --- a/docs/models/operations/GetServerIdentityResponse.md +++ b/docs/models/operations/GetServerIdentityResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetServerIdentityResponseBody.md) | :heavy_minus_sign: | The Server Identity information | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetServerIdentityResponseBody.md) | :heavy_minus_sign: | The Server Identity information | \ No newline at end of file diff --git a/docs/models/operations/GetServerListResponse.md b/docs/models/operations/GetServerListResponse.md index 391f8a58..63c6c4f2 100644 --- a/docs/models/operations/GetServerListResponse.md +++ b/docs/models/operations/GetServerListResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetServerListResponseBody.md) | :heavy_minus_sign: | List of Servers | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetServerListResponseBody.md) | :heavy_minus_sign: | List of Servers | \ No newline at end of file diff --git a/docs/models/operations/GetServerPreferencesResponse.md b/docs/models/operations/GetServerPreferencesResponse.md index 813e6fdb..828a70ef 100644 --- a/docs/models/operations/GetServerPreferencesResponse.md +++ b/docs/models/operations/GetServerPreferencesResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetServerPreferencesResponseBody.md) | :heavy_minus_sign: | Server Preferences | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetServerPreferencesResponseBody.md) | :heavy_minus_sign: | Server Preferences | \ No newline at end of file diff --git a/docs/models/operations/GetServerResourcesResponse.md b/docs/models/operations/GetServerResourcesResponse.md index 602d650a..0cf5feb4 100644 --- a/docs/models/operations/GetServerResourcesResponse.md +++ b/docs/models/operations/GetServerResourcesResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `plexDevices` | List\<[PlexDevice](../../models/operations/PlexDevice.md)> | :heavy_minus_sign: | List of Plex Devices. This includes Plex hosted servers and clients | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `plexDevices` | List\<[PlexDevice](../../models/operations/PlexDevice.md)> | :heavy_minus_sign: | List of Plex Devices. This includes Plex hosted servers and clients | \ No newline at end of file diff --git a/docs/models/operations/GetSessionHistoryResponse.md b/docs/models/operations/GetSessionHistoryResponse.md index 91d2b0ca..3024f595 100644 --- a/docs/models/operations/GetSessionHistoryResponse.md +++ b/docs/models/operations/GetSessionHistoryResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetSessionHistoryResponseBody.md) | :heavy_minus_sign: | List of Plex Sessions | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetSessionHistoryResponseBody.md) | :heavy_minus_sign: | List of Plex Sessions | \ No newline at end of file diff --git a/docs/models/operations/GetSessionsResponse.md b/docs/models/operations/GetSessionsResponse.md index 8d8db17c..cd44edb3 100644 --- a/docs/models/operations/GetSessionsResponse.md +++ b/docs/models/operations/GetSessionsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetSessionsResponseBody.md) | :heavy_minus_sign: | List of Active Plex Sessions | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetSessionsResponseBody.md) | :heavy_minus_sign: | List of Active Plex Sessions | \ No newline at end of file diff --git a/docs/models/operations/GetSourceConnectionInformationResponse.md b/docs/models/operations/GetSourceConnectionInformationResponse.md index 6df63616..d09b6ffc 100644 --- a/docs/models/operations/GetSourceConnectionInformationResponse.md +++ b/docs/models/operations/GetSourceConnectionInformationResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetStatisticsResponse.md b/docs/models/operations/GetStatisticsResponse.md index 25ae449f..bfa84344 100644 --- a/docs/models/operations/GetStatisticsResponse.md +++ b/docs/models/operations/GetStatisticsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetStatisticsResponseBody.md) | :heavy_minus_sign: | Media Statistics | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetStatisticsResponseBody.md) | :heavy_minus_sign: | Media Statistics | \ No newline at end of file diff --git a/docs/models/operations/GetThumbImageResponse.md b/docs/models/operations/GetThumbImageResponse.md index 993de0fb..97cbff58 100644 --- a/docs/models/operations/GetThumbImageResponse.md +++ b/docs/models/operations/GetThumbImageResponse.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `responseStream` | *Optional\* | :heavy_minus_sign: | Successful response returning an image | -| `headers` | Map\> | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `responseStream` | *Optional\* | :heavy_minus_sign: | Successful response returning an image | +| `headers` | Map\> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetTimelineResponse.md b/docs/models/operations/GetTimelineResponse.md index 458a4b95..0477ed6b 100644 --- a/docs/models/operations/GetTimelineResponse.md +++ b/docs/models/operations/GetTimelineResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetTokenByPinIdResponse.md b/docs/models/operations/GetTokenByPinIdResponse.md index 48897bf2..09c5254e 100644 --- a/docs/models/operations/GetTokenByPinIdResponse.md +++ b/docs/models/operations/GetTokenByPinIdResponse.md @@ -7,5 +7,5 @@ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | | | `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | | `authPinContainer` | [Optional\](../../models/operations/GetTokenByPinIdAuthPinContainer.md) | :heavy_minus_sign: | The Pin with a non-null authToken when it has been verified by the user | {
"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
} | \ No newline at end of file diff --git a/docs/models/operations/GetTokenDetailsResponse.md b/docs/models/operations/GetTokenDetailsResponse.md index ffeaaf65..d03a20b3 100644 --- a/docs/models/operations/GetTokenDetailsResponse.md +++ b/docs/models/operations/GetTokenDetailsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `userPlexAccount` | [Optional\](../../models/operations/GetTokenDetailsUserPlexAccount.md) | :heavy_minus_sign: | Logged in user details | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `userPlexAccount` | [Optional\](../../models/operations/GetTokenDetailsUserPlexAccount.md) | :heavy_minus_sign: | Logged in user details | \ No newline at end of file diff --git a/docs/models/operations/GetTopWatchedContentResponse.md b/docs/models/operations/GetTopWatchedContentResponse.md index b19943cb..2f05219a 100644 --- a/docs/models/operations/GetTopWatchedContentResponse.md +++ b/docs/models/operations/GetTopWatchedContentResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetTopWatchedContentResponseBody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetTopWatchedContentResponseBody.md) | :heavy_minus_sign: | The metadata of the library item. | \ No newline at end of file diff --git a/docs/models/operations/GetTranscodeSessionsResponse.md b/docs/models/operations/GetTranscodeSessionsResponse.md index 5f8a434c..dadf7131 100644 --- a/docs/models/operations/GetTranscodeSessionsResponse.md +++ b/docs/models/operations/GetTranscodeSessionsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetTranscodeSessionsResponseBody.md) | :heavy_minus_sign: | The Transcode Sessions | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetTranscodeSessionsResponseBody.md) | :heavy_minus_sign: | The Transcode Sessions | \ No newline at end of file diff --git a/docs/models/operations/GetTransientTokenResponse.md b/docs/models/operations/GetTransientTokenResponse.md index bea1df0d..5e21f966 100644 --- a/docs/models/operations/GetTransientTokenResponse.md +++ b/docs/models/operations/GetTransientTokenResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/GetUpdateStatusResponse.md b/docs/models/operations/GetUpdateStatusResponse.md index 8374f5b1..b4966490 100644 --- a/docs/models/operations/GetUpdateStatusResponse.md +++ b/docs/models/operations/GetUpdateStatusResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetUpdateStatusResponseBody.md) | :heavy_minus_sign: | The Server Updates | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetUpdateStatusResponseBody.md) | :heavy_minus_sign: | The Server Updates | \ No newline at end of file diff --git a/docs/models/operations/GetUserFriendsResponse.md b/docs/models/operations/GetUserFriendsResponse.md index f284375e..6da1e1d1 100644 --- a/docs/models/operations/GetUserFriendsResponse.md +++ b/docs/models/operations/GetUserFriendsResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `friends` | List\<[Friend](../../models/operations/Friend.md)> | :heavy_minus_sign: | Friends Data | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `friends` | List\<[Friend](../../models/operations/Friend.md)> | :heavy_minus_sign: | Friends Data | \ No newline at end of file diff --git a/docs/models/operations/GetUsersResponse.md b/docs/models/operations/GetUsersResponse.md index 8196229f..6b665d9e 100644 --- a/docs/models/operations/GetUsersResponse.md +++ b/docs/models/operations/GetUsersResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `body` | *Optional\* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `body` | *Optional\* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/GetWatchListResponse.md b/docs/models/operations/GetWatchListResponse.md index 9205e451..6c5b262d 100644 --- a/docs/models/operations/GetWatchListResponse.md +++ b/docs/models/operations/GetWatchListResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [Optional\](../../models/operations/GetWatchListResponseBody.md) | :heavy_minus_sign: | Watchlist Data | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [Optional\](../../models/operations/GetWatchListResponseBody.md) | :heavy_minus_sign: | Watchlist Data | \ No newline at end of file diff --git a/docs/models/operations/LogLineResponse.md b/docs/models/operations/LogLineResponse.md index c427c86a..d9de99aa 100644 --- a/docs/models/operations/LogLineResponse.md +++ b/docs/models/operations/LogLineResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/LogMultiLineResponse.md b/docs/models/operations/LogMultiLineResponse.md index f03b3909..d9e7ea1e 100644 --- a/docs/models/operations/LogMultiLineResponse.md +++ b/docs/models/operations/LogMultiLineResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/MarkPlayedResponse.md b/docs/models/operations/MarkPlayedResponse.md index 0ecda0b5..2499dbce 100644 --- a/docs/models/operations/MarkPlayedResponse.md +++ b/docs/models/operations/MarkPlayedResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/MarkUnplayedResponse.md b/docs/models/operations/MarkUnplayedResponse.md index 4cdcd1ce..b5085297 100644 --- a/docs/models/operations/MarkUnplayedResponse.md +++ b/docs/models/operations/MarkUnplayedResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/PerformSearchResponse.md b/docs/models/operations/PerformSearchResponse.md index b05f13a9..cc31e564 100644 --- a/docs/models/operations/PerformSearchResponse.md +++ b/docs/models/operations/PerformSearchResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/PerformVoiceSearchResponse.md b/docs/models/operations/PerformVoiceSearchResponse.md index 67d56ba3..7890f601 100644 --- a/docs/models/operations/PerformVoiceSearchResponse.md +++ b/docs/models/operations/PerformVoiceSearchResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/PostMediaArtsRequest.md b/docs/models/operations/PostMediaArtsRequest.md index 40e52dfc..afd20296 100644 --- a/docs/models/operations/PostMediaArtsRequest.md +++ b/docs/models/operations/PostMediaArtsRequest.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 | | `url` | *Optional\* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b | -| `requestBody` | *Optional\* | :heavy_minus_sign: | The contents of the image, if uploading a local file | | \ No newline at end of file +| `requestBody` | byte[] | :heavy_minus_sign: | The contents of the image, if uploading a local file | | \ No newline at end of file diff --git a/docs/models/operations/PostMediaArtsResponse.md b/docs/models/operations/PostMediaArtsResponse.md index 9130b281..fa119ecf 100644 --- a/docs/models/operations/PostMediaArtsResponse.md +++ b/docs/models/operations/PostMediaArtsResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/PostMediaPosterRequest.md b/docs/models/operations/PostMediaPosterRequest.md index 3d1e8875..168e5001 100644 --- a/docs/models/operations/PostMediaPosterRequest.md +++ b/docs/models/operations/PostMediaPosterRequest.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 | | `url` | *Optional\* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b | -| `requestBody` | *Optional\* | :heavy_minus_sign: | The contents of the image, if uploading a local file | | \ No newline at end of file +| `requestBody` | byte[] | :heavy_minus_sign: | The contents of the image, if uploading a local file | | \ No newline at end of file diff --git a/docs/models/operations/PostMediaPosterResponse.md b/docs/models/operations/PostMediaPosterResponse.md index c8c49616..c71d141a 100644 --- a/docs/models/operations/PostMediaPosterResponse.md +++ b/docs/models/operations/PostMediaPosterResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/PostUsersSignInDataResponse.md b/docs/models/operations/PostUsersSignInDataResponse.md index 39990042..44687333 100644 --- a/docs/models/operations/PostUsersSignInDataResponse.md +++ b/docs/models/operations/PostUsersSignInDataResponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `userPlexAccount` | [Optional\](../../models/operations/PostUsersSignInDataUserPlexAccount.md) | :heavy_minus_sign: | Returns the user account data with a valid auth token | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `userPlexAccount` | [Optional\](../../models/operations/PostUsersSignInDataUserPlexAccount.md) | :heavy_minus_sign: | Returns the user account data with a valid auth token | \ No newline at end of file diff --git a/docs/models/operations/StartAllTasksResponse.md b/docs/models/operations/StartAllTasksResponse.md index 1312eb11..53f3dc64 100644 --- a/docs/models/operations/StartAllTasksResponse.md +++ b/docs/models/operations/StartAllTasksResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/StartTaskResponse.md b/docs/models/operations/StartTaskResponse.md index 0ef721f1..6ced7b49 100644 --- a/docs/models/operations/StartTaskResponse.md +++ b/docs/models/operations/StartTaskResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/StartUniversalTranscodeResponse.md b/docs/models/operations/StartUniversalTranscodeResponse.md index 7376657f..d3e781b2 100644 --- a/docs/models/operations/StartUniversalTranscodeResponse.md +++ b/docs/models/operations/StartUniversalTranscodeResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/StopAllTasksResponse.md b/docs/models/operations/StopAllTasksResponse.md index 7fea7f56..c26d9a28 100644 --- a/docs/models/operations/StopAllTasksResponse.md +++ b/docs/models/operations/StopAllTasksResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/StopTaskResponse.md b/docs/models/operations/StopTaskResponse.md index 244c1a22..b0907627 100644 --- a/docs/models/operations/StopTaskResponse.md +++ b/docs/models/operations/StopTaskResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/StopTranscodeSessionResponse.md b/docs/models/operations/StopTranscodeSessionResponse.md index ff4b44e8..4688cfd6 100644 --- a/docs/models/operations/StopTranscodeSessionResponse.md +++ b/docs/models/operations/StopTranscodeSessionResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/UpdatePlayProgressResponse.md b/docs/models/operations/UpdatePlayProgressResponse.md index bcc7d4cf..11506da7 100644 --- a/docs/models/operations/UpdatePlayProgressResponse.md +++ b/docs/models/operations/UpdatePlayProgressResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/UpdatePlaylistResponse.md b/docs/models/operations/UpdatePlaylistResponse.md index ade6e7ba..b6ef9d9a 100644 --- a/docs/models/operations/UpdatePlaylistResponse.md +++ b/docs/models/operations/UpdatePlaylistResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/UploadPlaylistResponse.md b/docs/models/operations/UploadPlaylistResponse.md index 338aa8ad..ed9ca7e7 100644 --- a/docs/models/operations/UploadPlaylistResponse.md +++ b/docs/models/operations/UploadPlaylistResponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `contentType` | *String* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [HttpResponse\](https://docs.oracle.com/en/java/javase/11/docs/api/java.net.http/java/net/http/HttpResponse.html) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index ca99e95d..3dbfc439 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -23,6 +23,7 @@ Get Server Activities ### Example Usage + ```java package hello.world; @@ -37,7 +38,7 @@ public class Application { public static void main(String[] args) throws GetServerActivitiesBadRequest, GetServerActivitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerActivitiesResponse res = sdk.activities().getServerActivities() @@ -68,6 +69,7 @@ Cancel Server Activities ### Example Usage + ```java package hello.world; @@ -82,7 +84,7 @@ public class Application { public static void main(String[] args) throws CancelServerActivitiesBadRequest, CancelServerActivitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); CancelServerActivitiesResponse res = sdk.activities().cancelServerActivities() diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index 6c4c7deb..4e3b1ffe 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -20,6 +20,7 @@ This endpoint provides the caller with a temporary token with the same access le ### Example Usage + ```java package hello.world; @@ -34,7 +35,7 @@ public class Application { public static void main(String[] args) throws GetTransientTokenBadRequest, GetTransientTokenUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTransientTokenResponse res = sdk.authentication().getTransientToken() @@ -74,6 +75,7 @@ Note: requires Plex Media Server >= 1.15.4. ### Example Usage + ```java package hello.world; @@ -88,7 +90,7 @@ public class Application { public static void main(String[] args) throws GetSourceConnectionInformationBadRequest, GetSourceConnectionInformationUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSourceConnectionInformationResponse res = sdk.authentication().getSourceConnectionInformation() @@ -124,6 +126,7 @@ Get the User data from the provided X-Plex-Token ### Example Usage + ```java package hello.world; @@ -138,7 +141,7 @@ public class Application { public static void main(String[] args) throws GetTokenDetailsBadRequest, GetTokenDetailsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTokenDetailsResponse res = sdk.authentication().getTokenDetails() @@ -175,6 +178,7 @@ Sign in user with username and password and return user data with Plex authentic ### Example Usage + ```java package hello.world; diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index e24c4105..d4122d6b 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -20,6 +20,7 @@ Returns a list of butler tasks ### Example Usage + ```java package hello.world; @@ -34,7 +35,7 @@ public class Application { public static void main(String[] args) throws GetButlerTasksBadRequest, GetButlerTasksUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetButlerTasksResponse res = sdk.butler().getButlerTasks() @@ -70,6 +71,7 @@ This endpoint will attempt to start all Butler tasks that are enabled in the set ### Example Usage + ```java package hello.world; @@ -84,7 +86,7 @@ public class Application { public static void main(String[] args) throws StartAllTasksBadRequest, StartAllTasksUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StartAllTasksResponse res = sdk.butler().startAllTasks() @@ -114,6 +116,7 @@ This endpoint will stop all currently running tasks and remove any scheduled tas ### Example Usage + ```java package hello.world; @@ -128,7 +131,7 @@ public class Application { public static void main(String[] args) throws StopAllTasksBadRequest, StopAllTasksUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StopAllTasksResponse res = sdk.butler().stopAllTasks() @@ -162,6 +165,7 @@ This endpoint will attempt to start a single Butler task that is enabled in the ### Example Usage + ```java package hello.world; @@ -177,7 +181,7 @@ public class Application { public static void main(String[] args) throws StartTaskBadRequest, StartTaskUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StartTaskResponse res = sdk.butler().startTask() @@ -214,6 +218,7 @@ This endpoint will stop a currently running task by name, or remove it from the ### Example Usage + ```java package hello.world; @@ -229,7 +234,7 @@ public class Application { public static void main(String[] args) throws StopTaskBadRequest, StopTaskUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StopTaskResponse res = sdk.butler().stopTask() diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index 47f0a6cc..def847d5 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -18,6 +18,7 @@ Get Global Hubs filtered by the parameters provided. ### Example Usage + ```java package hello.world; @@ -32,7 +33,7 @@ public class Application { public static void main(String[] args) throws GetGlobalHubsBadRequest, GetGlobalHubsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetGlobalHubsResponse res = sdk.hubs().getGlobalHubs() @@ -71,6 +72,7 @@ This endpoint will return the recently added content. ### Example Usage + ```java package hello.world; @@ -83,7 +85,7 @@ public class Application { public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetRecentlyAddedRequest req = GetRecentlyAddedRequest.builder() @@ -127,6 +129,7 @@ This endpoint will return a list of library specific hubs ### Example Usage + ```java package hello.world; @@ -141,7 +144,7 @@ public class Application { public static void main(String[] args) throws GetLibraryHubsBadRequest, GetLibraryHubsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetLibraryHubsResponse res = sdk.hubs().getLibraryHubs() diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index 09a263be..e897eef0 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -35,6 +35,7 @@ This resource returns hash values for local files ### Example Usage + ```java package hello.world; @@ -49,11 +50,11 @@ public class Application { public static void main(String[] args) throws GetFileHashBadRequest, GetFileHashUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetFileHashResponse res = sdk.library().getFileHash() - .url("file://C:\Image.png&type=13") + .url("file://C:\\Image.png&type=13") .call(); // handle response @@ -87,6 +88,7 @@ This endpoint will return the recently added content. ### Example Usage + ```java package hello.world; @@ -102,7 +104,7 @@ public class Application { public static void main(String[] args) throws GetRecentlyAddedLibraryBadRequest, GetRecentlyAddedLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetRecentlyAddedLibraryRequest req = GetRecentlyAddedLibraryRequest.builder() @@ -166,6 +168,7 @@ This allows a client to provide a rich interface around the media (e.g. allow so ### Example Usage + ```java package hello.world; @@ -180,7 +183,7 @@ public class Application { public static void main(String[] args) throws GetAllLibrariesBadRequest, GetAllLibrariesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetAllLibrariesResponse res = sdk.library().getAllLibraries() @@ -250,6 +253,7 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi ### Example Usage + ```java package hello.world; @@ -265,7 +269,7 @@ public class Application { public static void main(String[] args) throws GetLibraryDetailsBadRequest, GetLibraryDetailsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetLibraryDetailsResponse res = sdk.library().getLibraryDetails() @@ -305,6 +309,7 @@ Delete a library using a specific section id ### Example Usage + ```java package hello.world; @@ -319,7 +324,7 @@ public class Application { public static void main(String[] args) throws DeleteLibraryBadRequest, DeleteLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); DeleteLibraryResponse res = sdk.library().deleteLibrary() @@ -376,6 +381,7 @@ Fetches details from a specific section of the library identified by a section k ### Example Usage + ```java package hello.world; @@ -390,7 +396,7 @@ public class Application { public static void main(String[] args) throws GetLibraryItemsBadRequest, GetLibraryItemsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetLibraryItemsRequest req = GetLibraryItemsRequest.builder() @@ -437,6 +443,7 @@ Retrieves a list of all general media data for this library. ### Example Usage + ```java package hello.world; @@ -451,7 +458,7 @@ public class Application { public static void main(String[] args) throws GetLibrarySectionsAllBadRequest, GetLibrarySectionsAllUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetLibrarySectionsAllRequest req = GetLibrarySectionsAllRequest.builder() @@ -500,6 +507,7 @@ This endpoint Refreshes all the Metadata of the library. ### Example Usage + ```java package hello.world; @@ -515,7 +523,7 @@ public class Application { public static void main(String[] args) throws GetRefreshLibraryMetadataBadRequest, GetRefreshLibraryMetadataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetRefreshLibraryMetadataResponse res = sdk.library().getRefreshLibraryMetadata() @@ -571,6 +579,7 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi ### Example Usage + ```java package hello.world; @@ -586,7 +595,7 @@ public class Application { public static void main(String[] args) throws GetSearchLibraryBadRequest, GetSearchLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSearchLibraryResponse res = sdk.library().getSearchLibrary() @@ -627,6 +636,7 @@ Retrieves a list of all the genres that are found for the media in this library. ### Example Usage + ```java package hello.world; @@ -642,7 +652,7 @@ public class Application { public static void main(String[] args) throws GetGenresLibraryBadRequest, GetGenresLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetGenresLibraryResponse res = sdk.library().getGenresLibrary() @@ -683,6 +693,7 @@ Retrieves a list of all the countries that are found for the media in this libra ### Example Usage + ```java package hello.world; @@ -698,7 +709,7 @@ public class Application { public static void main(String[] args) throws GetCountriesLibraryBadRequest, GetCountriesLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetCountriesLibraryResponse res = sdk.library().getCountriesLibrary() @@ -739,6 +750,7 @@ Retrieves a list of all the actors that are found for the media in this library. ### Example Usage + ```java package hello.world; @@ -754,7 +766,7 @@ public class Application { public static void main(String[] args) throws GetActorsLibraryBadRequest, GetActorsLibraryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetActorsLibraryResponse res = sdk.library().getActorsLibrary() @@ -795,6 +807,7 @@ Search the provided query across all library sections, or a single section, and ### Example Usage + ```java package hello.world; @@ -810,7 +823,7 @@ public class Application { public static void main(String[] args) throws GetSearchAllLibrariesBadRequest, GetSearchAllLibrariesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSearchAllLibrariesRequest req = GetSearchAllLibrariesRequest.builder() @@ -859,6 +872,7 @@ Multiple rating keys can be provided as a comma-separated list (e.g., "21119,216 ### Example Usage + ```java package hello.world; @@ -874,7 +888,7 @@ public class Application { public static void main(String[] args) throws GetMediaMetaDataBadRequest, GetMediaMetaDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMediaMetaDataRequest req = GetMediaMetaDataRequest.builder() @@ -929,6 +943,7 @@ Returns the background artwork for a library item. ### Example Usage + ```java package hello.world; @@ -941,7 +956,7 @@ public class Application { public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMediaArtsResponse res = sdk.library().getMediaArts() @@ -977,6 +992,7 @@ Uploads an image to use as the background artwork for a library item, either fro ### Example Usage + ```java package hello.world; @@ -989,7 +1005,7 @@ public class Application { public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); PostMediaArtsResponse res = sdk.library().postMediaArts() @@ -997,7 +1013,6 @@ public class Application { .url("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b") .call(); - // handle response } } ``` @@ -1008,7 +1023,7 @@ public class Application { | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 | | `url` | *Optional\* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b | -| `requestBody` | *Optional\* | :heavy_minus_sign: | The contents of the image, if uploading a local file | | +| `requestBody` | byte[] | :heavy_minus_sign: | The contents of the image, if uploading a local file | | ### Response @@ -1026,6 +1041,7 @@ Returns the available posters for a library item. ### Example Usage + ```java package hello.world; @@ -1038,7 +1054,7 @@ public class Application { public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMediaPostersResponse res = sdk.library().getMediaPosters() @@ -1074,6 +1090,7 @@ Uploads a poster to a library item, either from a local file or a remote URL ### Example Usage + ```java package hello.world; @@ -1086,7 +1103,7 @@ public class Application { public static void main(String[] args) throws Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); PostMediaPosterResponse res = sdk.library().postMediaPoster() @@ -1094,7 +1111,6 @@ public class Application { .url("https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b") .call(); - // handle response } } ``` @@ -1105,7 +1121,7 @@ public class Application { | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `ratingKey` | *long* | :heavy_check_mark: | the id of the library item to return the posters of. | 2268 | | `url` | *Optional\* | :heavy_minus_sign: | The URL of the image, if uploading a remote image | https://api.mediux.pro/assets/fcfdc487-dd07-4993-a0c1-0a3015362e5b | -| `requestBody` | *Optional\* | :heavy_minus_sign: | The contents of the image, if uploading a local file | | +| `requestBody` | byte[] | :heavy_minus_sign: | The contents of the image, if uploading a local file | | ### Response @@ -1124,6 +1140,7 @@ This endpoint will return the children of of a library item specified with the r ### Example Usage + ```java package hello.world; @@ -1138,7 +1155,7 @@ public class Application { public static void main(String[] args) throws GetMetadataChildrenBadRequest, GetMetadataChildrenUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMetadataChildrenResponse res = sdk.library().getMetadataChildren() @@ -1179,6 +1196,7 @@ This endpoint will return the top watched content from libraries of a certain ty ### Example Usage + ```java package hello.world; @@ -1193,7 +1211,7 @@ public class Application { public static void main(String[] args) throws GetTopWatchedContentBadRequest, GetTopWatchedContentUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTopWatchedContentResponse res = sdk.library().getTopWatchedContent() diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index 056cd329..1b651bbb 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -19,6 +19,7 @@ This endpoint will write a single-line log message, including a level and source ### Example Usage + ```java package hello.world; @@ -34,7 +35,7 @@ public class Application { public static void main(String[] args) throws LogLineBadRequest, LogLineUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); LogLineResponse res = sdk.log().logLine() @@ -95,6 +96,7 @@ Ensure each parameter is properly URL-encoded to avoid interpretation issues. ### Example Usage + ```java package hello.world; @@ -110,7 +112,7 @@ public class Application { public static void main(String[] args) throws LogMultiLineBadRequest, LogMultiLineUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); String req = "level=4&message=Test%20message%201&source=postman\nlevel=3&message=Test%20message%202&source=postman\nlevel=1&message=Test%20message%203&source=postman"; @@ -149,6 +151,7 @@ This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail ### Example Usage + ```java package hello.world; @@ -163,7 +166,7 @@ public class Application { public static void main(String[] args) throws EnablePaperTrailBadRequest, EnablePaperTrailUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); EnablePaperTrailResponse res = sdk.log().enablePaperTrail() diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index f0057e69..27f10d27 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -20,6 +20,7 @@ This will mark the provided media key as Played. ### Example Usage + ```java package hello.world; @@ -34,11 +35,11 @@ public class Application { public static void main(String[] args) throws MarkPlayedBadRequest, MarkPlayedUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); MarkPlayedResponse res = sdk.media().markPlayed() - .key(59398) + .key(59398d) .call(); // handle response @@ -70,6 +71,7 @@ This will mark the provided media key as Unplayed. ### Example Usage + ```java package hello.world; @@ -84,11 +86,11 @@ public class Application { public static void main(String[] args) throws MarkUnplayedBadRequest, MarkUnplayedUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); MarkUnplayedResponse res = sdk.media().markUnplayed() - .key(59398) + .key(59398d) .call(); // handle response @@ -121,6 +123,7 @@ This API command can be used to update the play progress of a media item. ### Example Usage + ```java package hello.world; @@ -135,12 +138,12 @@ public class Application { public static void main(String[] args) throws UpdatePlayProgressBadRequest, UpdatePlayProgressUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); UpdatePlayProgressResponse res = sdk.media().updatePlayProgress() .key("") - .time(90000) + .time(90000d) .state("played") .call(); @@ -175,6 +178,7 @@ Gets the banner image of the media item ### Example Usage + ```java package hello.world; @@ -190,7 +194,7 @@ public class Application { public static void main(String[] args) throws GetBannerImageBadRequest, GetBannerImageUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetBannerImageRequest req = GetBannerImageRequest.builder() @@ -237,6 +241,7 @@ Gets the thumbnail image of the media item ### Example Usage + ```java package hello.world; @@ -252,7 +257,7 @@ public class Application { public static void main(String[] args) throws GetThumbImageBadRequest, GetThumbImageUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetThumbImageRequest req = GetThumbImageRequest.builder() diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index 297b3f34..3857b2de 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -30,6 +30,7 @@ Create a new playlist. By default the playlist is blank. To create a playlist al ### Example Usage + ```java package hello.world; @@ -44,7 +45,7 @@ public class Application { public static void main(String[] args) throws CreatePlaylistBadRequest, CreatePlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); CreatePlaylistRequest req = CreatePlaylistRequest.builder() @@ -89,6 +90,7 @@ Get All Playlists given the specified filters. ### Example Usage + ```java package hello.world; @@ -103,7 +105,7 @@ public class Application { public static void main(String[] args) throws GetPlaylistsBadRequest, GetPlaylistsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetPlaylistsResponse res = sdk.playlists().getPlaylists() @@ -143,6 +145,7 @@ Smart playlist details contain the `content` attribute. This is the content URI ### Example Usage + ```java package hello.world; @@ -157,7 +160,7 @@ public class Application { public static void main(String[] args) throws GetPlaylistBadRequest, GetPlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetPlaylistResponse res = sdk.playlists().getPlaylist() @@ -196,6 +199,7 @@ This endpoint will delete a playlist ### Example Usage + ```java package hello.world; @@ -210,7 +214,7 @@ public class Application { public static void main(String[] args) throws DeletePlaylistBadRequest, DeletePlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); DeletePlaylistResponse res = sdk.playlists().deletePlaylist() @@ -247,6 +251,7 @@ From PMS version 1.9.1 clients can also edit playlist metadata using this endpoi ### Example Usage + ```java package hello.world; @@ -261,7 +266,7 @@ public class Application { public static void main(String[] args) throws UpdatePlaylistBadRequest, UpdatePlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); UpdatePlaylistResponse res = sdk.playlists().updatePlaylist() @@ -303,6 +308,7 @@ Note that for dumb playlists, items have a `playlistItemID` attribute which is u ### Example Usage + ```java package hello.world; @@ -318,7 +324,7 @@ public class Application { public static void main(String[] args) throws GetPlaylistContentsBadRequest, GetPlaylistContentsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetPlaylistContentsResponse res = sdk.playlists().getPlaylistContents() @@ -359,6 +365,7 @@ Clears a playlist, only works with dumb playlists. Returns the playlist. ### Example Usage + ```java package hello.world; @@ -373,7 +380,7 @@ public class Application { public static void main(String[] args) throws ClearPlaylistContentsBadRequest, ClearPlaylistContentsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); ClearPlaylistContentsResponse res = sdk.playlists().clearPlaylistContents() @@ -411,6 +418,7 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the ### Example Usage + ```java package hello.world; @@ -425,13 +433,13 @@ public class Application { public static void main(String[] args) throws AddPlaylistContentsBadRequest, AddPlaylistContentsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); AddPlaylistContentsResponse res = sdk.playlists().addPlaylistContents() .playlistID(7013.44) .uri("server://12345/com.plexapp.plugins.library/library/metadata/1") - .playQueueID(123) + .playQueueID(123d) .call(); if (res.object().isPresent()) { @@ -468,6 +476,7 @@ Imports m3u playlists by passing a path on the server to scan for m3u-formatted ### Example Usage + ```java package hello.world; @@ -483,7 +492,7 @@ public class Application { public static void main(String[] args) throws UploadPlaylistBadRequest, UploadPlaylistUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); UploadPlaylistResponse res = sdk.playlists().uploadPlaylist() diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index f1412602..fed5cd76 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -22,6 +22,7 @@ Get Companions Data ### Example Usage + ```java package hello.world; @@ -36,7 +37,7 @@ public class Application { public static void main(String[] args) throws GetCompanionsDataBadRequest, GetCompanionsDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetCompanionsDataResponse res = sdk.plex().getCompanionsData() @@ -73,6 +74,7 @@ Get friends of provided auth token. ### Example Usage + ```java package hello.world; @@ -87,7 +89,7 @@ public class Application { public static void main(String[] args) throws GetUserFriendsBadRequest, GetUserFriendsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetUserFriendsResponse res = sdk.plex().getUserFriends() @@ -124,6 +126,7 @@ Returns the geolocation and locale data of the caller ### Example Usage + ```java package hello.world; @@ -174,6 +177,7 @@ Retrieves the home data for the authenticated user, including details like home ### Example Usage + ```java package hello.world; @@ -188,7 +192,7 @@ public class Application { public static void main(String[] args) throws GetHomeDataBadRequest, GetHomeDataUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetHomeDataResponse res = sdk.plex().getHomeData() @@ -219,6 +223,7 @@ Get Plex server access tokens and server connections ### Example Usage + ```java package hello.world; @@ -233,7 +238,7 @@ public class Application { public static void main(String[] args) throws GetServerResourcesBadRequest, GetServerResourcesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerResourcesResponse res = sdk.plex().getServerResources() @@ -278,6 +283,7 @@ Retrieve a Pin ID from Plex.tv to use for authentication flows ### Example Usage + ```java package hello.world; @@ -337,6 +343,7 @@ Retrieve an Access Token from Plex.tv after the Pin has been authenticated ### Example Usage + ```java package hello.world; diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 88dd3f2a..637d6a4d 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -30,6 +30,7 @@ This request is intended to be very fast, and called as the user types. ### Example Usage + ```java package hello.world; @@ -44,12 +45,12 @@ public class Application { public static void main(String[] args) throws PerformSearchBadRequest, PerformSearchUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); PerformSearchResponse res = sdk.search().performSearch() .query("arnold") - .limit(5) + .limit(5d) .call(); // handle response @@ -87,6 +88,7 @@ Results, as well as their containing per-type hubs, contain a `distance` attribu ### Example Usage + ```java package hello.world; @@ -101,12 +103,12 @@ public class Application { public static void main(String[] args) throws PerformVoiceSearchBadRequest, PerformVoiceSearchUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); PerformVoiceSearchResponse res = sdk.search().performVoiceSearch() .query("dead+poop") - .limit(5) + .limit(5d) .call(); // handle response @@ -140,6 +142,7 @@ This will search the database for the string provided. ### Example Usage + ```java package hello.world; @@ -154,7 +157,7 @@ public class Application { public static void main(String[] args) throws GetSearchResultsBadRequest, GetSearchResultsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSearchResultsResponse res = sdk.search().getSearchResults() diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index be685243..80db1c4e 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -24,6 +24,7 @@ Get Server Capabilities ### Example Usage + ```java package hello.world; @@ -38,7 +39,7 @@ public class Application { public static void main(String[] args) throws GetServerCapabilitiesBadRequest, GetServerCapabilitiesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerCapabilitiesResponse res = sdk.server().getServerCapabilities() @@ -69,6 +70,7 @@ Get Server Preferences ### Example Usage + ```java package hello.world; @@ -83,7 +85,7 @@ public class Application { public static void main(String[] args) throws GetServerPreferencesBadRequest, GetServerPreferencesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerPreferencesResponse res = sdk.server().getServerPreferences() @@ -114,6 +116,7 @@ Get Available Clients ### Example Usage + ```java package hello.world; @@ -128,7 +131,7 @@ public class Application { public static void main(String[] args) throws GetAvailableClientsBadRequest, GetAvailableClientsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetAvailableClientsResponse res = sdk.server().getAvailableClients() @@ -159,6 +162,7 @@ Get Devices ### Example Usage + ```java package hello.world; @@ -173,7 +177,7 @@ public class Application { public static void main(String[] args) throws GetDevicesBadRequest, GetDevicesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetDevicesResponse res = sdk.server().getDevices() @@ -204,6 +208,7 @@ This request is useful to determine if the server is online or offline ### Example Usage + ```java package hello.world; @@ -246,6 +251,7 @@ Returns MyPlex Account Information ### Example Usage + ```java package hello.world; @@ -260,7 +266,7 @@ public class Application { public static void main(String[] args) throws GetMyPlexAccountBadRequest, GetMyPlexAccountUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMyPlexAccountResponse res = sdk.server().getMyPlexAccount() @@ -292,6 +298,7 @@ Plex's Photo transcoder is used throughout the service to serve images at specif ### Example Usage + ```java package hello.world; @@ -306,14 +313,14 @@ public class Application { public static void main(String[] args) throws GetResizedPhotoBadRequest, GetResizedPhotoUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetResizedPhotoRequest req = GetResizedPhotoRequest.builder() - .width(110) - .height(165) + .width(110d) + .height(165d) .opacity(100L) - .blur(0) + .blur(0d) .minSize(MinSize.ZERO) .upscale(Upscale.ZERO) .url("/library/metadata/49564/thumb/1654258204") @@ -352,6 +359,7 @@ Retrieves media providers and their features from the Plex server. ### Example Usage + ```java package hello.world; @@ -366,7 +374,7 @@ public class Application { public static void main(String[] args) throws GetMediaProvidersBadRequest, GetMediaProvidersUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetMediaProvidersResponse res = sdk.server().getMediaProviders() @@ -404,6 +412,7 @@ Get Server List ### Example Usage + ```java package hello.world; @@ -418,7 +427,7 @@ public class Application { public static void main(String[] args) throws GetServerListBadRequest, GetServerListUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetServerListResponse res = sdk.server().getServerList() diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index eec92f07..586a4d03 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -19,6 +19,7 @@ This will retrieve the "Now Playing" Information of the PMS. ### Example Usage + ```java package hello.world; @@ -33,7 +34,7 @@ public class Application { public static void main(String[] args) throws GetSessionsBadRequest, GetSessionsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSessionsResponse res = sdk.sessions().getSessions() @@ -64,6 +65,7 @@ This will Retrieve a listing of all history views. ### Example Usage + ```java package hello.world; @@ -79,7 +81,7 @@ public class Application { public static void main(String[] args) throws GetSessionHistoryBadRequest, GetSessionHistoryUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetSessionHistoryResponse res = sdk.sessions().getSessionHistory() @@ -124,6 +126,7 @@ Get Transcode Sessions ### Example Usage + ```java package hello.world; @@ -138,7 +141,7 @@ public class Application { public static void main(String[] args) throws GetTranscodeSessionsBadRequest, GetTranscodeSessionsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTranscodeSessionsResponse res = sdk.sessions().getTranscodeSessions() @@ -169,6 +172,7 @@ Stop a Transcode Session ### Example Usage + ```java package hello.world; @@ -183,7 +187,7 @@ public class Application { public static void main(String[] args) throws StopTranscodeSessionBadRequest, StopTranscodeSessionUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StopTranscodeSessionResponse res = sdk.sessions().stopTranscodeSession() diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index 071d0a74..150fa7e9 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -18,6 +18,7 @@ This will return the media statistics for the server ### Example Usage + ```java package hello.world; @@ -32,7 +33,7 @@ public class Application { public static void main(String[] args) throws GetStatisticsBadRequest, GetStatisticsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetStatisticsResponse res = sdk.statistics().getStatistics() @@ -70,6 +71,7 @@ This will return the resources for the server ### Example Usage + ```java package hello.world; @@ -84,7 +86,7 @@ public class Application { public static void main(String[] args) throws GetResourcesStatisticsBadRequest, GetResourcesStatisticsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetResourcesStatisticsResponse res = sdk.statistics().getResourcesStatistics() @@ -122,6 +124,7 @@ This will return the bandwidth statistics for the server ### Example Usage + ```java package hello.world; @@ -136,7 +139,7 @@ public class Application { public static void main(String[] args) throws GetBandwidthStatisticsBadRequest, GetBandwidthStatisticsUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetBandwidthStatisticsResponse res = sdk.statistics().getBandwidthStatistics() diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index a9c37caf..d5ce88f8 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -19,6 +19,7 @@ Querying status of updates ### Example Usage + ```java package hello.world; @@ -33,7 +34,7 @@ public class Application { public static void main(String[] args) throws GetUpdateStatusBadRequest, GetUpdateStatusUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetUpdateStatusResponse res = sdk.updater().getUpdateStatus() @@ -64,6 +65,7 @@ Checking for updates ### Example Usage + ```java package hello.world; @@ -79,7 +81,7 @@ public class Application { public static void main(String[] args) throws CheckForUpdatesBadRequest, CheckForUpdatesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); CheckForUpdatesResponse res = sdk.updater().checkForUpdates() @@ -116,6 +118,7 @@ Note that these two parameters are effectively mutually exclusive. The `tonight` ### Example Usage + ```java package hello.world; @@ -130,7 +133,7 @@ public class Application { public static void main(String[] args) throws ApplyUpdatesBadRequest, ApplyUpdatesUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); ApplyUpdatesResponse res = sdk.updater().applyUpdates() diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index 2c75fe31..74785c52 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -13,6 +13,7 @@ Get list of all users that are friends and have library access with the provided ### Example Usage + ```java package hello.world; diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 9f024a20..2eec475c 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -17,6 +17,7 @@ Get the timeline for a media item ### Example Usage + ```java package hello.world; @@ -31,20 +32,20 @@ public class Application { public static void main(String[] args) throws GetTimelineBadRequest, GetTimelineUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetTimelineRequest req = GetTimelineRequest.builder() - .ratingKey(23409) + .ratingKey(23409d) .key("/library/metadata/23409") .state(State.PLAYING) - .hasMDE(1) - .time(2000) - .duration(10000) + .hasMDE(1d) + .time(2000d) + .duration(10000d) .context("home:hub.continueWatching") - .playQueueItemID(1) - .playBackTime(2000) - .row(1) + .playQueueItemID(1d) + .playBackTime(2000d) + .row(1d) .build(); GetTimelineResponse res = sdk.video().getTimeline() @@ -80,6 +81,7 @@ Begin a Universal Transcode Session ### Example Usage + ```java package hello.world; @@ -95,26 +97,26 @@ public class Application { public static void main(String[] args) throws StartUniversalTranscodeBadRequest, StartUniversalTranscodeUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); StartUniversalTranscodeRequest req = StartUniversalTranscodeRequest.builder() - .hasMDE(1) + .hasMDE(1d) .path("/library/metadata/23409") - .mediaIndex(0) - .partIndex(0) + .mediaIndex(0d) + .partIndex(0d) .protocol("hls") - .fastSeek(0) - .directPlay(0) - .directStream(0) - .subtitleSize(100) + .fastSeek(0d) + .directPlay(0d) + .directStream(0d) + .subtitleSize(100d) .subtites("burn") - .audioBoost(100) + .audioBoost(100d) .location("lan") - .mediaBufferSize(102400) + .mediaBufferSize(102400d) .session("zvcage8b7rkioqcm8f4uns4c") - .addDebugOverlay(0) - .autoAdjustQuality(0) + .addDebugOverlay(0d) + .autoAdjustQuality(0d) .build(); StartUniversalTranscodeResponse res = sdk.video().startUniversalTranscode() diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index 999b97d7..6de6bf7b 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -16,6 +16,7 @@ Get User Watchlist ### Example Usage + ```java package hello.world; @@ -30,7 +31,7 @@ public class Application { public static void main(String[] args) throws GetWatchListBadRequest, GetWatchListUnauthorized, Exception { PlexAPI sdk = PlexAPI.builder() - .accessToken("") + .accessToken(System.getenv().getOrDefault("ACCESS_TOKEN", "")) .build(); GetWatchListRequest req = GetWatchListRequest.builder() diff --git a/docs/utils/Blob.md b/docs/utils/Blob.md new file mode 100644 index 00000000..aa620e86 --- /dev/null +++ b/docs/utils/Blob.md @@ -0,0 +1,195 @@ +# Blob Utility Class + +The [`Blob`](../../src/main/java/dev/plexapi/sdk/utils/Blob.java) utility class is a powerful tool for both sending and reading data in the SDK. It implements `HttpRequest.BodyPublisher` for sending data in HTTP requests and provides consumption methods for reading data streams. The class offers a reactive, memory-efficient approach to working with various data sources. + +## Key Benefits + +- **Dual Purpose**: Supports both sending data (via `HttpRequest.BodyPublisher`) and reading data (via consumption methods) +- **Memory Efficiency**: Streams data instead of loading entire files into memory, preventing out-of-memory errors with large files +- **Reactive Processing**: Built on Java's reactive streams (`Flow.Publisher`) for streaming+NIO operations +- **Versatile Input Sources**: Supports multiple data sources with convenient factory methods +- **HTTP Native**: Implements `HttpRequest.BodyPublisher` for seamless integration with HTTP requests +- **Single-Use Safety**: Prevents accidental reuse of consumed instances with clear error handling + +## Factory Methods + +The [`Blob`](../../src/main/java/dev/plexapi/sdk/utils/Blob.java) class provides factory methods for various input sources: + +| Factory Method | Use Case | Memory | Underlying I/O | +|---|---|---|---| +| `Blob.from(Path)` | Large files, documents | 🟢 Streaming | Non-blocking (NIO) | +| `Blob.from(InputStream)` | Network streams, legacy APIs | 🟢 Streaming | Blocking (offloaded to threads) | +| `Blob.from(String)` | Text data, JSON | 🟡 In-memory | N/A (in-memory) | +| `Blob.from(byte[])` | Binary data, images | 🟡 In-memory | N/A (in-memory) | +| `Blob.from(ByteBuffer)` | NIO buffers | 🟡 In-memory | N/A (in-memory) | +| `Blob.from(List)` | Chunked data | 🟡 In-memory | N/A (in-memory) | +| `Blob.from(Flow.Publisher>)` | Reactive streams | 🟢 Streaming | Non-blocking (NIO) | + +## Retry Compatibility + +When using blobs in HTTP requests that may be retried, it's important to understand which blob types support retries effectively: + +| Factory Method | Retry Support | Notes | +|---|---|---| +| `Blob.from(Path)` | ✅ **Full Support** | File can be re-read for each retry attempt | +| `Blob.from(String)` | ✅ **Full Support** | Immutable data can be resent | +| `Blob.from(byte[])` | ✅ **Full Support** | In-memory data can be resent | +| `Blob.from(ByteBuffer)` | ✅ **Full Support** | Uses `duplicate()` to preserve original | +| `Blob.from(List)` | ✅ **Full Support** | Uses `duplicate()` to preserve originals | +| `Blob.from(Flow.Publisher>)` | ⚠️ **Depends on Publisher** | Stateful publishers may lose data on re-subscription | +| `Blob.from(InputStream)` | ❌ **Limited Support** | Stream gets consumed on first attempt | + +**Important**: InputStream-backed blobs and some Flow.Publisher-backed blobs do not support retries effectively. InputStreams get consumed during the first HTTP request attempt, and stateful publishers may lose data on re-subscription, causing subsequent retry attempts to send empty or incomplete request bodies. For retry-compatible scenarios, prefer file-based (`Blob.from(Path)`) or in-memory alternatives (`Blob.from(byte[])`). + +### File-Based Sources + +#### `Blob.from(Path path)` +Creates a Blob from a file path. **Recommended for large files** as it uses streaming+NIO. + +```java +Blob fileBlob = Blob.from(Paths.get("large-document.pdf")); +``` + +#### `Blob.from(InputStream inputStream)` +Creates a Blob from an InputStream that streams without buffering the whole payload; reading is blocking (performed on background threads if used asynchronously). + +```java +FileInputStream fis = new FileInputStream("data.json"); +Blob streamBlob = Blob.from(fis); +``` + +### In-Memory Sources + +#### `Blob.from(String string)` +Creates a Blob from a String using UTF-8 encoding. + +```java +Blob textBlob = Blob.from("Hello, World!"); +``` + +#### `Blob.from(byte[] data)` +Creates a Blob from a byte array. + +```java +byte[] imageData = loadImageBytes(); +Blob imageBlob = Blob.from(imageData); +``` + +### Buffer-Based Sources + +#### `Blob.from(ByteBuffer buffer)` +Creates a Blob from a single ByteBuffer. + +```java +ByteBuffer buffer = ByteBuffer.allocate(1024); +// ... populate buffer +Blob bufferBlob = Blob.from(buffer); +``` + +#### `Blob.from(List buffers)` +Creates a Blob from multiple ByteBuffers. + +```java +List buffers = Arrays.asList(buffer1, buffer2, buffer3); +Blob multiBufferBlob = Blob.from(buffers); +``` + +### Reactive Sources + +#### `Blob.from(Flow.Publisher> sourcePublisher)` +Creates a Blob from a reactive publisher that provides data as lists of ByteBuffers. + +```java +Flow.Publisher> publisher = createReactiveSource(); +Blob reactiveBlob = Blob.from(publisher); +``` + +## Consumption Methods + +The [`Blob`](../../src/main/java/dev/plexapi/sdk/utils/Blob.java) class provides four methods for reading/consuming the data. All consumption methods use NIO and are safe to use in asynchronous contexts: + +### `asPublisher()` +Returns a `Flow.Publisher` for reactive processing. + +```java +Blob blob = Blob.from(Paths.get("data.txt")); +Flow.Publisher publisher = blob.asPublisher(); + +// Use with your preferred reactive library or custom subscriber +publisher.subscribe(myCustomSubscriber); +``` + +**Illustrative Project Reactor Integration** *(Note: The SDK uses native Java reactive streams and doesn't depend on Project Reactor)*: + +```java +// Convert to Reactor Flux for advanced reactive operations +Flux flux = Flux.from(blob.asPublisher()); + +// Transform and process the stream +Flux textChunks = flux + .map(buffer -> StandardCharsets.UTF_8.decode(buffer).toString()) + .filter(text -> !text.trim().isEmpty()) + .doOnNext(chunk -> System.out.println("Processing: " + chunk)); +``` + +### `toByteArray()` +Collects the entire stream into a byte array asynchronously. + +```java +Blob blob = Blob.from(Paths.get("small-file.txt")); +CompletableFuture future = blob.toByteArray(); + +// Basic usage with CompletableFuture +future.thenAccept(data -> { + System.out.println("Received " + data.length + " bytes"); + // Process the complete data + processData(data); +}).exceptionally(throwable -> { + System.err.println("Failed to read data: " + throwable.getMessage()); + return null; +}); +``` + +### `toInputStream()` +Converts the entire stream into an `InputStream` for traditional I/O operations. + +```java +Blob blob = Blob.from(Paths.get("data.txt")); +CompletableFuture future = blob.toInputStream(); + +// Basic usage with CompletableFuture +future.thenAccept(inputStream -> { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { + String line; + while ((line = reader.readLine()) != null) { + System.out.println("Read line: " + line); + } + } catch (IOException e) { + System.err.println("Error reading from InputStream: " + e.getMessage()); + } +}).exceptionally(throwable -> { + System.err.println("Failed to create InputStream: " + throwable.getMessage()); + return null; +}); +``` + +### `toFile(Path destinationPath)` +Writes the stream directly to a file asynchronously. + +```java +Blob blob = Blob.from(inputStream); +CompletableFuture future = blob.toFile(Paths.get("output.dat")); + +// Basic file writing with error handling +future.thenAccept(path -> { + System.out.println("Successfully written to: " + path); + // Verify file was created + if (Files.exists(path)) { + System.out.println("File size: " + Files.size(path) + " bytes"); + } +}).exceptionally(throwable -> { + System.err.println("Failed to write file: " + throwable.getMessage()); + return null; +}); + +``` diff --git a/gradle.properties b/gradle.properties index 68cb4b13..d4317d78 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,4 @@ groupId=dev.plexapi artifactId=plexapi -version=0.17.1 \ No newline at end of file +version=0.18.0 +org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd4917707c1f8861d8cb53dd15194d4248596..1b33c55baabb587c669f562ae36f953de2481846 100644 GIT binary patch delta 34753 zcmXuJV|<-$^ZlL1Y~1X)v28cD(bzT{XNNoH4jMPMZQHh;G`62!_wWC_Ki{06wbslW z-hNv;bUS>4$$AIV1w{GYSbDa9HY10D}fyEl=S$4U=kIo7=?lBvitGLsWgUt3{^aFT@HAUZCsI-`}|0=Lu@cG;zc@Palo^sRPZGG5llUR0<`~PGM!~n zkm6B^u;0*XF-c2rRb5+vPU03ZQ5KZdzzTpUoTLdSw^Mg7d&C_SBf8d z<*%@>RYEa%3xvhKQ2+fgWH0mDnV{(?DOFM#5cbZvWlTUnUQ)s@i>v1Y5?qfhhUDR06ltpPtiHl^K$(Pwy};( zt0}s?0BR`|nU@5F~DUSX9)ut`4x49n}R zR^l{2LOA=m`mDpSR`_FjyMVQ&w;`V{m`N`(x2+ddDsnd|wIx+%1gmXz?F%zVZNlam zr^+Gd{gTO(b$1`z|fZ_Ov=jMJULx1p0EN=aBKXm=pY z->4oBN;{|ieu&?4UQ8-lsl}lINU#I4sY)kLD*2_EY)1qQEuBuv?1OvD9OX)4ZFGko zNY1cj!@*^`YR&yqgQJ}!%k1aTRf>lFTs5qf4%{52h+a+UOB0A6OX-5?8ssn&$ArX*;bHjO311(M-=LEkLFKnxXu-2SVtV3^h+$LjIVBrkLr6yUK}j zU&BC4W51wuu{g|fxlHAA_xpUlM(Tz{M9z+h(bo_JaM+(CS>elq)VX9p*iR@+d-3>E zbEvk$uQDEip@A7~{OlEaM(3gOLO}N9({&{A5limEDf~kGp<)KcNgbqE_%hm}H?O%{ zOS1KYLw<%3S6!N5=K|3-IFXRV$Ok$X)FawLhObevqK3#X=F@7)9v5DLJ;;fwzp$DF zlpFb*+VP$QQ+_3pc5KsPS$h=_AvDZ{g@oe0;K~Tl*wx`)OIZR;rL-*2V1apFBtMYs zvytk?nV6Azw|vNb0dH_kb1+LGp31ui3H4A}bjX?4PKt{*Elfe~HyB!d+(E~M z6&4j%CIb|-3h*MDxaDThnd0Z(E70#f5#`{82a+R|Z8^Ze%O z)*=1lB*QAle%YE*F*`Q<>krEdo7`QU&<{*(vg@0Pequ9zJqu{zQJkgnbMMWgjN6Pc z@0Y!!A|?n4r=XpM+avc{#Rbx(lwds-Dm7na`I1%>brkR`$iyaD6@%P8gr=FwvaVM^ zz6#!Vq)aP|7g#eaub4k?tySlt&IXA;AZIQ{EFi1N^{NA`F;64EqSeLEDX1O;F$CKz znWu-Iy~J?GeQJK?Iq8drKHHkFUpe%oNIn-l4UbJ z;dB?+c~A@&AEKx~dw$lgsbR_q+0o6vsIW%6+(&fB2PU*n`I6)$q}OsZj>Sc|M13rL4ugI_j2sIyiPDco2SXuyXSOmq zoJv~;19Pa@b#GDFe1p7`wDc!vxP$x7xx>hi_0k(D2uv&)k+O{p1!i;xBt;%+P&>{U34C) zJ~t!_6~pG3W*nyY{c`&HtE4LNA3sr`(F5NghTF`xtZNmC@}C9A8zW40nFu-9S9R$5dWnHM(S%nBiI4g4tU~@X@>JDz;3qcDyF?y+m0;!M;g>TO>r(@L@pz>UJd5acWYqdC$#%aQ{<@A^FCac*B$Zn9`QC$)*jWh zAe%J4RP{VlYU=B{clOr%2E*3p^T84X=iVnW6R|*R)%nBppESXKd4_o+8PpKc9AJIY z#0lv1G#Ph78;`1G0;Q5S<7=ooRT|OZiKv3$S@3G8THj8*5+mkBX-hGq53>DQBTdIM z>ukeX#Dl13-}eBvatW>(DlWFxk(P>d+=Lj%wVXDo&BfM&28Pn>`002&W{~0R=$e&Z zw7nx}jDZhxY`N6@N^^DEWJ80q449^!!GEr97rK`6m!(3vj*H6wH6g#ORaeB{=(c*}S@<{$Fx*@K%MW_Zw z#t+V1JkJYe`fy@3$$8Dqg=ozpyD}4}4X2RaUmNoqgvdkbhk%E_Ig>;y>%d;C3k!Jm zbNh>w8UF!cDb3#MVi8@8WEM4!=ZI)w`XNMIBxQq0>+%HUAnof1CS2k9a4vCBRAj%7 z)F7lT{U&41X#KbXA9%`n&g|Iw2A5rp4UovgRo@UVJo7RZ56A*NzreW`$(f>;3HWTEHBX$@vb^bYcxCwwSgW!Pi2 zMKY#iEOJnvD>juOyCCErp0k&{^~3%7M^9;W2VD$(ADPkmcD9gbmSk^h8J)be%G8pl z%Zvqv54FfMAaAmc^d?98*nD}@ik3g!Whjv}WVHB{nr97fhNF^36qsCr)yiZY=P=-) zYqsZQVPb>w3xg^@L7isnr`qr%3N}2=QbG;V5+bF0cArs=b$jhPrWnpHvQFz%kmL;g z1$E&8ZKYQjT`3PCCdqkDf24w%T~jFWuW&M0Y4=|d%N;%{Ssy{Zq>9oYyShV)9KNqc zw~=w}*r2_8_IM@_MqtK9Dd}Lq_m^vfz_gu`Hzr3cfNmGAZPL9f^eE@B%b=>HWi33X=Rx!H9cTYw#9K7ac zhp?Q%h6sE!C)EK~To9ux>MVl`UIzv;ODnw1H}hvD8vHs8XCN}ps~E4IiMU#%j0U8c z1$WLNd?HHGx2C`ZHG^ODM!^x02_w}xvyRj_BivCn-zA*zQ^!Gd+>n=lB1Tr$b9S%9 z6?m4(aVBGT6}~($(te0|uwJ0ony-&J&O{-U$Tl17tIzSG1m)C}^cyvq0fIID($8?C z?&k3F`-fV^@d97$bO-Z{Ss8~+8n^@12jb7PUe*q!L4@J$JE!c3MQ5wZ5-k%<9uNHT z*m-U18hT^qn%d=n%j69h9`QH&EKH@WB1A@^lq*se;m^%}xi}}}*V8Ku{X%Xzj0~O7 zIT|nQDuj+DTx+(*q$w1o^bwD_qw9)Vk*j7OzOX$=aUhC%P*WncxP>Q^eJLh4ZvTQu zN^_IvA|46v77o%rx8Qe5-}prxxlKtw5utBK^@flecS{M@Kh-1^1^I^01>L5%m&J5M zbA_50igDI5Hctl_AG7L5I;hT_E~UM<=Ew)D!~BHqKLE1iUpRwR;l8TL8=Y9uE1swJ zj$T1)Gy&xd$;t?x2ohfm@976>1Ia!3<0Ao)%(Pp6~;Xk_G&p?N42y0NOYmVPvbiY zbIBCvHbVxRG5x}-CYKsKZt27tQ+d%82=6qBQv~J-VP}b)s%dto{%T7UL5rbqZu8eI z&#h`8%6YA++UAw8=)KQXSyI_1hg2t4;6qGMnNjZ0Jn3Y44IsZgNu}qwNFQ|5`<)xh zMIfaXx$F&%qRvGHMVRk{$5pTjrP}OCaH8gY?_O+!%&wtG$~K)4A*M=)2L#DOg$c&>Z8&>Ws2tC+2;2H`t8daf86AL7P}ho48-x}JzWxx(EGIresP z&Do4}moP~-9^of^^Ap3KWGwumBqAp6Ff^nYWl#g% zrR@6_WA+3!wt~oByHGFe-O*Nhyy#i{g7jb0yY#=vScipxF#ZbhuL(jyV?n^fgU=)| zz*pE5;Jj>dV5X{_;+zteA0rf^PJDnuKUaO=FQ$$4`4;~f>Y0AiK=hz^2loxVlKLju zH3k+5zp$P9#cmbW8@5az~ zpw}0}u6^&dP`*J@z6H496Br_qtR9P|B@C&zr3rSBjcoVbfy0V?i@vFF?z4>SeDFhz zBI!7|_fh4qA?#6l^eHobZa)u;I9X0|n{sQh<&r+(d4$?w5~>UGC+BKYK1KDlq1(?< zVxCk2@+Np2Vhob^<>QnwuiF!i2*7(t8AU%m+FFG^;$ECmp$|K-MV%?$uF=ja%_%YG z86(ck{qCk0T|98m3H;;NoVuSnm+s(^{gZ&PVpIdL@Qb0V@6R!6V7oG-!VdfOM+o&W zdjA2*J-bqk|11cgZmFgoi$kdZF0461#4T-(NuoYPv6jeqk9*c^#8vTH ze{yT(K(34T&O2%h{!C~h2%zOK$Y~p6#+iUTr?kwL042Uiv_4lS)CWMBG}yYQ6!^k}NaH$BgZ0B_Q?52e4LBdvQ$RnziXs9M4sATcVPn zlV#b9$TXcGeBnp(uHZ1NsL)ir+~RN}4~F7iQ2ujWzkd&({J-aL3V2(B5FCd~0q!Q_ z2SN{u50hI;Inw_ie+tQP3ste?b6zFsA4a|AdJ;xS5yJ%f3ynVgf;vbpmsjx4di2bG zbl!Y;%qH%Fh%yS;xg8nNe#uKadg*jTJdG;7ES6ShT7@ed5U4x0{8jTEKBX699ouyM zptA51(RYhsrINRTNKfq z%2|X$flIl%9zLF_}MNTtrZExbq(Uv*U zuD3dA#>ttySc|-|Gz;!UlT=GNLO4;1=#vWhW3(@^M~6!dFe&B=ZnAVr0hZcE4pfVr|J6m)hgWX?k=f`FiS)xuQafjM^d&~xzBtOTvIF! z&zN&MqNc6g>q|fxfqZq@OOhKq@{nILm636s&QU*FGP(`^^LGI>F4^)wf6Ku95BD5W zN&7mQpL=;9J?$6GHd{Gg?_+74w3HNkvf z4?;<(9|Um-AoRPJ=+pL*r^BJA`NhTO2bBNUa^@!&-}gLk?0#L{T!p~%AIO3CKlZgq zu-#dgjFPFO+J!^bNyA0$MOnn0tj5M+*MLx!^p$Ypc;@Z!1&?7(jhx~~bO&h{s_%c) zBH;PI3eY{Mv00DzDWg^TFhk;% zSb2x*qR#Rq6^hn1*|QZ8w{A_Q-Per>OOd}ZJ%vd|oU!wUGbuIm&I9HS~ z0`7C}eqZ>ie%Tft$29x?DnOqcB33rbnVzXFg{${~McUkN9yewe@+_}@iH9u<65=rQ zvu+hqx=W5jSE$#8Vx@Z~?{NV(a3a=$=8_(J|aQ1@SHf(3v6!3Mgi=qX|fV+n}b=$u+xeJT5sODCh# z%0BRq*$GPRVxmLBs_GBBy0_~6ejonZ$RzO*`tikpBOt+Y_rF$n*+}76Z=SHiXK}&f za=G%lceHc~v1r8X!_T+o&_1WL&X1i{;BacLQ*~N+2^+H?zvm4)(+PB>$luQSGxik~ z1z1NmK39DPdNEHQQ&PL{=F}wuD3s5vE*GbtO;P{ksC+uFOoR?5w4Xnr=3l!GR*JE} zT*ai#Z-RFy7tpf-Bp;t#vKb<;Ky{VLU5~~G_FN_D)nPZ~7pKma*u7Sc3D|@tJ~ShS zXm6tIrlIC)az&H(jU!xMr|oCyt=VP51KDKA2I96y&8h#sbrPsF0#rVJ1O^_(9EmXj zG-UQX_oSZVOl1#5QI?#@BH8V&hYh{(mYDNM_@WSzQ-_IJ0f#aN(%5pi60l7lwC|-k zYo<~FC+rZ1%;G*~p`7}gcn}P|xf7f_Zp7zi*I(XQ4BF_|&m2@;wm)%E`dDBUJ^^sit=I^+MB za4Hg6C>k0VuhSg5uhL0oFxb?P{a?fiWYE6{{{IP&X-}7ePeR>c;wHK8hP%t79VAhT zBOOS1H$RNtT4n=&zI#IZqdfI)Upze2yX{Hp>gL3}+ZnjN7c$AMrbHag9)IUxQCZIw z$s&mt$b!iY-KE9PPX%^u9MJX^ZYc&PK0=+a=T=m>)znD0G~PRR@hL?>YQ@5x?dK}w zOVq1SVG-s|6n`7gu@PF-7LF4Ae57ZFO^U(Q3=k?1ft5D_GuQBI01zqqpumN?Lv|{> zJDj3zFUXl0N5{h9!siL7p2f`yy?e(P;upfH!k#~^Q!iPl7lHUkx6DYywA;cV!X+PN zPWl137E3CAge1}{Z_SsyJ%%ltA5}{u8+-0}ILM_EU1M#(V6B25q9hSzw~Bd)n$=+sc_oinJ+t9) zcg7##ez&>%OmNNIn!L~%8Oi-5oG>&i7v@AcC8O`QG|b<3L>G*$P1dJVlN3CU=S>yo zMN;yC{4eY;slO2`zy=J#U(mt(4Aek;a;v90Hh1&MR5q8#kC*p7Du2&$Rv$rb59N>I zpDhhkkU9qQ6?PrPIynX|0z_>_hEF*R)Qlli9^}+5ePn&B=!^Plk7T}1>E7|wryN69 zo)eDPl5R#ulWASD4YfXjTb15KFu8>G<1@<8G5GK#8{Ij_opI>*xgIU9MQT7!+nOri z=@*mX@=!Oc@S#d7z(wdR3*m^J;_u|6G`gJ2+wMxVITuDUk|F~bZ{a6K%`%#kp_=>O zL!|%0>LdAt+iVX~%hv^|6p#tyyM~kW6!bA`t{l9s-+65RKC4Olt>U{VL?7gr)-qz! zbd8z+8i3z?Eead|nq9-z^9<}i;sPYJ6g{J$yf^L|GN1Jsk7dA*gWEvto|;#0{f&qKP8-5&U`3v17UoT(fq zq3}-DC=Y$UyHwiN8-WU%Xt{5plMz4{~A%(N}R zK)Z$Rx8*@?g>I>1u#LEZ&IygKgRFa|g5rnx7TExzfX4E=t>K+k5Eh5y>p6PV5=s;u zM9@lN+#e@PXJdTpKnxi)4B-Fhp@Fjuh3mhTKLq|BO%MLW#s)_-V*qt9C9(X5pt<_% zrPOTcPdOJbAW2}b(BCYhG-=|#3)_jwhHj8(E&mZ>}}rn^ZDvT|LPg+vnH z@wdRUiav~9mU0X&oZ!7#Ez`@()ALis6JwGOX6QjQ z#$^sk%%8}r|9ZKqObS6|I%!3!1h36c+VxqM8pNv|u$x=dlla7ghfIHvf>V62aU z#w_G=*s67q<$o1)$_utN3P-?${T9kA#p5j9(_K33}7Ci_l}Eag-SVCY;F zAvGwP!5O5^vpD*7d@+t|qO|76(X_K9aS3jpj~6z^b=QDL?nT{X_w`p{`s(zq8Qzn_4BW${2v$-#z^$ z@<;A|S^XN%hMF;T!kziatx2FYn6t0Q{RV{E$L#e!Ti#pVGeH%@Pj;k#dV-m^^nnS- zky`9goDP^&zcRp5g7Qt_)6YiLtr*wwhZ}I#vuASE%|2WFN6gt0LhBc;-b2GM{ksA$|h*QDev6OXYCWA-=fY;KS|g}8|R+Q z$GAWWbapmp#a(*#dpd&v1ZC8W#SA(CC@tVu6iAdE)i(AKCfG6D)rJmUO7-YVle2Pt zFy4@d+!uT~j7l{~YEst@(x`G`cYf<(>;aqUVp+3_M;%Gkp^^pqj%kATA}W}tm~M}p*ZKhm0f`-H=$X1jC>)^@wp=`>ljUcxli*FcOr&6#rs&>ZIFuw z+f1{Xhqm#vn~SyqAX6!LR%Ew3nw|V8BWP^s>8)7(jEf)2tOypS8Q9dgP>}b9kiY`_ z4sjPZD@75hL2>kJSXh_~JCOg5ljOavq$~f->`es-DBMHM7%5|d+%tKJK?xvNnSixZ zwrhPw%nd{NH;4vpm9{8yx-_9lreb7IOKFF1P0@R#y%t>L1YQBXp?1(&;PfLPk!h@PD23s@(M}V2 zu7Xr+vL&BoLZ?9{brAqW2GV$$%~I{OYhH@Pcmhn)%q(7e*|kCC@vA~lWz!9 z#!3@A*(0|%JQ*snp;`Ryv*3Fks`Lc;6pS~url3qAQTfa2t*1-%rZn%>{{&( zh7z~44+D1&naQajqQ$l~&>gkrhkvvOq2rw-`Q{J$iC0u+=RsmVVE@hHT%J%@=+iwC z2?y_(N|B)UTs-Y!?HTs^6;o$71IV>p+5S|wJeA=d+L^rBFKmJ#jqE9hId@l?%QsRn z)-RS|ch91MRaB%UniYw?GkXzwfN=ZG#kPWY8-t+)O7{=N#v^9_-vOn8?lGamzaXShqF)_i<_n#~-R3sXc0lYl5naZoz+c*x|YK=<=CX7PLC7 zYhe{_n24AQINyWrZFhU=Tg41Q zSV|ENA}Od*2rpMKF_$zYoHFig0XAw?xYnbmbH?p!~(dPBp zSP_cjXeA7@Tf696aBHpfm3N;85sXX^vw!8=fKzD+^$d89XNTblh<;FGa<=Pru{ki& zX?qJsDdJstPW@q}<$Y8cf%uK?N(o!@b?DNlB@kP!jM~KLi%T)Wxc*g#CG*u&EQ~d# z-D#jb=Dc5%D6%W|cUPq_>ropeDC?XYB`LCtsKeq+0CK zp%vXMvrI^wG9E@NV}7n~@KT3(mHt_n+ffO^ppumt6mA%uGCjaL75QE1MuGl~dO@U+ z|DnzF#=&u;jlpxWZ%=|zK?=$Y^p5(>`)HB{`j|QoC7p&H1mc!PxQi3HWK#8e8yB{m zFV40UC#@*vpe}D3!_p#4=P}@(`Ph${XJGd zre=Pg)B*cJ2lzo#>qTVt1p4N8@vHrZ)CqfmJ|~MTw%MrciKSe|TlKMgfw=LX!D>FN z7tr{N$ms;FkDS`}PMiBC6ybm$8P8{kteGF-US{p#M2yW1H~$C#dU z!OFsOsTHe2JNu&`BNyDeTsI?d-FiKn)uWZ#-?tyf&5X=Z?rf=!6OQJg`X8%r9{ax* zeG#H{AI)-gqGzSDU$bYLbq28ClzKehhL!B6?TnX~^2c0!9XiE*|h^C_rVW-2Fzv~b64L@)dVylfa8Eo6uyYzS7I&QX@FF0iF$67sZU>39X zPP;-Xvyb_ty(~v9)rO=D5So-EGz}?gV{-0bmEit8WD>FjcH8H*DmNP*}BuwFN@H4R6exG)B7h2-Z07xeb)>>1ttSs>VT04 z>DtpGa2pmc8*Cl3K(QuZC>Lbc%#%}}VURdLubgefpxhVd<9`)v0+<;T`mbU^{U2au z7E%QM2UW>J25M>H2QE<;Qvx?C4areBIt}IInDOw~eKQmsnxN|H(pOeG0na2Kh*>hE z;Z>9$)O++W9G1J};1L0rNrA_4pU>+9I)9XMW*Fw* z{_ax;jj^o6crW$C=#^G|$Um~gh9vmBubi+4Et>gDy2AMNjvgnics6gv`JvvX?CJDX|)tvskx#sajOaEV$=!x0PDaWf1n z*L-iE084|KZ=eCp`Bs}~7JH(-NdRgLo}|TTf-i!q(Eq^spt|y5?>}Ah{!dp6VJTo7 zj`Vh`V>MaT&#$Dl82w+!75?4w?D{v?51rq0*VUD!*6@74A@PC2Vf^m24fRAVw)W)< zMv9f2o4VV?_#?4F*B9)Q6C8dB|_NkF( zBXZ)EtxGD+pUYV@fzGm(!v<02HcU+jC#`_+Af6H7Y$RNi`kiBBm}fEx zhCfMYXb?H5|2BPEtoGXd<*EsV3b`-3DLgh2?WNI8>1wA`pB?p-Y$Ys_IUStAS$~5r z|D&_~!m)|@k~W{;)^>{VgeUfU7hkxwV^?f$k3BKeA^&mEPh{O4t=oxL5x7H5ilnaO0j#`IYm zQS5p*(>4s?oKC$5)Z$D%iD79LLvv^_iU-oDO{;1(ak2v+X|}eSjn!$SkIu&;BU_7kmc| z4~5mFD1FF%`rF(htmEvPBGXcwHppb0(cL@f*v=<*-Jd!L1-!E<#@nz?PpA?~V88zE zQ?)7aCHFijEvKQ! z?m8C8x}b520(rYywU+^%>moPIQC+xmC`4`?1XQI&U1fjny>jfohoZV=beBi8bq2)h zS1Nwk^iN2QlC1b?RHb;i$63NeT}QQL_^GT1?>`TJh5Es;*evyxu6W z)zVz__cn>y3H2mFPpoBqPk>2uOLPQD-OybMGtkUy0YN4XXlFIVEdtjAda`#59n+3k zMqWS!t~S`OG=wlnx>Y8J6NV3GY8jKtXpMa%BV{YDl?nItD_0Idgo!jrq7U zR(tN|fMUA{>JxNV*?>YEkKg#dZvve(AHjWHc}X*D4}bI4^9&K$bhZlZFMHPebR{0` z-F1@gFx3#aGUY%0omtW;fwbwHeJ6VK=7+Q=N7QC>ZQSmW@WB4%djlma?Cc%zmUCTf zwxL`P>H@sCYu+IxI*ed@6_P^-FvJ1M>g4ZQXfom%N&S3OHb!6dxqW9zDDb0!KeCcsU4RnMcCFA%0 z@q+S0$Q*a`{G4H6%kpe}8RM4>{!A1~#ZR^j+sXQ73*KMkXZg?r1=Y~*FcfU-(LeyM zk!{O!d0Dir;}~{_HY4H4jc)&)cR4D`J??u@aMJbMOLV)La`(iQ6fr|cCZ`=qzEu%T zD?`4lE>^50T<*1$jIE7BkRkGDEjR`An}wkV&CQfIIho%qd^u*nB_poJ%3`RIAnQ~= zaq?_qq&)?_(E@MX#S}sv*)H8D9XMpWGcfARfh>Pfc@|Euu0l11#VESBjxKnas$rXT zB!O!^D7SVuh^u{9t81B*qk>vds`Q5z{*S&mT0=vz1evI$wnyZ;n>#@&ZEm3*tLsTl zOIPa$3h5!`X*Ie2L5OT%_T`}^q?eP?2&h#yE{~S+&%%;xe9kLB_Lq7#H6RlsL%S5~ zx*(G@9OKe1MrC4H0h^vyTAoskW(3*?Ugc{pFYf%V90V8c>05yGkPGsVv84b*V{>K< zgLkKDu`o_6wq^6cw0>6RXu5{X^vI_2pS&!EN%yc!DT6-9ERyC(*(5xT&Q)ST1{C3Ypt6HoF`8 zqv|ls^lKDV=!JOc$S@8UU^?iE^IqAs8-O#dfmt%#p8lY$ zDa#j#PwNN1Ov4AI5E-vg$1iroPWJ+wy(5tJSi`{VX;*lGmD?ML97s|ImR9WPPnc^& zpCKvd4>(ZY!Jit|>A#Be^-)tq#-!3%a~;9n?ZkrJbMIsff5SQ;lm2g;@rr+Pbog(Z zfe!QkpM`->B(T7tGCV-O4SSN6#(;wQ7?PZpUvq2h0U}_15;&6dd`5=Fk&7|&w2f3V zb56JHpp%MD&CGcbUk-I zcJBEuy>6OJ2|Y3UyK#>>?r-;G4MJf<$+-Tusfj3zI5rgb6;}f)7S0D7m$ZJ9J7rOD z4Weo`cGf0P88>tdlMJ13oh`S-Q^TOFs*)NAlBU2`3yBJlPhXT+vdiy~Fo^*&XG)>< z5U2#&ARK7xE^u?HF(}NV+yBmwJdVz}&lxm~id9>u4`A`=^I8qNA+!!;E1!<`5M5U? zM%ZMwrY^za!fOPcsv zNe|~SJ9Y|6HxISe*2P5r`OSFPs(gJAF3GibbZ5h5IYi1OqZ3>&5|unE4?^Oz#h*(~ zvpiN)sXu{?*2!ySSudk($!Y{>;`fOw>ycGy?s!6;mfix%GjuE~N60Q!#z`bSR`_$_ z{G3OyOAEDi01;(2FTR?f1ATgNp1xX)VV*c?5H4zQ@s6xRZ?yQwk9 zL{Il9+?y-zxMxl5qev$wfv=z+U$A5ntGSY{r(8}#tiStr z^9b1g(#p<7t%ViJ-Cg}Vj1QS2D?jK7&EzV?h`+K@3mP;u-|c{|ht=crR7$0L?YXjJ8uV57+qRXB-hJ>Zi!-_kwY#e2n;Z+vr za7f49jiyb#c0~E-n4L=%t~6_|ATy|QJu=7x=Ds>LXwt|RTThd+sg^^GXhe2ROUEvt zYOq3oJ#Z=R2gNrVWjPMswr>FI!+l@D#hFqYycU1X1a8(<9#d*>si7|pzujnfYwm#C zzf^d<-J6WlToDGy+v6FtTL>7eIM6W%KFygfu$IKa4QGv!dmu|#yR^)oX*3-M)`G*D zRB?*!^*r|Y`Um@VE%H^C|ZipnZ%iqR6Kt=I5YumUk$PdA+(D4G&R_@7UYNuKopV|K8&N3$rEI$ zzxOj6MGpXOGNOc1kpd(wYguW~=_Rv0`*%^jj#9mF0Laf8u-6qyDNLH)VFq>8qEM7~ z2X{oQ5-viYn`p;KqfW2yKI)Meh9IN!qyEmYi5l4vbOR;zF_BLKBDmeggb?ToV0nTz z-|+C1#Y%;9T#tN>A2HXE!jcYiy_Ux(&-iYF#OihR{oZtkK7Cl}-hg#zQ{q%GB((ka zV4s?{>A^1snOky-2kD|dcV}MCgPjGK{PR>Q27}HXI83Y&SV>5l7i2-YNwBcmR9uZBv zY(?BhO_rmw=v4>Yf5aECOmutQZ_>BQzwP(9m%u3Bp5?Ia7bayAmCymJ1grRz@^2rn z>v6XFPyzPCZkEanFo!$A0|cp@b~AK%SUUVrCde26Lfb6|YPJxV66D4C5esGHZl8-O2a zcB&GUgIeR&%6V|rzkec`&W{tka=q!14+>ev*cbGFbHMUScPjuxtsi4Q@-NQvALdZy zA(>;*&}iw zyBo3jLgOmrl3<)<^zwp`Io;%q*!pm#%5SNY=hp!7d^SP%xVkN`$1AE0L*G9vIfs(V zYdP|Dsmscv|8DSwmz~C#*t|Q{E0}oaci3aJS;y|BB@NBQ_cUN~K9aibwbDN_1c#I9 zb3{9eNe%z$%A5giN?E{i*^X=%$X6og%3mPErps8Lo&JQ?{o?+|6yvn!!3tUOZDdtC zpQt8;zOX4kn24q>hj`3RQ{j^A%TL236f<4(K3cB`BR&2o z*44!ReO;5XvTT(ozh@|>M0q`m>2V%>9)EPQ6iKQ!`)CaeH1iFuI{Vusprls>vJieXx5!-U3}X&K%FbW zq^Yr5dL7%CBpy(n1#wkX1rqO|#Z?~ymE{z-uud@4exB+Rf_)zeKGEO?XFJ^Eieum# z>2}_{eI&e~bca%R(N#T4c26Cr>zjcBjHtTYv$_~CfML+ZvBo$zX{Ts84&}~o^1-L< zG9hvbw62k2H(|1MUjc>Nj*6o1@~7^fedv$WvQpz029fKo|B;oQf<0k#1PBOPjQ?ga z@PPyX%%~xQsb;E9jj)CSkPhmHF6b6TDJ&odM{3{!8!e-DgP7P{Cf8jqTig%V9;Xbx zl$%IzZ=6`wJxE;2*!&2na5&XaG+3yZj@4D9vvi9*qUR6Yr8E7WBu0n!z~8A(XI0eD3kD(gV7Y&)WCO z4d%;0_W3PqG{_K*-?Wjx^kSitMGt<*Bs5AM+EC<$CAM&Z&VSGQ9jlTd!&xPYY8bv~ zel0i|>1ILw{{V_Wb-%jDWFEtpEOkAbR1PJ9$*pm0373CSEMN*(1oA0ctM=KOhO2+L zYMsOh`8iw@C_0q9R3Z11oCqvcE;?DcNR@CMHwu`+EEgUPBd`UG|I+^S%qec-*2w5Q zcWPG8N2}ouqa-{J6_}~~v-kq;jg*TeXvpVr3HJrE&-t;liwtu7!31aLyYWdw0Y%;) zGFrw2pMWj-FPM7u5!2=JC(NDUcKI$ZXV5?3!FymV%kVmZ%nwjY2MDcD`jpuL006QA zli@}jlWSNvf2COqd>m!9KWFwavy<&Bo0Kl4Wl3ARX|f3|khWV=npfMjo3u0yW&5B^ zb|=Zw-JP&I+cv0p1uCG|3tkm1a=nURe4rq`*qB%GQMYwPaSWuNfK$rL>_?LeS`I zYFZsza~WVW>x%gOxnvRx*+DI|8n1eKAd%MfOd>si)x&xwi?gu4uHlk~b)mR^xaN%t zF_YS3f8;VTeRCqIGc7kV1C0Y2EuPdHk7Tr=AwAQ$#d_UizjbMev`kK>`PXTOwZ^2D z9%$Urcby(HWpXn)Q`l!(7~B_`-0v|36B}x;VwyL(+LqL^S(#KO-+*rJ%orw!fW>yh zrco2DwP|GaST2(=ha0EEZ19qo=BQLbbD5T&e;rn)`AlY7yEtL0B7+0ZSiPda4nN~5m zfA#Bg@G++9U}U;kH`MO+Qay!Ks-p(j%H||tGzyxHJ2i6Z)>qJ43K#WK*pcaSCRz9rhJS8)X|qkVTTAI)+G?-CUhe%3*J+vM z3T=l2Gz?`71c#Z>vkG;AuZ%vF)I?Bave3%9GUt}zq?{3V&`zQGE16cF8xc#K9>L^p z+u?0-go3_WdI?oXJm@Ps6m_FK9%;;epp{ieh5BGOn|LS(TA@KB1^r67<@Qp!Vz2yF573JoDBug@iP zQ=tr2+7*HcE3(5`Q%{A2p%psJe>B%3lQR>^#z-QI>~|DG_2_261`HHDVmM&*2h2e| zuG(OXl?228C|G32{9e%Onc=sVwIVZ=g2{K5s0>v2}V& zCZi1_2LA=x)v|&YrWGaHEe3L=lw}aSiEdWu&2-C5U0O~MpQ2Hj-U8)Ke^S`0Wd|Xy zOt&Gc+g8oC4%@84Q6i;~UD^(7ILW`xAcSq1{tW_H3V};43Qpy=%}6HgWDX*C z(mPbTgZ`b#A1n`J`|P_^x}DxFYEfhc*9DOGsB|m6m#OKsf?;{9-fv{=aPG1$)qI2n`vZ(R8tkySy+d9 zK1lag&7%F z>R(e|_M^wtOmO}n{57Qw_vv`gm^%s{UN#wnolnujDm_G>W|Bf7e}zsmgR@Nt zZ2eh!Qb2zWnb$~{NW1qOOTcT2Y7?BIUmW`dIxST86w{i29$%&}BAXT16@Jl@frJ+a z&w-axF1}39sPrZJe+sAtugKOG^x537N}*?=(nLD0AKlRpFN5+rz4Uc@PUz|z!k0T| zQ|Gq?$bX?pHPS7GG|tpo&U5}*Zofm%3vR!Q0%370n6-F)0oiLg>VhceaHsY}R>WW2 zOFytn+z*ke3mBmT0^!HS{?Ov5rHI*)$%ugasY*W+rL!Vtf22(`qS@{Gu$O)=8mc?! zf0)jjE=p@Ik&KJ_`%4rb1i-IUdQr3{Zqa|IQA0yz#h--?B>gS@PLTLt6F=3=v*e6s_6w`a%Y2= zWmZ&nvqvZtioX0@ykkZ-m~1cDi>knLm|k~oI5N*eLWoQ&$b|xXCok~ue6B1u&ZPh{ zSE*bray2(AeBLZMQN#*kfT&{(5Tr1M2FFltdRtjYf77#;{gPbHOBtiZ9gNYUs+?A3 z#)#p@AuY)y3dz(8Dk?cLCoks}DlcP97juU)dKR8D(GN~9{-WS|ImophC>G;}QVazz zTZ6^z91{5<+mRYFhrQeg|Kn=LOySHXZqU8F1`dXWOJ?NViPE%&FB1@$8!ntuI?)ge zXh|#Je>;xG^n$h4F)g-P4WJMPQn{p=fQtw0)}uk;u*&O2z+G5?iW_=1kTy(!AJzj} zde{a9WHY+*SqJ7`={VTi)3NK|)*W3P zUT#5a$D6oyqH%5zjdO$5ICHx_V;1Z)4A(rTe-r?vZ{{r`HnxK7^fMLS1{;H{o<8j5 zhz*F@WkKQmDI*Q%Kf$Mo!EpQ)=HV^lsj9KSz->ROVIrXAI0!Q?WUosf8t z6CR*rl382^sU3q@($L~EC(AoyIjS&2(el|I$a*8oAtqGQsf7-UuhBCOFw(^b&bol)FWsp15Sra3v%&#w< zU?v<+GY3UMPW4%i_QshmHO;}S6W^rrjf`>Xz*!kSi!sV>mhe(I=_Zxmz&E1>i6=yB z*_X4M#ktdNg7_G}MVRGQ7^zX=+mQ}1xtg7JN9E(QI&?4}=tP2#z2<7N%zf9rxzynL~!MgNpRvXaU69c*^ zX2(c?$=h&o~Fvv06*{JdsM!gF$KALcW(}@Q&Alo`@3h!H3j^@5rFMp8l z6-q!cb?1iS$oZfU+}A2<)&2Zoe?fDkSnbf=4>qd%guV7zM1p=amds@nhpkK7mRJlbf9%rI&?4ft zd8+RvAYdk~CGE?#q!Bv=bv1U(iVppMjz8~#Q+|Qzg4qLZ`D&RlZDh_GOr@SyE+h)n z%I=lThPD;HsPfbNCEF{kD;(61l99D=ufxyqS5%Vut1xOqGImJeufdwBLvf7pUVhHb z`8`+K+G9f9n`J&Yz^XE0;ErC#SR#-@%O3X5^A_t2Kyaba-4~$hvC_ z#EaAd{YEAr)E*E92q=tkV;;C}>B}0)oT=NEeZjg^LHx}pic<&Fy$hApNZFROZbBJ@g_Jp>@Gn*Ve}$;Vs!-LSmQL#^ z6Bh-iT+7Dn)vRT+0ti(1YyOQu{Vmgyvx3Tuxk5HG!x2a+(#>q7#Xji%f&ZxT@A*$m z8~z`DDl?{&1=gKHThhqtSBmSpx#kQc$Dh6W76k!dHlhS6V2(e^e}!#3(W?oQfEJB+-dx zZOV?gj++sK_7-?qEM1^V=Sxex)M5X+P{^{c^h3!k*jCU>7pYQ}gsEf>>V^n1+ji40 ztL#-AxLjHx42bchIx9Z51CG4Iboc%m0DAfvd3@b}vv4%oRoYZpZ*dW?+yTcdu zQlxreAz&6Vf6+BCQ8v!rg{Yz$`Hf$tB*WdxSPHMMkJ{&p0(lyXx|^X_VUQBdh9)?_2P1TViiYqy+91$zg%3%OjzWyY= zX^f7I)2-34bDVCEhECAi^YqS9x@(kD(Bto;VDKfgIo-)s_q)d2mr4O;DTUTgjOe4f51kd6T9`xa6_AUP*N{jz%! zZ0E!Dqq}JlfPZ2EyGN*EoPHJ^rT;z^0vaI03Z(WcdHTh1suHxs?;>yWLj~Gle~*Cj zSWq|nUE}m()bBZ1`Rh^oO`d+Ar$33kry+En{&JjrML}&gUj3pUFE58(t|p~g@k3p& z-uvoFzpGktUMnQ6RxDA&ibYl_A!{@9au^_fB@6;1XHLORS}C(Hi&J8=@>Kw66&QJD z@w>_I1XJuBW3_vn?f~bbTv3_JfAicE?921QNo!MQiLHISD9?+dP0BsAK+yB?l009u zXXMOteoGX;?5I|RG_v#Bf~l?TPy3zGkT`N>WlZRa=k7Vdbz-66IQ979fX!i7Wen@l zu-oEcweu$76ZXrc&JWRf!tLRg2JqNG{;`-H@L`KHfgY-Lve@vsPT7B0@716|Z$Z-Z{!WV;qGHV!`h!S>b)r zZpc`9J))^79ey;7@-=zZjys+j=U6maKhDddqZ}XQffIbFYn)R657nRGEG#j`M-Gni z4deWVXcr=HoNok4SKTPTe>pVDw*WrceS&Wj^l1|q_VHWu{Pt**e2;MKxqf%Gt#e^J zAKy{jQz4T)LUa6XN40EOCKLskF@9&B?+PnEe(xB+KN|M<@$&ZP{jM;DemSl!tAG2{Iisge|}6`>*BENm!G2E z!s_XsaU zit2`a&pfn!ggt)wG<~NoFFD~p(1PRvhIRZaPhi})MXmEme-%O?Aw+GxB}7gAxHKo) zH7d=m&r6ljuG2KX{&D9ANUe9Q=^7yych#S!-Q!YKbbka8)p==Am-8`N5_Qz~j7dxL zQeaeCHYTma$)Fy}ORKS45sf%}(j`4U=~Aq(!-|ZRRXvQijeGJ^%cq3itmW;FI)JsU z8k4pNmCazDf4ff=bqwS9q)y8?KhH}MpVTd^>?u+Cs!&l|6KH<*pikOqr$wK%YZ7(> zz%vWLb^+m&cCQ+h_MDo+aXmPW7CD|K$-d&cg$&GVPEi#)hPjGYx|SBxatca)&Ig?* z6~uiQKE)tF7l+ci4Jve{^rQo}1mB?m;{w?j6>1xBD9F z+2p#YP3U>vfnMicQVHdhK1yDCfacJHG?$*GdGs93XO$LkB~?nF zAfNOoe^p7Rs9JiG7CM&Dd5!=ra;zY~qn6HhG|^&58(rYoNlP4qwA7KN3mvymz;PR0 z%5d!IoDF1vxVxNS5wG&fEt`JYIGi> zi=Fq;YUc>8aXv_wIKNAmI$xs8oUc$5M((w)UFEdS6{7X7iz)2tqz$eebh#@<&91|= z(KSq0xZX>fTn|!v{~LlTjaOXR{3kxDZfD5rHpl>gbmAU@|wOa$t%grx`7}nA|ePPsN0Y)k&2=Mc4?uE@gW0-f>S_2 zbO;VnKt&W3k$KKdvZh@&*WWKa@7#~`b#Kuyw9kqdj%CMuQ9ESPc-)MbM#7}YUL)ZP_L{+siDWcU?e8%n3A4Vs zFYJpNeLjn2bT>CI3NCJi7EH$DX3S}9p>0NY#8jZt#!W_KUc?R> zk@Ky-w6=+Da+_s0GJldlF|P?(31@{B7bweeajQGYky;y%9NZK$oyN7RTWNn&2`?k9 zJytjwmk||M(3Z!M&NOYwT}t~sPOp`iw~(CAw<+U2uUl%xEN7WOyk@N3`M9ikM-q9| zHZC|6CJ8jAUAst!H<<<&6(6Zvbpj!BrzUo!>VHN3A3vo$EF5-6b1Q~ajX zENB~lhUA@|>x6=N0u#cfv&w(qgG`^+5=HoNur`2lvR~b&PjumO|P8X;=d`c+z1YJlY7&H@Dz-Rts$ zX0IYE9kSIlqGZ7utSx^+2hOEC-eXviWZXQ9;$Va+WlHlU%y|f~w(|)o@(5J0o|3MQ z2O@+B<@r*H4*65)(r^JTq+<*b06XMGclsEElst5dEfFJ;AQfYhRt}O0CVKdGh4Tk3 z-(^-{kukZb*3oM$ZffpGMs;jtk2ZjAsn%mND4R~OS73JDbj^Q440{oS&4<@VUYMIn zc0xxy?FE@$J_^n)b|gY+Oj;8Pk^)6$w9nbnMms3RSr6q(9wP_)v01|=P}UbkXoS_1 z#FCl?>&9cjCHOS!yEJqiGd`83Nj00{X6dHFN84%)I^*MZ=*Ihw5FxD0Y zSJHV{j!9v(DT#k7##q~$87Dig!k3EiMO;k|9XhYz8cGVPukGe$N5@yNtQgngIs(U- z9QZ2c^1uxg$A}#co1|!ZzB|+=CrR6lxT%N&|8??u1*Z?CRaGbp6;&#}$uQEzu(M6T zdss;dZl=hPN*%ZG@^9f*ig-F9Wi2cjmjWEC+i?dU`nP`xymRwO$9K3IY`|SvRL^9J zg6|TlJNEL9me$rRD1MJ|>27?VB1%1i)w5-V-5-nCMyMszfCx0@xjILKpFhA4*}fl9 zHYZ~jTYYU@{12DS2OXo0_u+ot_~UfZNaN>@w4Es$Ye>i&qhgqtxJf9xi6El-@U zNPeQ>aXcYVxOUA--x3v13e=7+%#m@}QuMTjN3n--=-{@rNtyYdYS@LJ(G?*np*HIL zbUeo)+l8N#+F-;^(8w>i8Q6til8Y^NG7_qa*-n2|4}(k<-HF~R0v*cP7bxlTWNJ1s z6#Rz!NCYesAbm(}4qp%-;B%AF-LyS5Q6@Q|V&Y2ar$uWn(?UstqXy;5$ZOCC_?L$F@o#dk--?Co{)CGEP^73Kb_^>`G8sAN) zM@iNKQLBj>QAcHjIw0!1l6{UYd;|bA+CcC#3IGYysWLa4!KA}CsEV#c)JpJcF~NX9 zmrX2WwItXv+s%I2>x#v)y%5xDSB`&bU!9COR@6LwbI|OQ&5mf&L^GGZnOXEOLshxO zs;Y;ikp^M(l-^>J z(o0NIdbt5`(fTq>p%?cG;%aHXhv=-@!20#xf*q)++kt8IJ5cG{ff?Sy9hfzQIroA8 zN>Git>3xOUNhe8nUspSV`GL0DK}<_w!3gRCwOvD~m+Zn6jxTMde<_?egr$S1OySh6 zXsS!0Wh)wJPX+xd11YQ=Mq7X2tU;U;Xx|ObfO}%y{pchi>ryaM2zAy50_$ltt(ew6 zh#CF@+U74D#H@hdQ=dX_=OChf#oerWnu~l=x>~Mog;wwL7Nl^Iw=e}~8;XZ%co+bp)3O{Mryc`*3ryyIC*S%Zu;8Y_D3bFAn%8NTYv?y_%Q4zR-Dv zE(Q*~>ec+JSA76q7D#_wFR&HI@z>V`9-)xr*ME%7~<$Ykd?U8 zuZ~EqUe&AlGDqP{uUvnavy#q%0y2VKf%UxO(ZC2ECkuzLyY#6cJTru6Q`qZQQ+VF1 z`jr8+bHIwcJg}=iko8FEDt(bW8pbOr>?{5KLASE=YFFv&(&IM|P6@wK(5#jhxh@Pe z7u_QKd{x@L_-HM=1`rX8`BDds3pf+|$)DBqpXrDP>JcOxubC$Dy60 z;8(mfG^6yXE(+N*UWMW?A~?H-#B7S@URtmlHC|7dnB!Lqc0vjGi`-tNgQ8uO67%US zUuhq}WcpRIpksgNqrx{V>QkbTfi6_2l0TU zk5SXdbPt}D^kwXm^fm04^i66Xn0`pLmnhX(P0|TezLiFcQ{E0~v*cmmAR2|PETl7Ls>OakCexUmie z^yDw3ccuqd5(wV_6?YM+egsV{M=^n{F2a}~qL}DfhDok9nC!X$C9WV!U15~DF2xl0 zYLvS#K!rPqsqS7(b8m##ZA(3F3H0v&0Z>Z^2u=x*A;aYh0093Lli@}jlP*>llBWoh z26`qTwXW8By76umJat{FC`H8^K@=20LGUu&PPftQfn-}R#FI^W9e-k8;IZGoXxzI^ z8QfCba(CUJ?bh5NiBhFyrjpo;k`}RUNRzb0n;mJrphLl}?MBw!ZA)#b=BA++$<$N1 zM{{SV9&BziYZ^cE?XK1=*pBq-+)^B>n8>I&WVJ`e@>#4mHnuhzUW)=S^{Fuzz4!va$`vL}5lw zRMxJqUof@)jOp4lW}kooS{PUqJ^@fm2M9!-I|6F~008Hc5mp_OwRhju-BAmfjCGV5h+8q93HYw5uy}QM_|d8m%xHt3D{+J7m{e#O4`V2j<#tM zr-_uta^2Q+TPKZL38bS$>J__n)1+zBq-Wa3ZrY|-n%;+_{BHn|APLH8qfZ}ZXXee! zoA>_rzc+m4JDRw#Hi1R(`_BX|7?J@w}DM zF>dQQU2}9yj%!XlJ+7xuIfcB_n#gK7M~}5mjK%ZXMBLy#M!UMUrMK^dti7wUK3mA; zFyM@9@onhp=9ppXx^0+a7(K1q4$i{(u8tiYyW$!Bbn6oV5`vU}5vyRQ_4|#SE@+)) zk9CgOS|+D=p0Txw3El1-FdbLR<^1FowCbdGTInq0Mc>(;G; z#%f-$?9kmw=}g1wDm#OQM0@K7K=BR+dhUV`*uu!cl&ah;|OXFw^!{Y2X_bQ zcDjSDpb83BAM2-9I7B~dIIbfN_E3;EQ=3AY=q^DmQncV2xz0W-mjm8_VaHElK@EC- z!ktWFouH=5iBgisaA1U@3bj)VqB)H4VK|{N+2-(JHfiJCYX>+!y8B2Fm({k0cWxASSs+u_ov64=P?sTYo z&rYDDXH?fxvxb>b^|M;q%}uJ?X5}V30@O1vluQ19_ER5Rk+tl+2Akd;UJQt1HEy_A zDoA_jeuet!0YO{7M+Et4K+vY}8zNGM)1X58C@IM67?0@^Gy_2zq62KcgNW)S%~!UX z1LIg~{{L&cVH^pxv&RS87h5Dqhv+b?!UT{rMg#O##tHOouVIW{%W|QnHnAUyjkuZ( zR@l6M%}>V^I?kADpKlXW%QH2&OfWTY{0N_PLeRc9Mi3vb*?iSmEU7hC;l7%nHAo*u zcCtc$edXLFXlD(Sys;Aj`;iBG;@fw21qcpYFGU6DtN zH*Xmdk{4fK0AKi6FGJC#f0@j_)KD&L`tcGuKP_k_ zu+uZ@Sh<3$bA}GmGrYql`YBOYe}rLwZKP!xrdrur0ib3zAR%*So7rZjP$|`v$!nA9 zxOQ4sM|Is)T`iB$29KOE-0_Y!v(GZKhMia4am~e#u5PJbJTk5!5Jn35E$W1AVWB&z zA{r<8tP)wo%Vg0}o(EZ}Ts5eMgW$E9nUDxFyhPP(s8$YB7)%~lUan?sD~~9DckP11 zEa%9&uY)hvUwxUwb}pf|IT$VPqb9AAiAuw>G+8N86Ovlm%$~Fhhg1!#<%uJPW4P+L z>rOa{&N2gbFd3Fh-nnA8lL@IrHd6K33HFYag|7^pP;EZ&_CU5|tx*P)T5w<-hNeoB7VAth{E$^ zzh&!tb9x@TA^<6 zWYl=|`BSI?aM#~0G0T^KK!+74^cJ#Nj`srvw<<6EzM$Kx-86sp4;1hc2-blI9c0tmCMY}Qn=5b(4Vqv{|sKKb)cXA9B?~> z#9fzsZ29S1Tr62*LHahw(?8R{AQudS8<=zg^lz2qD}8im+_uhWqYUr=fMT#sIo${8 zzZfe2N&j7)tPfNL^8Z2}6)v8;x|<$fDzHr5?L0g@AOmYTwm%3~HQmw+c~!W5LEVM> z2|z;BF)jd7U&jQ0%D8~=0et;cR2&d~)H=6#Rr*B(V9$6xY#V}Z4=>PWem5wViJ&4B zv3xeU=0-BSSJgLq4Ssb;S7t=xC1%@8T#c5w$= z0*}ik;4@vwq3Am7=yuN-b_|MEpaRpI;Cvp9%i(}%s}RtlP5ojEwsLfL7&QhevV-Ns zj0eq<1@D5yAlgMl5n&O9X|Vqp%RY4oNyRFF7sWtO#6?E~bm~N|z&YikXC=I0E*8Z$ zv7PtWfjy*uGFqlA5fnR1Q=q1`;U!~U>|&X_;mk34hKqYAO9h_TjRFso_sn|qdUDA33j5IN=@U7M#9u zTvV5J{l0zdjRWGKB8J3Uz+|(f(HYHAjk#NQ1jL9!uha9;i4YYO5J$mewtTo9vVtPT zxqXvBInY?m4YD)~h~q$Ax!_EwZpqbZI3OP3;=4xaULDboazx{;=E*zl0g)CIxiwU0 zS+taYYlIHHMHZAe8xkWHvSjw;0&`NOTN%Xcr-ivm9Bz1h6ny%66)ZjF=M6S}>=v4~EuG0F; z50<8 zuJ7@5d0V_2pQVkF7Vq{{!dIm33#3Ft_}G2)yjM)!d^I{4d6C{M=mM$U&yqhi=!uOq z^+sms!NF^^FO?LLY1%(UAAuAQ;Js8WHnK=;BI0?Gj@F^p*@W>;sZ=u3l$xf8pzH;I z3P)vOmA?n#aMPBi8^%0|sj#w@`5rIzhQ!tSbr|=tr zz3XA)gH(s7qlZqzSnr3GpT_7Etp6(f@@<&&Cgd6@O_{P$>oL!s`$Ftx@?LJr&QNaX z8kwntH#$vkYg|R22_$?WFI((Ps;mBgX=;jxe4dv2B0W9@Ytx5X>gz7C*}oPKd5d(e zNI!)2=dpg8p7eD2T72>A&r(Oc#kZr8Zl0T=_oWh8{A0N9vXFPx)*^lID7MGYhmW53 z!69FY@je$)Lq+<@3s5PVD$*r5``M(QjgmT^@OmO6-sp%gHc}rSY5JLvw`8Gz=TflG z&)tw(+<*mIXdUgu%{CxCbK8#JowN2@0SO=M^#R!H6?`{v`CUe5FJ?SwyCTwGaWuck zZrbd*cS97n*}$HSL^o`QV`u2{Me=!GI9~_dUxVbO7s|jzu~fEkS2;SKy+&74sr^v1 zSfo!g?rt#d&g0|P1t9ae)DZ7~4AaMp^qVvE1qqxlUZ9nHsoy&~b@Pi;bSxIXMqg&h zucX*B)AZGlZ<_wNNMB2M8@&ts^)Xsm@z<+UH@_KAm7Vk&{!iU}$6y2}y>=s3q`$h% zKQ|De3gWd_T4=Rw*ODsRR%(-Nn7U+pH|>$_UfL(yBps0LFddieaXJBi>k?^{mF+lL zvMtd2WXr!S_d)uoY)gJo;16IEvvuH(Z&YlEF~4MtgVERw{mtdnP$YGQLX5QNiKcH( z)87Fhz);ga;3ro8{wMqZN=5qDvS|E7)4xm6|Cyb+fwKtysRw&ATYU!+B2TOXK$*G3 zl~^PtLwPV-6rR$Fz;;o8z>*(s7WJjAq^m9+Eguv+(JTTuX-2FlipGi#>xbCfU@qZd zcZ!5pBz#h2ErNo*n((t*0g$hCrXHnm|i`@X6!d0j(RK8a`Hw z2l5S1eVl@8los!kPhF(7@ijcCcL%PBB!<=~MKK)m$2=`T0Eu_#R=NXIH=h{{`4iqL za>{Mu8oi!s7Kf(A;TzGAKje#F5l5QETXFpg?7)M8D4Qw*a~?Z-8SK4tke9LDVAp2x zFf0l}5RJ{^1U}<`@`|I)B2%(-WLk{fsNVS{3NYNyg}nR)ue=tyK_MEWlVVgDvV8=; z&C^-g=a&0t>2a|ceQr0P|8{y#_POQ$^YjVX=a&1Qq|36;E%!Nkxz8>4U!u>;KDXTe zI(~qWgw0KJDS&EAzCZPW_^!Tj4^T{T!k9N#2;RO7iBy{i;&QUo$Tz+nfE#GOwP=o zzrTJ1Sc55We021t`blp}YoGj;%5y1uf!uNG{2Uc(N@c!)lX% zwI3y3q;Kp>H=-52V;i3A7>>%(TwkwPYfo4kR?qm|#C16kwWU$vA^EoB6NQd%bM%nH zh`l&oU46V-HClA2e;$PpNH>BcwCIK7lE8cr+NK@KmP_V`PLn)Sf8Dbz3|Fu5lW zrRhrFHeWUO$ciK|;QNMYU4B z-{xxq=2gh0MJ_>CzIO%I2C`dQ0}U%zLwzhCD9eXj_~Pck%ya+e`Xnf;1j}62O+JMJ z**YJ(mx~=JE+{p9z;naHl6M^@O>uaJ(zL_pbbfg95AEkMI{PQrP_-wu~We zK)#DjC~RTz1jWl>>J%&u_A8uVgllhIG3F|Oh{3HPY0BVyFRviH@lP^{le^7F7aAk6IX=QUpX>4UkVQyq>WpXZK zY+-YARa6B40RR910F6{zR~uCn{!U3VaS~cep_D2%4T>QoM5x6GZPijL*Z>u~X{ou@5sm(uh3RbluVf(&O%!e89(-`|RxlHTyT__; zTIpHtPB288^%``Bpy}I=`(B1HzbS#S^Q*EAx4u+7Zxc(*~e=?kj zw+4xz6K8dtK^H?;L)FMr!#N6j)wE6jdOhsj2+pHdM-MJA^fYHUW4l#<(U*c(G`yvv zwG>!)eOpH#E;0lxhZh*mH;kJ6>$aB=Q(^iUP8ycui3r|Rf%`B(*o|DLxmTuAG{kib zs-%KzVslaWt>u!4${j*dfuna=Gjlf8N|iUv73NnM-UT zTEjavytj?P-0dxp@$d_Lz%ZM9fsYs-W1K#&G34fI__TAfhMC7ZuT%8h5w2l2Hy)_r zi(hyCO7sSXNctryYRD}=-T5Q&9N#|6K1C===&!c1lG_H)C006(Efi~5tzm6w3-&8Y zvWvL*6I}EnT7O5;Fpr0ndOrs0=ZE;E{$`LQJ%u*f!o+r*z$5x55|i`<+WrAhO9u#D zCi-vo0{{T_29x1N9Fs0q7n3fjBa{1*7=NHvK$Ity1jV$1fsl}GyS*M<@0z z#ZpC_6H8jHE-TcOH8ok&$_(dqrZ8$S3|6U;ELB;oX0k3MSuir|u0ks{}^drwUb? zS;`g~H3HuEa^1?rJxd$F6)!aX?5$j5TEiqjb_k4}Q$;RQlWnyn+Se6~9ueqYl~vhX zBhVX*9|$l4qkizhP29?h{QB1J_Q`%>JAd+W@71;s#s%=hjREL`2?B#osgsbDB!AYG z(uHDIYsWX`g8{Bj5Ez!O>a7Bd#Nuwn95&p5ney!kDT`TjrM^Rv6itT)*ytD*B$M}o?(MSMt8&$+u?_rKX*`?w+8~YR^5P4}7sOkF9+NYb8VulQ0kaac(Zu25@$r*cl~zffb;YL~{E<68 z<={D2eA>YuyW`Uiz6>ia_{?WJyb4dc@CbIt!Pnra3m$dwXRz*u+l|G0iQgXR{R2=- z2MAKixJd5;002-1li@}jlN6RWfBSb6MHK#qJ`zHBG%at?7=^ZJ((sU43aGSzR{EkT zV2Xg-WRfo3?8eC}; zyEAv@pMP)u1z-biGn_klvcL6sU`UFOa5WKV3&fLwP#~_QGqNI?vZjX9e_Ddmyv`La z8Jre}B_kXk=J63Dn>GS%Nl7tyD3D2o(^4iZ3mZc%E$ibOHj%F0n#U)zib4~{uoPZT zL$0P|m2+KIQ#3oub%T7-d~5T@=GJh6j|NV-!5BPIEvv`*E?MCW0ZmUuQo58-cw|hM zG8wK%_B(RtIFDydO?RP^e__!PX;g|RlA4P24jtif(}ij>mC-fQG-YluEa|d!vZky= z`ljZ$Ff1r&IZhWinz9xVW74ROYid$XF*J6~9#4m@lhthw1!$|R%I2dC^$n%=%E!^T zkD;QWai13pu*d@!Y6y9c-dw2lpbj-&crkx2s<6ZhH|C13WnOqNe@}d^VDJ{l;le5k zl8?)VY1pm@y|@qed$1aQ;y}@)L?Jvc0$AuFD-SZv*SVC~K`>q0t1Aq34UJs|`lF_( z@D?xDV66bu6ClOSK1t`Q>F~QK56Cm(MI(a3aT7ypQO-6;vTAZ&m6Uwuwr6=LD-tLF zL&h0PIO1GPDmNp0`#UM72-bPfjP(o)4PIiAp{Ai!ThwhM z9u`&DL*e7r45@} zqS>??T@1^nnVwqpqQ|k{%dq*LC>flElRbiyesX2Z>T19VbuXQiV{#@+&4oMF+fTiO zA{>-6PSIjcOoKFS6iq+l;13qz9r6xO;T=vS2R}50ccv2#o=Q|h+CAJH)AW%6InA}K zX&=!}FH#s5e>yTlWkaW!*oqO68SU{JVB)Hl0vvZTX1MRnmt>R(Ase@{zh`Mq(VYx=EF{=B@5S3GzL zuQCMxe}@eW>)Mz!MD4@r)31AQ0&md9FQ^oyd75EqanI>gGg*_2aw+Y?TZJByZ%K~L zw>>z6cc`nDyCqzBkH{8`(LOG~i!9q#KEQ__ypNCak(H{r@CidzT+zgq{Y+dopW-Yv zxkPDIf8F?;VQslqQT}{=AzXgRu)Rm~k4j3G`^RK+*gwLL+Ew%$86KCDGEewrwQRkK zgM7We7EEjx?0!pEky^5+-T02dWqasNie}bXHlT~RB#Qb2@myH#q`M>~u8JQS+!;wX zTcPnxhZi`CBl_pfLH{4ET$WLFuXh)Q9ytAdPIvte-?;e^N zQ68*e(OB**X1A^2oz%(Va*uqu%H5Yy<@XMSmp|nFb#AlQ zsc)+~=7@#8TPO7J_%5xQ=ZmKvT=9Ok+Nne)@pl4~9{T_KK4GfVuecoVUB`;Q{oQ%u z&XHZYMO=Ztmo%+onJwR@T@tIm_@ha?_Wt{MN1i@NWSn(meYls++0ENq9&1LkRrhYV z{`to2%Ns*m)^6KaU36ow$vUN-z8fyMs2sVa^?p%R<&PiG4n+L4PHUk?_ zYAA{tCSL>^0=}^wD8CJO;es)WytgpW5ar4K!qSr;%oC6SUs4S;B$l0l!3IU4fEZZe zo_QuR$d`KBqA1!Z309;(-&6*E2P4o*RFfDLfr`Rq5SQ37Frb=pP#J8>0cBN?n^?hj zrcDl5Aj-t64wYb=JYj(rE97ph{XhvhO}NDW1*+2EiOO z4$y7(DDrD`!3LdKXfA`epaMNirx^ehDFH9w;Rm@-8hrdb(4>dJFhdReC6lWcIkA8a zQJ;Kpkrr|-33R{{paW1X=y09f zxFkjf`G`If6hpK;fePd%%epIqlMM3tF^VV(t9^h9WhXE50*4a|=vb1;e9Od`EW?1} zqLb$@W1H*^JXRi*?huRVfd|o`7*ZAiRcs*R2VY;qz@UVp=ua+4(WK=XGVrw_!06XS zQDapFQ3G0$14-TbLRAJn z@&U9MH5I(>1uM#0p(BInZ$q+qTV#)0mCT#`fFa|NR1Ytyy=Uvu8j1-1{Z4 zkp-}NJ4D4hh2N9%atw@f2yzUx)4yk$RGAmqb`EcUGmObhDNNDH(0_+L1DdBE6zkHo zV^NeI6w`)aQDCAMW8S#lxPJepEC>C=p+QhU_}jN{Lf?{Z`0$gEktC6tTWVSiA(#l= zRM#)&E9;Xikm%7N-rx;e*L7}(utaO;O8kBwCO&l}l^_uT@{Va6N#oo($OM$au!Y&p@yJyo@jf@8M)KKaWSMRh@yur@yCYMu zDh9N136xmvLgmWXPe-ce3+Wt*D2|pk8LXMPep+OoAW{WECoWwKlmW3jFXF1FHm`Z;Zg|SH9tZ5)(OS(F5xcr zegE$V%Q0N}k$(U7%{l3sk07a@nJ@`C4li7iKrZKUXhv<~iT zG$^C7*h`Z>gh38Ys=ch z@$Zk7MNAGeIXYY5F?-3B*l9=Sen!w z_=?PxTZ9|swIGv;yPCv9w*^cJP-=`cBl3#l=7&B!lJ>Wg_ZLUvoyV#)H2HeEohGpJ=nA#p;TkA9L92`s2s0R_7^+6P;* z6S;-?^@m7e>Qzf79;-d`{dQ6<{8f^1ty}|burp2H^la8-T@|({B_t$Sv3Dgcq#2Dl zOQGqvaq?H^RFitL&Py4!0dg@@hr2)E7{>{Ud-#my(h_Zg`l>A6$=ni$o~T-)yLWn> z4CvPI;H`=X?d`l@+Lb|FqhL6V(e_4x#zgy8m~@Z%PelKTCGT&us3X|7Z%yF; zrh_i2j}9{_5{(S704CQ~^6SSlLoKm`iA`jtx~+Wt&`|MrvPc@hZ+EXw`oGhhO?t`L zKFE0kM49>Ina|$@lW!dLz(kWqHq9@8Z@66wxE)Vl2?+&!*Om<2UD(~7yoD~Bt`Q({ zFdMGN9Vs+{3|M&ZK7g9P2iKeJMa|tQAU;M!Qm~WK_BELVAjPCWJ&870vlA>FD=fsA zts?!M2OaX7XuO1MTl)|?gz#<9j}rifB&@iuocsY`cQ_jS7iD(u%xx1YJ;NAjJZ z7%U>JYN@b)3-d@wxvZl}Ou9wc1zx$?Xwl5W)ruBaYT+d)<4tLMmz(@DX<#Zb<0K=5 zK@fwtIY%D^7^}}fT7xdwOlaZ7;tWnDm9URoKXzXjfPou#@0w7&ti0^e=FHLRu))|C z*mo}?2J!e99@7KN8C93J{)YGM?vYt4`c1L{StjK1UpuY7J3pCcLrW^0&9wEmfZVxMPPJ8I*WF6c?Q;rG$B}*p4tiDv{2!2gzf_RX9 zr?Q+SAz9Zof|(HtVE^9eEU3}kOqukh<2pY!PdlUysr z{}wVH2}P0;CNqE->uNh5sQRAo18X~(S02mSQ2yIF%kq~j!N)Pf4;+))AxNn?I>#01fKm*8a+>6WBB(q0pv6I!S@ay3V za;XwmXT8+)sdFfxdRx>YEU2zhfG`I+{-Vlgg`6iaC0YR`!&r4ys>^3|`>_wQ)jT|0 zrkEi?>HDek6lqur3Cjv(0{hySZBcjTryN`-d6r&W)=Pw<$1-(oK5xaiHm!cHm zUbZP+9srr?V=0sHi6g*d97Mrd`*dFN< z)9|asZq8ZtB6mvADwn=tDyyMUPxq!vET9g$1m1N4b^&eV2UaM!$An`~{e4RehP zWS~6}1N75RGZSX4D!gX#y2YE+eM0vs_&Q!tLdq2DRs^#{H5i1FGKh1{jx58RXQd{5 z1LWi#^m&wRs4k(l0v;L|&uH*XPM*8qQKwn&7u`^+r0O!vi7`DT=(moC!*rQjWnR3D zEKj`W!|S=1{Qa`7udX&=J(7c9%q^n#!9aly)gdBE6WGHgo6))FU)0y=pz{-)#?zAv z^<3nqJXwA+Gh8j~OiSyX1ssHat}0CtK)aXs06KQ*3&osOn1?&me)JY@e~^phlU*}! zv}ETuiUg%zDLvK}puZE!JMWyx7xDwxly%{8@DOk39T)iGfS0vz*nS0)a$f-#V4qJC zjbpA~&b@{#p=?R{*2EM6GT@y_HrJhTYK)eN5)vYd%NNxzoLAnODogPQRM`d zn_l88#8QHU(qJ#lcXLj9C4erI?H#SmZ`Rx;jjg%A^=riFzX>8Tyl!Iv|MtxQ`hOEN zi6alN@j|me4=~JRb>J;zu+uUB0p^g&-dNru(Ogq5Jx^LuBcflL(RSKzPB|^FTN(7$ zd$rd~+#aGV3tkUn z#MqqWh4;4+4-hAtsX;gxjy^A_IJ;d5tiNl}Dd9U4;GF4fMNu>nn zQeWSFgyd7OTl_l(v(rm{TFID(Y`n@|#TEn{8yQys4DG3Jo^^nn7)3$JqDee6e33FcHdGkrSG-!^vzQMv@cV%l1Z z!APhm4KN1&I0w;S&~l(e`ezlxLn~pVb}?bt#RlIr~pzde8;*e0RUfF%8PgEV(8N;1i$ChR5vi({;9kE^!PB&VsM1!_G4O?A97`AUxN;B5ppB-w7f z9e3pirC0WdNrP>7;|7j6)*gIT*UT@eIr>ZL(nH$X&OEwG9s)Fyi-MsjMRkX^Fe2v& zGAJ3Z)~MAUKh@k?kYhp_IcT`)h@yZG(c~^Fz8eF$|G=Iw^OG@qt&$Wl5=i{&0xmM; z{DixdVN>cI_aMYt9DR0KU+6;RaGu+|iMFyM2`njF*hpDHh*?KU=v%<%uzb0b(13 zaKJVBl_$sO!0-Uw{7C^hwGE_|p%iq1jcnPhOX6rLxO2X&JtKBHVG9bJ{mwE(`z(Kh6`Z4%?*}x7A3< zA_YJ3ZKX{PaA0;-eXo9<6<(CiGu1jf?An=taEOdun&88eaUa0Kf|Is;ql-T@u{ZWW z|KV_l4r&$Oa`wOtUGTV|F4{P<67bC}h@3NUtg5wOqo>h~_L__h$|em!oPnceQie>+ zlk<*9&j&b}QjT#)Z+dv+)G6ar!YI~(PSJaSE1_F>@GUs&6UR{HQ|8@=ch8U1bqf9>IZU9s9k7yasNo1HChdfrc7%N+n_Kr^q~!*Z{2urjWU08*yn zq};IDeLMX_KJn#VJ{9*#VZW18er^=+k+M?auRsv6QZF$OQB^Q7OYI_%W`i}>y|U+3 zYLNp9w~8tO$67|Bu;MT#Q0A`^rZ;R^_+^U=D}X30h4?%-)#ZRJseK?Uug{`SIHr_Ox{k&ro-R2jgh0~&C7P7Tv z{`_6<=a_~1!Taj?wtw7}{9cdEly`giA9?JRM{(&Va8WlQ8Vb_h`EjGdgu<@JZv&Vv z0RX?}11E?twwr+L>@V5rl_~SNp~%KP)_pO$K3#Iv1iyav_<2zMtsT1Jx?Ut*c~Ay2yG^y5#N!{>h>l5 zL4)~{^`Q4qY7!xE;g1+ivVH3tNR!K5Yy9smdV&z!4*xxw>4=kifezZltNPEy@YT3DT1jEXG~|5wM`!*Mtp`esI{Tp}u2js?Hf_Eujcu zpC}V`fbN!RLRe;4P*5cP$S4a?21pav=KvQ3HD{S=C1V5tJ$Zu;=N+31+gqy+9iSut z$f+?uIl>l(-mnVu#gXHr78jI<;Uj&rhk1ZOOkauHg5sa?zo_Vz=Wldi8Rz|;6Y~KE zTH@?PTn}I20nD|Llj)QDsI}$Xad0jP96%T&$7k2)^*F?;vztM3n|by}eiAZ_l?LR| zZjmYJMj}=sxhRq%su-gpJrFZa7uQciJqRYBbqwv|BRY34oYH-r{7vkOyY&1P*)kk+ zW>L?=Ti!c_vPvVC2b>!=1t%8BDHIKID4M0c3_(jF%AXv%P3Ag<3d7O^O~vUXdgXot z>O@*qErPZFvK+?^@q@AzN8a#Nj|E617V4kErWfdrHcRDZ7y5N7^9f z2AcWCZf@z-5C0iDo?PCRDF>zEC4V)y=Uz)l+z~)J3%{T$aqVxz7pFA)tZzE1Tj>Fifwj}Y;wUN> zWMCGNtl54a@>g#Q$#vR)=N47xu7e3Z1ZN&2$H{wN4fI>TQTl)9-`7Tt^_~Obajznk7c`A9tIl=NWtupsmL5Jkax`q@obg zZR7{=LSZP8ok$RgO$tCj&R~mfFgto!cGT0k=kcP6fsIq=n(a7RdeN%HmoiV%okvZ+ z)c9Rq3@*z$`um%3%*^^Q2++v8NPE2W#xs_1hs#6Y0v*|Vvjc-rfVyhWcbre<6M$6l zTisMFVwh+X{z#Q><5^lxzBUDwN$4Y*G1mL-jPW-rMqmXsr3e*zZkbX}0Soh?oTA8> zhhe=$ds?Yt0g)oc-T*R~!i}*a3`}4GK%j=nW+jH1#GG(-Lq4aF#Xa`uo<_Hiq&G-aHQ95?G-QpuCT?AiY%2&PHn;gx^dmWBLZ zf}o<30w_44u^oPlHK4^xCWC?x8D@uNOF}*17f_G59f_nCeefrJD9Si-Z?M(@IsQS z!jK*oL}f{TN5A>Qs!)iM*cPCgVwEF&NW9m#ZR5SNFm~5@7{lWxRnMa2!bHGBWhe%T z-)Wm7%b;Xi+DvHhla|5NBAn&iZ9Mo9$AC-MS?{-J{sJXent9nu}KK7#ojde*P%iAUQD0lIlM3RlT5|a&@!m1 zrw+*Y-mgv#bwc8QwwbYsyai@SY2ohvd_mDTLS=g{%;^9_9 zU8)CmRGe-VS|`P$XnF$r7p@eyoo`=dSpyW>TNCqmG6t$rpnGh_6|4tb{~R1#^K@(P z$&IRMMqF}GZ~l+(LOqLW6#wJ9{z(a91W5?|NdHm0L~^JkGa4d5+v3tZn5Kw?R&uNR zKW@iv>=!>oMJf(o+M9lQ>CRVgl(G3ZJoYs!v{OZ?jH>Yd{gZlsvvnwLS)SGR__u)7 zrGW20it4ZoM8P=gc~!-A4gy zlSov4YvA{!x}=%7$l9cE@ut>igAg{%sXu(bs;Lb0s1e$}#E3kdslqTeDA2sI=k?LpXD#OqqX<;-vH(*zJ<$IsVH78@jDk`WF~H&HWa)3z1FaFUtq?P*a;!zppBQ!_Q-ps-;XtHMQuT<|D?eH9HZ1>0nHH-Dxi%kFdS0I}8I6_h!ohe{S z7Muk+cXiFSMfXdIP@lhf-s1)-G7?%sgql{9-+S^>v2D&?wQ)TtTrk{eSLS*L{8@Rg zcv*-VTe>&ng>svm&FPA%?pr+~96TWr;k2Ds>`XA8dO_0#ghJUF1g|69xLQF9-Z?Uj zqcW*d{1~RvMtml$(WCEALL!(EMWIYN=CEBAUKIz|P_3H~ShPq%0Uu>Q8A*bOM%GvqJQBsvK=iG^ShLze zUYZ=2q_|LN9R>yBoukBRwfeE3AJG6zVkAhY zKesN2jo(1ajKlBCQi-gmHtU{21Nt4GMJv)5`(CtK@R7P7<6XG%TsxK@+gElGNe2@rOf7(W*baezroR$RQz~(r)j!vk-MiD~d9e0%7mBzw3_PX}}4T<9oQs!Kc+q(IRA>8N$pavA?AGX>cx-B_&V<;wDcm4 z;!_T)cnvQRL(NUKg?WYqg+O$(U%eE(3UfR%p6&HFoHyXXY|z+@gvN{9{m)+c5nUmZ zHD>|;dK#@;J322&v>N@^6gdn;mkVJ%I)Tu0htt}H({aGbTd{V*C@dZxLbRY$d?A!$ zA798#X`l@9wDm$WrqP>`cvM7w`-v1WCw`eN^x1=~`Er2hY1bRRi1Sf*ZS~5~_ zXl=q8y94feP;x4g7`5s;WeJTjwRTz8g8BNCF5A`T&CI_AabGlYeLq)JF#vtTQ_BD=7l$<5^5U(e z-$bVYI>qHka{Yacnv(!n{*)o5%y&+>B_%%Rn#s$v)_;LL{ws9y0c z2}x;NIXis$O|g&fr216Gl@8M4q$0TO4;%3Z|cpTUY+!{z`yc{6{_G1r1b{$#o zHJZReEqThGCW1WFia8dftuACk^F zs!Zyxxda0(9GOye^-#t5glwDK^)YUS&tQlBWgwS01O7l%dk{{)f9=|t!LB+q5QODcn%uv z$vh|WVhi$`!yHk;k0Or#n77~))7x7Pt#i~MGMBH?^xwd*JXyXw59&eYIjg zxeq*yji3OEWd+;157nEKh8oH^X4+=L7F-F%EO09feDlaZcNuka!Z!4Ys%wcKTcPno zACbwXWTo9GTHj@cw;!>b+@J~P<1n!?g_fnn%?eLs!%j?wzv_RXl^*DLFx&XSI2M!( z7#)SbiP@J_P)lylaFK0^tnW^E%e)>}aZWIyoMf1MRIfd^4YqG-0$r$gRJqzs6^<8J zFjiFQS8i0N@_0aQ>L@Hx6V$3;7<4AtT2(H5{q}qWI!DNIJMp0tfiehAGXE6duB)Kv zk5DDf({;sPZf7fj#!RD4P5_qVECD=#C0}(#94<)yf!W;c=J9-mQnL2m;xp6SS6M3M z&zQ3$BZ{XpU9=aCNp3`=LOC5`$#y=+_91C0)2H_j1yspDMxY1gQkP(H@&=EV1YeeD zns{uQ$INs~LG2#&*>O3(mu^H{$#^IVI-@efQBS^d!D3SF|*9mJ>msh-Bm2}upZ zLq2!&)BvvH=tkNOT?<9-1=aRBslCEkC8qH7McjNIO2~M6235V&$?H}jq}g!xj4j5g z*f%%gOnOGLS5)XIvq|pccNi%^z%M^hZ!3cJSOLLSj?T8&{eikXv6vC9c<)$q@OSLZ z6CKDeiSHLBSFTT0Zh?2BYrUYf@k_H0u>mY@RJi4vT{Zm}$f6GqctMF*De{sVdx8uq z>sQMD+@8-nipJrcI^{^SK<#>D0-0K4cbxq`hlXR%1|`SUvdH0xOAJ4u*60kZ^ct~f zudirGAQg9JF^bL26?aBazp8)-H`l+XbRGNVvBYheOuXvh3OzO<#akeO{eNpX+)gBz zl+ED)@Ex25UtK1hEtV);6c&)T^qjY$Vso*ahn%FCguaG6fNURbu?4rR(D&KBh3vkU zsQ#M%j+#_*Wcn!d<@aR+*xq`%s3QVEF(V}Hj_;3pB^iafRkn^Y2=Egv-|lK_H$_o^ z)CEATdlGub2VU*t8fgoo1WPe?eEREdlM-A2{yZ&(w9&y5(eCopJ>Xcu%$b_o0?#1t zxTRmOedd9)*WxpJk872&b~YbSgZN6&OTSX$^WfmOIcx3R$Mwp0W+)!BG=i9IX8CF4 z#vIYYo$}6cv`icF%ktRC2aPUmbp`>67xHJE*sIDn+d=gjQB$_INe(4ZA`nX#`G^ZZ zi_n5!C1qE<5{ljzn9*L*$!F8j+|R7-+CItP)P#5yV$n`zjL5Y1rVoI`J3tbUGVp{w zB$Y@qYo~Dhx+o2>z>mixn`57ys13^CfPT>a z$nPWS;ob}^G)J8tXMf~K63a?;9ow(q zk+?1Dn*#yE2A}pNN2>5QJDSea?GOww_29hzOF<%Z521Ck;s&ROnm*y$`2DRuyaXh96 zC-$oLH!o?i+)aLu3x2Ldn)WC_^p6+m0a#57Rl=O$jFE&Kq?pbI<+qp0w>6}KYshOD zj@-7KLfL5ji}~kZK-qzY)YFad2x=>hK@Spexc2S(3tg)DS=zREmXY?fGJ+`|R^b49 zkij114syx<60{~3!v&$hAG0VIIwHB*5O3j2l5Y z+8hzH>adPU9@(2;lz%~F)F5J#|0(i*#R;4|t6vxeYblPQX=^0iA9u(rLes!+csIN| zCvnoxiv;QB981*JJ+(y9zqyo5quOGHu6@_YFHjHuRJ&+n zu|u0p?+oTZ+W7-HOOIXZTFgXzxXAGpGmr3tkY{Lg#?}HD;)-X1Y3(Oe0~5*D|8l&l zE7VV+s|wvNEZ2EOCH?0D!H9f6&hn>OhB49KX3*w;)t3@1*rxN1vlE(j>!gT z86e?wpo77Gj%Bm#KPO+0T<{F*38*MBZXxmAdBgiJ1>HGGb?`xa`?mZ4U8xqYD8N?D zZmIQbNer>Dgk_P4nl=c%TU!|&B5vJ0vv!l*f{P}675avOUs_}U`nq7qW*{rgq&M%w z(y|XA*!vCNSZ&9HwZlQEO8^I+24)kD>!eG8OL{+Ho>k3eZ`elqH{LusLj!mGG8_~- zyaS=$Q!!IZNhx1sw{|Q)$K;Q=LBR5jNL)|p$5U^f-BbvHblq@#qBMoLBn3*78EdK) z%l4MghLbNz%w`&Di0}*Jl!9=YY*N3XEvXPI>*4{l?hDtvHY}eF{v`Qd*R2QZ*2Z9o zz_TKJIipGP+dAJkbaTW=u;GS99-Y9NOZ^$Pk`Fku12wHbf0GfcXjT4n2&gwbdU zHGDdANVMFiLc&@m<%D%p3!23y$*?3v z?BwnW(h?m%>U^UNdzMk`rqR%%3+5-FSdp=cw3!!Kab61!aLa9Q%$R&4?vkB-NI%Byx8)tRaRljp4?bcwQJC-e_NW+Bw~QW74dzK-<k_E`SC9BMzC?(lFRcIEI> zRf53kwlh`w;b*dEqlblQ=)fP>9`sSt1Hg?B4kBv8*^*S?$#Idx4t+3}zr4bFLgRw` z`o=Ug=!o@1!fue#s>8%;{&Jyw^(AoDYs!3(1C-(L^F``zAz|I{X~z1XlL>iK zHd*rZ?^pE5m4^Nh6Gk?u4*n2olM=Y8(8;d_Eu%N4*G&+0i|*Mk{K+ieU!1nf3b@Ec z5tRH=@Cw-!gQ#us3IP|}@Tg&m8b(;*&^r{8{GH-~h;6slSM1o<}*gns%H62wRLFfieIGcZle>q|R|m%g({jqhcW-vs?V zjK>OKFFwhqUKm^l;5zFlPyRnztt7lz@ZSGpx$WxVT}za#s+*7P3IL@RqZWiWD@RC3 z6~mod+|+**6TGs-bSpI(!#_A`o`oC2$iSPFCK1o^r=llIjtNtX>AK+f&GOI4^r45& z6&h&IyCr*hN+$ATt$n(p+r zIF>eY9$<>cAbh*(_~0+|T7r2&zugK#d_3t8 z%r^K(a#%EDb)~G%BK=|1g#HI!m2m+ANzr1q0AWJ%!1KX@*lt6fU*;6lVZ<)5qJyZ= zLnS@yhH-3sU70vp;G{%@TnCA8(mV&?&(z}U-@l`#*?4$pcuf6%BGOv*bBQ$E*%n5>`u=7&J^I*DA4^8Y z15k)X_|nw<^=?eA&-GkGG!u=|uS9(+H`zLy`o~7^2d~w!McPjA*1{I?xDO$~QJ983 zZ0WbfyDXmOiF&OxoK(l|eNj=TWm>Mf#quat!%ks;Igua;4U)&DTtGDDZb-KLMNPA@a>hul zBgH8V+18V+wtqC^UJ_YOPTx~tKpCM}&6B)MKxHejdj+l0k7o6@=hyluV+3bh&&kEB zFAleAh{+}b*)ANQ!sHi8)4*HzUzcr~x>n8*3>$27?0c|Llth!t&+kD$8+9zO8*LyE zI#WvQ12a?$;{!a)G$pv-$RD9xgu(;dBd{=?4fUkO35=kOJNCY$}#|6RJ` zU=Ln1&tr4t@2eeJAYfywY>5D?KY%qTH`It}eC*IBY{h^(I=aw@0XPM6B+yA0i@~9a z6bPm8>^2Klw+h1+%Jo@(R7Jk3{T%Q4{o!@BPjVwXxf?f@&D#HR*tA7K;=nHS^)0Ce9kx7>lZiDiiQR zRt_1;I}C7sCNO1qBx|GV?Xii-?Zm>JW|qHX*wvMS(vyi?Da>AK2#1y76S8#Z#; z!N|lBFjLx|+C-paZh4VA8)5uy@Y~$|O0ujYy*Cbam$K z<%3W5&po1|5!K)*cE>FqX4Y`o^R0yA>z02s_46mKNgZ9|QA!#%<58)X^C!#$Pw2k& zo*fH?sOij}tEpCf>ME3fibcD$MBKc5Y`l=zhhx0bmlfK0{0C2}QbqOp^&rLT!?9|Yw0m8Xr;`5C%9G+@^BD;!p3viwt0@T+q|@Sw=KDcBXGOvul0`f zXCIxrn31Vd{*xZ2kSpj1|LeM&GmZ^^1IFO?L$zqVU$05q1m^0n+#0}`M(9&O-R6jf zgcGQmlx_Q1a;*x8OfzP|=CD*&Jpan>@dPg!={Va2A)G#Jr4jjt;y##PED%KP6gJ^B zlbG->T1Tin;|hA@sT53@q4M&bld%`BY~940T6Aa>LQMGEtnF8_2p;ekGcTx00PaDh zzpGVN1LpP zf<1LxXk}uUpX|U}k@c{BrC%bD5;7!{Fc_wWNJ)9Os}|>q(}GvUV%LhshB!k=VI-Ns z?*@xopBQsD$L9hPO}GKGq&eJkfM5IEIufa+@6-ZfwX%%|Bz{qOYH7}V9}g&;Dj$-E)#5WVymB=H~drr&<9qEBv+5G6AP!Wl2jGaRj+fw@K6Ze{CWF=wGHiz-=2|s0 z&&GM@;N5G=7>7eh<^f?+1^2AtW*C?*j>&`2$tBc#c_eP zJN6bIzS7|ILHQpw)@q{ZfTC-30UTTQd(q!1usS3}x77^H(krq>VNos3m3oo@j(n)X zgk{LaH5EBRV(h7Vf6)afT|r_08rmn!BZ9LZklm4~bDt<>TcB9Wi4&Tn!Iin@*w4Cf ztJhoyVwI8M*2(7Ng!kwMT)$Co%SUL*BHtay%YKC~asTy$do6hjmh#!2fWfI+2`=Wo z(&v4_8i%3coKL=pJ8YLs;;fHD&EPem|Exy6%)5f<-{chie`TH`&jV=Mw3lmi0GFdd zBni~-I(5htE|95<4^C82O~X7lf3jeky8O+`mK7|kg2E&`T$EZ#ZHOV^5aNhSs@&2X z30>%2Sh(j;RPL?P$JLbOn8@*1_Hx*^?YHf_ebamHe|3XJ_!FWZH`|2UZ%0^Z;dA0U z1@FJ6#KO(Oy}q%4wGu$3W-HpDZU9I5fKAmofTqvF!+=O*`OnFUK$g5Vnw&_qFiBkM zrF#R#iLjNTlJ*An53d~H%`4UuH%O&uFr?{Xvd$a@`cYN5$H2TF6n1eVwzK?`vk zd1~G6o3%iHep?x86Ka{08*Z-fzNTNl6nz^))75~4T0QC~V9b-9%@Wn@UVBbUCUt&EIhP2;KWI$zQ)^!$5}(splE)r)`wC4UYqcmRKVaD)@jm6;wnnCWv4-zsbN z#8E{L;<(#*pWBhDhPEWDDYF;^>?7W@=~fC7H(IohLqi^#(^lV7#53QnO{Ij?<>z=KW+vy0Yd-3tb^WnVFERZNeMtc5k5;7=qsQ)+ih8YtTfPQFWTY)Gx9M3VV}w zZxXj`Kfv12u%`XfK$L1h%Vrn_x00U+v%YwTK>5f56xFHOe%8V=@?k1&%UcYR0V&Sr zN$Ibw3F0d@b-f~gS=yA5-rUFRK3D2sCZe=iP<^;5YN=pKasGXzbm*KEX+)`0nexufj=0-xVO6{)0aJp)qpxVx8OtxmvC_S67da7>Kk%`p|EtZ zve=Z$j6CjRQJb&rRs8MI&|4B9+)V9L@%VsDuLu2v+TbMWqY8(;T6xWgxm=oBq={>W z{;^0h6rQ&4o~gh2B(|7 zZ-ycS4o9nQ5IvE#Oi6lwB1yjvC~m52TKl#3Ihh=X?WFTjqgrT7adQlC;9J}(iHXkb z7dT?@Me$_tIaEfUm6yFo37pbBBzO~2oB_}k**(5xrkU;(!~EW41`=*Ox(l|Xl)3|1 zJ?(P(xD-J$Q7jN}ak(5=L<3)?T2Pe@p5-7usFC=J5-J71}_(i=o<={3ARODC9R@4KQmF~#kQfnTdy6n^2f!IT+1R1;P2Nc)0Ju{&hy>VwXk%1(_Jk2?XkVQ!>If{dMT}}EfmxzsDd&UvRf?;iU8hd>|n5_%f4=k$lt--N5kM_=4^E2v^?US&p;1C zd@3_IR$1?G-e%`i1@rPxrVKMDGLO7LkfHoO3N1sUYZYe6X(H-d$ih_@H$m3z^%>Z_ z=S)&6)AmjDH^c3c?ME@ z?v(y=Qf@-S8xb`d7q=E(GA&?;EYaSl**cQX-^<=E%wUq}PTl{dsi79_g4CO|{chPp z46|K=DLz#fHW8nt>6uzg2=IU5*$gMm>5H@KekKg)cNVL?i?pRt)-L6*)D?q6ueF`X zbR4(jO)2!vt>rI_SpbRlmi9%#UP*O~&vKGnO~0}bkXDix+WdrbnRDhGm7#qg;-io( zKR!Lk$+H-ZQ+~wRA7E-s!N8TtrTC0Ig4u+(kxlfy#*;M`wZsG*1L$cb-N%B3!pA{^ zN9E9fLg)cnq)+)Lsg^(54ig+pmQf!@Sx=_}Ml?lG9%L2TZmgBUpIBq%85NIC&t1~d zfLZlT$p{8R`g_%LMJnj_IXXxG>e5sBLg-?+L(|^kI#-tCKk=pVc=OFt^&y&*Kg^!7 zOng=3`GwmZaplMe07=|J!6|C($puXTur2UjW@P>lIEwi!sHd5OxIlPLcO?@tkd3$Y z3JSerJqxMV5+ojLyX#5<8`XKN==)r8tb&e3m2`))rUurZCM#5}B_hxf(9Ak(WLaA3 zgWPkG0K`ETSHKo*M`eF0u^MsSxY3468SA~oK8Qj>68wn>kn|-pz}cv$2~OkaVh!i) zV#Buo*A_Zy<2XZZ1SZOqOYxPm;NMW4Qzrae#8j1Kf(+(YbrcgyU9S%^lmn~nALdMU zsX(YYHTg#}Nn-|ef?MOSum>_bq34d;N}bhEe2OdkSXNsAv-MsL<&)(Mzq z>#!u+Lwc(KKT`KSynDzJ2#BFmko8R`+c#5Pz`P_o9o`jqy8n2KX(?Wje!) zq8IXUP?Yox<2WjUM>r_J*^TwI?i}<^x?{Fz7xhC>B1XBt>?Rr^Z`h5~{oP1pNt8l< zTtgh7!Z32@++bRmvR|g17IR7BeIef=R-EblHRE=9g}ln-rd`$_kOS(3cwEO{W~krJ zL&y^T;tuYdpZrRz=fh@%X&+SWCwN>8os>NTS*VJwe);7eaDQgd zRhYgqh~E7Fr_Iq_pn6M~Z{Ijj|2zLqdf=l<%G3Ullp{n3m~=#AK^G{MDU(54L(W9P z=5$y*rS_Lrsh};WtQP(eKe4vok-`1IZ*B#K@sG_Q)n8W9!llwbmsfg8iqKyVY8~&o z)m`O<<@J5THzmII?|5haJd;v2P{VvH>&<+A>z!B-#p7A=!7TQX|E75j1K>>njLh{Kk&Dnq32WipxbXAxM6cS70=AW8&C;FKaH6qQQ%|DD&ge}%MV4Kd zjz<3->FyJkhJHDKi{^i@Fx3>Uti=n*uanDHM?jB-U$d+NX9HyuqZ0Kc- zhg63F`yb^Q&8^K-L#_&ODmubE0w36NPG36u*DkjJ8qj#wExQE_vvP+D;#ibk_q~hk zTwGwmn_M2@(;(gWgn~3*E&I>7$7}Wc3fk2HPTj0kQKkGZryqoAk+yY&uV687hKQ2Z zu1{zDf#twm-!PT9s+~3bEt9)e&gNMWFN!|xaXrxX3F6g_{0=m3o@0i6eMQtU{Vmq{ zMvD}}e}9p0q8W(*|8AEa{`cj%`cJH+nKGy(XH5pQcT){&n0175ncyLal72CS(iY03 zdQDt_;~e%dw2|decE|CS+tu&3tGqt2)&9o*uKj(_{g|z^0&Fv1#qFUr|8c7PCD7_uPr&N1!T|e2PR@trQqtfvdcf%sSa! zOQMSS#70)Xqr9!qeFX-vh@F<0iP@KWbpGCaCms4jtT7R+6cW=jvuk~GIcm$$*SBox zuLs|hr_2%VLad4Z`{~yY}>YN+h*fz zW81c!#mDhC2lP0-=jS$&U<&SUiV@E$E`hRu(cIV=Ob@H)72LpgV$@z7JTJ=LiX=@WD8sNWe7bchr{LA#n)>iH zCE08?K{UlMX4!q+_0;wDd?ZuL_fCmi9d9h_zU3&g62h?vJewS~!o%%9SZ7m`1&3^nDsC6Tl5aM6a%| zp2;jffUOtsC;Ph85gl|!k+)Yp|@W}io%w#-Y!C6 zvDz}H$75>-hEX9GoLRPZR&$q4pbKv;wFz)p=c6~OR(v0ILh%)-NLi-3)CCGS$RAXJ z{hDo?XiIe>%*3og{)P8m|C>QScXh`4@<-_sF4RgoXud=xNt3(BA8T7yEU?6e^-GOb zi{RFFIM^f^G9$l5qE(F8Jx4`;vsUD-$;wP4RL<%GC0d+i5aSJG=G?$KGHM5*zLslU-kkAWYC#i?>cGKp`qoW6>0p|MXm*tyB3&su4qYLvQ8GW4MzLV{k}YSjI#XNJ zx$_OcRB|ThQK7}LboHdj2fE#*95|^oShz0 zUj~7(!j;H@OR(FUs-Ar_urguHkIa*{$V-Mdo2DC(;v%^!*b=_iV65ilAWq@j3K-*S z9@yCX4&iwsy-xY_k?Dm3!iyC-RE8qaiyA|G{G0HwBn_Is5*T|I7|vyBU|n~PWSRu< zRDw`CSy-+Y*uT5W28Y;|;kEgz4btI*`ftBI`>i2DV*r>r%4ewQ2{Y6srIrD^NRY+R zI6pkjX`x@=RIip~A`Nxy_b$4lBkY?juI1%%0@D1>^%F7V9q4_w(Y{ z?v9gLsDL5s1IKe<^%zlo2N##CsKPgB1iRY*}dJGDE@Wm{Y(`NO9{4VJie>74v`YYmhLn?6kCPv2e4Gfm}xvoz=HO5&t1gyiJ zE6zxq+I+hC1m_5`)6~(t7f``N zGr(klF%;|iq~|Q1$UL9}imOO5{cF&88B8^ewYybd+Llfx39jYwTES}1z7{x+WXkZ z02AWJEWML}a0R^~I3jdVF4~(&WNrzuxehlS=v67shiuYxL|Hm8UVuDx!5YH*06V9+ zCEsJJ&8U`iq|1wp`uAytlK=a!9m|IVOF7+wFZuis$cYF6Fl@7E9{^p?3A?!@x12*ESxn?hXp>1@TqD zsQ4>1%DiHM_5lLG=O$r&{}zTQX&wNTpX z+JRB9TD0B;225}P10UvfS_(Y*I_zT}^$l$a>8E?uqNf~Xkh=Hx5Etv2@{^sCXKDxOxlw) zrE0-U#;uN$D#ZT6%xwV?(lL``6Q04t6IcsF7k!QK{>M>Ifhv(bl&$y(j@3URhFbG6 zMEVAn4V_@2#Qa7Z$)J9V;M)g%IkB0P#If9-!z0%E2O90}S$Vp5vR3cPfP)`}z>+7+ zvx0wk^~3xtEih3kG^~b~jkHz&pbYvnrH_vu82b2mK9}b#xgSmZhn`Y!NS0(@AzkYi z0n@ve^(Z97fw}7;3&Ny#JXCYxHGJmL?q*&;mMBJZvz^`gkL`uu)s^LJo6EmjI;txz z-fCjl5jpak_USfxxBp3Z!)<-mS#3)>Ot6pG0X8`*0L-uXmOFOj9~(kH&(f){e?PyJ6~4O&|2G%7Ahz9soiNlIV3j$hrJ*0xgW8P2Ma5Q#G9KehKj zVmka|Jk6D`i`1h`pjBe2vM8?;4$G*cx=q>1{}!6R-sE`9Gm0ti{zOE)bF*j1wmSm7 z@d8(tZIRV8gw&eQrkvo4PK;`^lFQ3lY>sA62Kww;lHFzV2JUBQ0ylHUO_|cD-$UlP zN?IANz(lp=AGN0+$%B4s{f_2IciW4`+3CfqK*&zs{f$+4VGhj@oM=D)9Q}^LN?hM+ z$>{C!bAr=*+!twQ(gD@nlP7Ai?2b+nCe7gYkRtHRuDs^lu=@lm+2_qw@82`ezEu<$QR@(vUtZ5RAGBQti_j%D=I zkAfn+mc(SUq@-3e9X^)^Y6Y-&pI_I@&-BBzMFHyfit4RdxMh5^7rThJp}|=MLZpX~ zCX!caD_~F=VoI-+fNY*`r{?nPFd{4a2=KO{qBSrMG9VbC73%Svm%{c+%NJ*~@pfX}#=4~BswMhvx0_C3svZUZe^m=Dhj21i(yJ>|Z#85=oo3K)5Y zwQpVBmpz`r<)6@?c?VZ{t;$zA<2b~kQl#n7U~gIT5~#jSd{45oKi7st&o_mm+g!R~ zc_)iT`()nCCqm|{Vm^Y`xO0RnYzyr%x45kxfY?9TTsT3PWYvy1zHpnwIhIqr7%y%Z z^-9zZbTGNHVsZ&jQ@bj(0-HW002;4m-s_3kfZX&)ipdkBp4R$@%6HHOT*s}&OeWN} zDx-}%vGansp32+%f>cEnuW>Z4W$O%gk7uZN5hVxUfb`Zv{vHGBwgsO?9!1d|)4DLd zk-JbWy>p7hD`XJ?=7laF6+vuw^jeXef;H9F^VEcUY-(^>7T^X2$N|UoE=Pt zpZ?80_|2Rx8#wH-ddK|q9$T!l_!c63I$*jtNeXA8Xc~bB`c4ove5*EWN-VLPh|ez) zc1=M>{VJptjwTiG99+u;;7bh`5p$7FlE#R3Y9ynfT`?Q8XPRU9*CIwRkS^0k$GbEU zx3Ni~Vh?5u>LW??{7-2S!&BE!6h#fjCham* zT+?$yM|2V2x#vB=Y=w_=L$^c6SRdPC(tAc?^PY_Cq`?L$;2&B*%J$3d@ z9!t>_!9u)BKQq!UD_Yv3deNif3A)%lo%ZWjsM64aPYPdY-EzbKB>Excrrb3Pc7*AW z{$?v?t;$rVWq{5NL|y!XmTF1L_c6pd9J45n=6CwNW~tJfZ&MV>RuQ+HvdNPqOqK8) zf}()Ogh+B|OUptz?IWbitS$AUC_1B2AEvLPfEa^szL=PhnhZ|B4t0!~s2jjumTRe2 z2b88h@#OSAJt|sx+jw6!YDTMU70GU+A+^w#ykKh09#lermAyt1HmRu-IMRcS2w?#l z`yI7%IiE8cmm${E7}50*X$B*C>xY4-UiV2rHP!;e^ziN0>tdxE?r0`M{T0!_9jj1O z3A1N_bDd!3+2xS}MeS^G4pqCqm+PCJVcp|~MmUlmhk5aD0|a8+$-*JrFv2rorTF&r zGuXe20!$Ua8kS+VU0XOXs|6YmUM!&Z_0}OKb@}l`*@`v^IX5#3K(VJ|G>UE(_yQzKt!`Cw|JktqhR- ztIl=LN};gishw0>9PgN;uD*0se%pFyyhW*Zhh%3AgQ&99&9shtS~jtef^1!lSX)8U z?J&@Tr?y)$&FdCDyUnX-_5~k1_c_`Zm`&m;$uHG@k6aNcimNtf-!^_StMVdae zbY2H!AXmOc&~R1ZqSM4z5Pehc+9loMl;((?+aMwGjIs|0SD3Z)YwBbI0;0Y8%YzU&pjs+Ch^Wvc+1**vPi=RJB>>yMICwB=P#ya7%UoR!hxs}#QVX2 zPrFPowqP&te4%kKgZJoeaMa)f=fW!^tjyMfl>pA-J}6$^2JQxd`Ss%0AF=STgWRWL+V z@>1pgp>m&9VHTw)vU3U^!!mReblgs;Yv>raFqN3!U17;V;>6w4i%S7O_Er!%;r#$U zI6Wf+)@?f&2>p2E`5Dwy z-Zi+aub*}-7VmbprAl?;>FJb{di4X~zt5UM87k$hP$P;aHc(+~YWm>H#f6R_(NGr) z&hdEcM%AUjz==_5K}2ZfI;e^;=0kDT;;l+?K;bv)sY(`*h7H=-or*vHYY3^tB0G%b z5ar>y@ZG>`{L?f2`Gv6M;@)|KvSq(&L6uGzmYB?}V(tWy)XG9xt3W)eV zWhmOY?CJUR-96SBoH-04_qS;^W;cdO9+X!T2wTh$u`bKOh5m0|)p~<|7t2 z`7JcV%Fx5BtDf4<$&tC$q|0s=*yQiQ0jH?ks32dY1&S4sT!rHoEgA?3ZqYbhwJcW= zOIILCepk|QfL2lwAh(K-K`t-gXP63i%_?d88#_)wUcFskVgjUPZ7Km7k5N*|@qtEy zs)xmA2rtOmxK4}ivC@%u^Lxl+0@QRPV<5GS)C_EfEyO54J&GgSyXLK{3kT^B)YCn}W6)yiyf?l(Ov%1p3EXzZGz?iV^2uabYl&~(VCc2jFE zE^}rmoZm|0{RHG6q&vtBM?f}NzFnXp>7PcZk<90)By!e3jc8zSw$!tDkxRW~6l1i00WYC_mIKUiSP&?H=8AonYZ^x-R)?V>CZyQ@O z=F`#D(Syvntf~9k+3(it_1Fq`?iqMae(22W;Jjttw*&09tMDdIB;zgr7Fo07>qtub zd!b>ErohUi^u8jBGs6Q+n8(0JbN=ZCMII(Z7(`-PtVHz6enI*{2+BV>&qH> zRl4@TmLW1Tr@LI1P+2DZ%IaAhYL(*}QBgc%)osE==lE=uZvydx+vJ*Kf=B1vIQtT_ z)ws$eC8l2;f(B9reEY8HVD%kaJlB|iqRZ?gE;W2NM4zz_T*a{ zlT&3d5EFVqVjESmPI4%TJcymM_DowIeOeg0gKbp*WYHt;5k5ayvFvi8vU98{h@K`4 z&eE|;WRXqft}ULLhSNLZ6;9>Z5z)zdQcA2$$l%bkDIap9Xlmb5Rq6<=OI;18IRs%r0)OE;@U|-)YwxuJyzX~7$e{635}lGa{xUdrO~Q0ukElvNrw9G|Z)O_5~VZWw-meSfR5 zeW?zWG;%q0g|1o$KMYHUhCzb}ypf&8Dm0p9vW$pv0chwr@37-TVLN-X?P^)6JI~yQ zmWUNUW>8loWc2*qtyUX*c6;^e!o%^yNJ1#Tm$og#b<)yzH6k>z*={iVm7I8ir!WLG z`FqRR+=~)Tl>|pxmz5Q&4r#j85{qAgAX9F58ni`|6>O3j)5e8tL+SFyoKivS?qaRM zhO8)=4-i%KGkr@+$4k}FNCsbIeW8x(iE<8;o6p?%lbD&GKxx>EzokDabD9eD=aOdE zy^+>m{)j`S^VS<525CiYaK!PhS;a|%h0dFj9v^+#UeV8t-62xhqgpM{E9w%O0bF>P zchG+kc(;>O5lpvlBDw7860OK+U?|+OTQ$cO2b@~UO{198{oUiltu+Fv058EaUpsP~ zu9nW23p1iATUH#{LpNTj7>T;YDT+n?{p~DGi_bH|7b*5Tcts4a2dSMnTD@iz8Lb@^ zwt3|`is%q&8GU6*B{ZHng*#p`cQkMxApCXOsXQ+XSWwW1jsZ29wWo$M6t0oj=f`aYQ* zede3V)o1ClN;h~FXE99;)#YtmI%qu;Zm0G>vAohO0c%aZO-q=u+FnIeEWf_99<*_f zC=2w&64d!UDY8@Sr>1q$ZNA5*OcjP8@A|F|1qsM}e+a$-j}oW~wO2iT&-T6v%e z?7=X#XO@gze2EU=Ulbn{SD;ztr%y(XtfldJ2=}7KXhUmzCTu+5^NLB$o01hG1Dnq8 zdOjZ?N!5IQ)KE!s0>!SAi6U!pR30I`39}thf7#X2*VOi5hCCeJ0ni!iXD&aknmO~@ zeF^q;0~dJ#3c@qhPQl^$F=!fmQZgX1`dfmtUaZ~U;?Uk5=N85+S*52vv&ViJk6_nk z6gQ^~c-2nvsT31?9n&-sv*T7191zLkmD>>Ut^KF9?Zg_~EN9YJI*^su<~ja^-x5i{ zU~a?>)VrtcN`enM@E(ljT!m2?d&Vhu9Ev`E7_X7vv*&=b-Pd8NpNk!<=?jhiMW`@W zc6MT(HGUGMyOH7L+A-D2X*D=-dj5g`IrQ*FUh9@|D?6#y$-wx*h|U!e8a!upE+Su! z?}c2(DT#g<6atCUHO6Rf>a`h>SybDp*iQz9vU{Z5eoF}k#NAjv*XF%!i|FnAY_&bk z$Uyc>&?qYiQ?PcGh*?z+O4ZBDoW|B|weqrlj0iVQASVwSOS)c@S-`!PGxu^onhsaC z1}pNMMv%+kGO?V7q+$|FVwovF$gAj-m}i$;5lz2|wo)n5ly%3&;1WS)Ic)4CtS79A zSX+c{Kd9*iB6!PNZ_A#{X-$-87>-aJl*T|)V#nCpNlfdAF%&(gJG19y_AL${sBgLT zRju|o>*F%Or#M*E$h`4t%kqhZE1N)Rc zF=V3f3YSh26RR{yL!s)^N|pxZSIGBcuvz4HFxb6-LrRhqYh!GVX00_CQ_=Uf>d_ss zO-W%Avh*Far)XQ^E@)b zUa50{%#PUc1Y_{_Lgn{L@>k)2-<2Yn>@P4sO{}NvWox&hBYN#8A3T4WJR%)!Lw(W+ zksTGE@@`0yJGmRE^94ZUr<@7NDj4m4w-#Q)6DdnRDL_j}W}ojtlgI6k5K=92)E2<8 zR<=Boz?+jTHV~r>W(k=?;kH0J4%U7uaP0jH2u;y9q9#UDoluFcSBm7zxn{`AI^YdX z8iK?_@CByf!C)+x%r5YUX(~E#R0KzhfsE0aCy{kaglWu%9$0JAiI zk5E+Hl4wBax>S*HG@~qo-%Uj1!07nVb+~=E$HO#In&O=r6o6VZKg2&JVUTOzvrYpE zAaw051XL(=5#*vu0-J=hvBmFy$^0co$%LXGzF>F;OWl$l5qH&@SuP{dx|yOJnh2^2L)kx!1&Fuo*Ik;O^3hf+cGdvcY=BQj`QllJRgxG>heXSL-1!>;OM@L}2 ztwpp%l49m_P675s}bq4KoK>>Lnab8&=?*XhqyfFs&)05vH zdLvJHaPJzlSsc0!Gah7l&x%nZD&%P-u@R@JT#%+rMkf7Q9~|v~hipbfKqvbH1>N)` zEKTZ7#2BN^UVzJsp~5HF%vfHL&f~i@rRKpSmEFO5K~kE8KhG@pud#Sp08>smmbs?^ATecsG0!fmPAyZZXCG>mmONp=AC z+qZV~|33Fsy~K#LHEj5{JX&CK+Ufs(6C3&=goY+0bi=%rZC|(sHrA{kme}rv2N=r# zx!v9E^gM1hbrg|0xoQ>KsO}KLv5=n7Ee^*lC91cVOl%y?#Ix$k6X}b-9A4hClCdkl zGLOfcm{bXtXhmml=FpzZIGXY4sAPj}Ch3A~NfMl{>t(o$t5rfdzLNyTSWIz?V=$}2{(!v9PtiKLg`tp7QSj{kEOk@ztD`xvYR$JpOp!_P3ORCdsHgEU-e7br4 zHtpVhpM5V7J5%d>p12Zj345Fd(C6^DTaF~siFh3)8JX#{>o5<{UD9Fm2$&za&NNn= zZcpQ+xkqK?cR*rDxN)RovoV)$3UAw;;xD_@%xyEXCrqB3NU4~bUQgR^H=BL$oQ@g) z+!dw|g?3j}upgeS6PKM}#9hGYyRaH?a>6)rceTA-ji1CR)yaWDX0Zwce)f%FA*OK! zS~XopxyEpMv0J$2I6c%e4V+%I=qk({1{_#u`zZ@lyC1pQ6y5jEN|EeCl*g3QTf|0T zAuMF5Mt@K>wI)&}HO**p>C7-!R}Qsybiyq!4X?@8{K+Uy*5^x)+HHSxmC-15U0(0B z=z~YnaIdxcM;0lOFlm_uZc@0Hw0XQws3!WVYZ(g0-&zaeV)+H4IiQXX! z2w0qHH-- zdD}SBA(ah14J#ui%4G=^en9Ahez2=FiqhYB%q!t>YTw764w(|-E}3)c)7`Mm z)b!F<4y2$0iXmeN5)lYMO&z_zI?5&4}d}r$w5@sZy2yWl=1itur*j#CE(Su+x&=#Aut&I=D%96 z?_VGR5v|J|ZAl$v=7z`(Rlm5yus1#5YIz5~%EGn5*8iZVjI8SgbD>qt08T9PH{?|B z!G8DSDq>lU5ufdyGL+L!@T|XNW-+T8|bpN=g`Pgv!YY{V@RT0>W_g@!2kYj*IL14J=tV&7Xu=-yQtDJt^~B4@1BXLI3-} zEBwRrAnG*wXQQ@nGn*~d z62&Au@y1|Ypt;lN16JZEgM{Of>6Etotq&Q4`xc!JFXxO#rb)*6O8-cwxTra-5Mf4M z)d1a7$P_Dhc5XV=(w!12KgYz2|79w)PDMJ@?ETX$6@~*9j_86;N@rW9Jnj|y?j}3^ z?MJXs+k{@zxgcEC`*UYcAiR)+I}h~Hc5(7wzxR`uuKORI;t2fUW|$ipyd^+fn3NDI5v(Jc#A;ya#N1}sJP;R*kN0A-Sux0rq>Ae$o3Fl z^h8YZDV*~uy6{T&AVeeMyeTR6KSTr#TAVDc$(4um?rD0}sPvZLtPjM{$3k?eHUeZr z@8qvs8U*V3WDRLouQ34x(w`W<>V+#OEr+JAN^UPIWeu(8*Ga}tu#%kU6b~37p=1RJ zXq^?4Z{D&kY8_UOXV*3lWVbS=!@rl{%q&0r#SMxCL>)?`Cm*QsQR-Fg7S!ljIuQQw z1F`^d&4-Fd@v^_rD@*Ss+&C)SCxEF8@tM_4Eub()Zwkl>DGAeImKYQnpagxQzc%uB z#7$IWRAUtoz5W>c6$aIlbdB_ZhgvBA1$Nc`2aH^DC+_DUKJ)?ySkwh1$`(~1?UUV8;g$;3y2R)MA4&Z zrtG@mb1l|_+CUEyh;BD@&hxl& z)43R+i?|A_AInL;a9Pi_K8YXV$rQ@A>@k*=&}?|Eqc-n>oi#W?Gn3sgNys7WJHzix zspd8}Zwv!f^T#|o)8p{M4k#zwfea&lk)f-Xo*^V%1tlTLLoyNv4uUupr4GO!7%YUs(A#qe8- z4R3GxUp|C_b@T_(I9sPk+1`mKLW&GQ4jgQAk_!x2i<9m?7KI_sC?H_MQ;JYnwhD0| zc7^DYz;l+bLSYRtO+~;rwHqtNGo0xeIl2miEsf2mbM*bbc^*Z1p<*?FX@)207@yNc zG<$b z31yGbcC>7GG9O3+08E5CqId-%|10@mkR3=62;X$C?9sDbwSzkk&eFgp$oh?U{B*Bh zzyEDv`YSY#@LFW5vXR{5)B~c$0S%K)^|;f$)?@!0!J>yi4_>-$`x9qjhmy0u9ns5xv+6A?V17fo!X5Kva zj?TmVpC=yJOJLFd0vQ3PAO>%SCJsIk_&BZN-V0PQfWmw?^ea;9uWw()*3EsMwkA$H z6RxhvUfF-s407d5_o7dwyuiox^E8FC0gF8xJWL3Jq32uIGj#2g)+-?947HmM_25{e zG8QYteGr8$j0G}Wp;vUW^yWus*SX<-VB_~#7J}@M`fXSmfygyz%`dm-!%W6wxtk@G zkOs3tVA)8I_o?ksV+?3>@`!MLtBp^-dZZvf&4!;iRmr~+9Av=YN!-?dqGcl|0WomV zi_gjW)pQCrh}Dd+`@McXA)|6Cla2r)^&dbI3d z5jr9%Z#yrblcoD(ByNnZ`#t0|DI)kx6f=|QFa73tbOX! zuifp?U%zJN_O9Op+rroQln!_gXtfHw?rwtKG_Uqx&(Z9Fh{-OPz@+-)efmy(@(IZa zFm$Ox(q|MmM7N|C?!VZ$vSn{Wu|UH7jh+)f)f~Q$}v8P#m zF%?(AIT2UgxqVmAWwLoI%{iq8bh=q@v}A)_ZvkJ;xda2&XRy`5Gvb4oS~c6Sw!CpH zDAY@phn3WYxBXKZG~^;Oc~(E)ginm`AR#zk_yU)Q*T5iRo@x<5^_yIQ^)nMN{pmLYhuU8CY~Z~B@)`+(p6q7`nQ(`kE9job!3e@0XnBX zcMMMv)E&2i(Mt^vmH2D*9z8MO>I#8%@Xx!iShqt*PdAO~PO%v1B@Bd-Xc@(&ds5;)NkY$H0{cC{{m(1K#ajPZx z>kdK{zj!3482_~4B()43@lMNsdV!1xVRP=k9v0m{{?iLwBI$uQ`F|LO;hy*jVX72o zR9ecKmgc%DF*zJ-S-5a$slZ{JsCSMnK3mL3<;MUfar~fC#lp1bP{cnX*fX=lq>V-t zJRL4aZ`lsy7DqEX20b8EeQ2Eg++HdlMI6OV3jWo#=gT$S1v>dVKl##I|3?Rw!;Kv! z!A4bRHnr8HYXBbi7i0ha)jJ((ENHHiJOn{G6$PZ8gzMcpr*PE*fzJbwwym4>+l zr9cE_7+Rnr`K*iG0F|*;n4ZoVy8W(;rfxZPYxBZJvkm9W=tWSA|DYd}FrTNaQF|qoD_h&0yDUD*Jv>LMg5#TPYmh9Do>4i?qz7!%_)F#r`$ z7gsYoMP~;`GiO&TGZ#rCdsAC8XL=J`BNrDnRfuo@_Ww(1tID`6sH1(_?~B&hN=tqR zX+blwJWJgp7d+>lg<@r;_ngI&6eD=h?oJUi9U~comMxL}g4A-INJ-}XliqMr6M6Oe zRs-GwlHjjw#6_?w{W?xdrQPh`h;yyewG&%dWroZ2YUK3NYZ9t8 zHg9WN>@vUg^fghT1e<8bAmtpU1=T>$l>YwCAg`Z6Yt2@l@=66WoTt9o3|NF^rqE$E z)L3B1#;({ZX+C*Wl649n))Rys+0Bp<)ddNR;3<2<5W@{1zThydZZg5jEQR)eM}uRE z${^-E8FD1z+xgwR8Nh2x{+q5DY=VB$si(eIhXsxT!5>C7B)>An1R|Fau88GnFKj<8 z0&Cki>}f=mQMM$dM-MK28;CUlFQk_LLpm_lHS6t3#aV2uD~@v=tNK&>G7rTgfCD`% zzY&3aM`q6s9lCP>sa{XtgtN*Y-9`SLJDV)fgSc2C*l44JIzV5@Ux=uiEG zR|PA27fe<~3;|@ZA-l|%q$DlXNo?I$5*wUeO$wLCvg4ms0hypuQPDW;r6VgXYVVBy z(KeGN54zH?x2xBn9&|mY{$V%GxgvMh1wD6Eo&lEn(EFWGgf|Wm$Kx?9@imSI9+=TPUfQy&sAz=^tcl$s z(>|-r#o%@hv~M5vghRiG|xKA|9&Xnf8J=9vm;Of{O z8PuJ&@?Z;PA(DmY#3cF(L5^*2X7C4PKqcv9p9IpEX>fA135g@e{-b#A$&q$2)r$&c zZ<#>{IGPr{(+HxECl)n3Tw8W%JHDSmBD>hDq`x}Tt2$YOBJqOS34Ue*pK(+47JDIc z#5gb8$0hf=hBmDe(z1xV9{cg!_LQ;&KYI@k_x@kqo>!IpP1ZkNi9F>0m!vThdn=$4 zzYt?WUXESt?kfqF2Z7JnKKbF%;SBHJ{3!QrujOUDSIIek z^L*`GTuolp?g;pS3PLu2_i68(G!qDe(B`$sAgu`-O5mixs7%f%P*y3o9+Orx=B#B& zRthw#lZ`g5pNu#b?=lXfA*;Z#m9H8bgQ+G1&~rqzljdd8L9PE*4Wyn`M4*bNlP_?Z zW>i^5oko!F+XkLO)&$?Ly#&A5DjUP!79xHJ0lKwUA}`tsm_g?%=u1trrKx4~P8!us zyw0-CS}L@q;?KQoX7q26zURzA%9X1os=NiWsIzv>DhS4*4J;-LXPcfrPQ8PgGLSR z*$?5eZw?mL+uOa@@ieK;P2($>ZzvIO&;}9~I;YX;v9mB(5|E`#J&b2ZEu#M%B^6=u;!YNmXi;It z2S*>g9%R7VKuKyi(Cw*siseI-kcchM##LHr9qOhou}&d4Z4nx!@>zC@w6_HPVxz&BeVfyHdPMN!<9lyvMGrvcuoI0*$2MJ0t> zU=p7Fu7xqOhpy4Aa_K+dV7YCxJE>^qa>8He;C{cM<$$_!k0R(IKAO%`A*5aCxR;6 z@5CZvqczPg(O~VYmz-pL)NJ8N$bdreB?^8?rtCx_EGEx6AO%RnRaRo;^X>`DQgal( zd2djaP^x>+1+c-n!08*s=XcjD>nz&gEk{z@=7A@gjq{wqdER^<=yWYcum3YZE~Em+ z&N7L{$`wUGfsa!f!f7{~Jn1mR-p6a#)3IkuiC?x~#hS3-J2BK`9eWt8K-7!*un&=Y5|#R5&ALF( zdPtx#(bjm&QhZvF;vzaWUes+>=>l7nq3rkLI!2?r8eCLZ5MO&>LHJa}-X^*p1>fEk zb-n>Z^|0VR{ZlUbw`gl<%1Dl2lft4ch2xTB{YnG}J0BonX~o$X8dQgin6!*t`Jo~t z94=icj9P{}fYPu@LFKH>{8FT{7f3%1`~$L_W5OHJ-1R>r?M7KS#jtyFh3td+1vJW# zolI4di~T;=3^>j*|H~`VDmOth_NyWtWX=*a_zHuvX-`mkrNLi~CQ6MCKda{CMqX*l zBmPxGdI9*Ipylg;dy(ctqbk6_u#e85-(Lxr|FvWE#@x-;?xlVLNbEtEPXWgt4h6^!%4B~X(b^1GGNQ$lv}d#%7+>83lC5}b!8MsYd$!sy-91jU^C+`_d+2o||zdUnVs!oS8D zcvqsu9okc(ZMym6sT&bQd|NKiA3Snf7Yq!`!y3Kn+87n~Btz=-OVIL~=TG%SiYs7< zd%tJ1oeezMK+qNCueg;rzd|G+weOx#=B^C!oryz9r$Kgj8hMuzm7_ zxvreK8|`czfE^e6$$ImgWW06X*C+uyG6g_v$N)S{1P*rdO%9wdGg*&cVRHX`0h#%4 zwm9VhYqQP3MwA+gLRSH>LV@|J(um8<85oRF6bVcYnC~xxxT=|f!3IVCnkdi^W#HB4 zDq!1?Z??2WQCKDkR`@|u6|4|(Eg`yzhZMjH9TXuZBJOx&U_dpoQ5mFgk_yB?_?FjYn+yz&D5{*CL8?S18!U5|MI125z+i%+ z>aiP473bs>Perhq$VcHQqNvXGf~n@1EWKP_7Je!V(4DABR67Ksa<085$V?XSQ6F~8 z#h69HAQF({TV%l&B386BFleDz7#IOlZ6J$S2*bdjgraI=F4S2oG-Tn+Ie<>mMNxIO z5~hk{a&eV3*k;6F83Tg?it5?bFxBjnzpRj#MT~$jFvz2*oY)0X+0_kBu(I&s51#q`HUOow8D5M7lF&Mez W(m*lz*HoBlEiM*bU{am~Dx&}eeNGnu diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e093..ff23a68d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..23d15a93 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -112,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -203,7 +205,7 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # and any embedded shellness will be escaped. # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # treated as '${Hostname}' itself on the command line. @@ -211,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 6689b85b..5eed7ee8 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/java/dev/plexapi/sdk/Activities.java b/src/main/java/dev/plexapi/sdk/Activities.java index a759b9c8..ddfb0717 100644 --- a/src/main/java/dev/plexapi/sdk/Activities.java +++ b/src/main/java/dev/plexapi/sdk/Activities.java @@ -3,32 +3,18 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.CancelServerActivitiesBadRequest; -import dev.plexapi.sdk.models.errors.CancelServerActivitiesUnauthorized; -import dev.plexapi.sdk.models.errors.GetServerActivitiesBadRequest; -import dev.plexapi.sdk.models.errors.GetServerActivitiesUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.CancelServerActivitiesRequest; import dev.plexapi.sdk.models.operations.CancelServerActivitiesRequestBuilder; import dev.plexapi.sdk.models.operations.CancelServerActivitiesResponse; import dev.plexapi.sdk.models.operations.GetServerActivitiesRequestBuilder; import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse; -import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.CancelServerActivities; +import dev.plexapi.sdk.operations.GetServerActivities; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; -import java.util.Optional; /** * Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. @@ -39,16 +25,23 @@ import java.util.Optional; * - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) * - The may contain a `Response` object which attributes which represent the result of the asynchronous operation. */ -public class Activities implements - MethodCallGetServerActivities, - MethodCallCancelServerActivities { - +public class Activities { private final SDKConfiguration sdkConfiguration; + private final AsyncActivities asyncSDK; Activities(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncActivities(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncActivities async() { + return asyncSDK; + } /** * Get Server Activities @@ -58,7 +51,7 @@ public class Activities implements * @return The call builder */ public GetServerActivitiesRequestBuilder getServerActivities() { - return new GetServerActivitiesRequestBuilder(this); + return new GetServerActivitiesRequestBuilder(sdkConfiguration); } /** @@ -70,153 +63,11 @@ public class Activities implements * @throws Exception if the API call fails */ public GetServerActivitiesResponse getServerActivitiesDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/activities"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerActivities", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerActivities", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerActivities", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerActivities", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetServerActivitiesResponse.Builder _resBuilder = - GetServerActivitiesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetServerActivitiesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerActivitiesResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerActivitiesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerActivitiesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetServerActivities.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Cancel Server Activities * @@ -225,7 +76,7 @@ public class Activities implements * @return The call builder */ public CancelServerActivitiesRequestBuilder cancelServerActivities() { - return new CancelServerActivitiesRequestBuilder(this); + return new CancelServerActivitiesRequestBuilder(sdkConfiguration); } /** @@ -237,148 +88,15 @@ public class Activities implements * @return The response from the API call * @throws Exception if the API call fails */ - public CancelServerActivitiesResponse cancelServerActivities( - String activityUUID) throws Exception { + public CancelServerActivitiesResponse cancelServerActivities(String activityUUID) throws Exception { CancelServerActivitiesRequest request = CancelServerActivitiesRequest .builder() .activityUUID(activityUUID) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - CancelServerActivitiesRequest.class, - _baseUrl, - "/activities/{activityUUID}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "DELETE"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "cancelServerActivities", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "cancelServerActivities", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "cancelServerActivities", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "cancelServerActivities", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CancelServerActivitiesResponse.Builder _resBuilder = - CancelServerActivitiesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CancelServerActivitiesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CancelServerActivitiesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CancelServerActivitiesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CancelServerActivities.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/AsyncActivities.java b/src/main/java/dev/plexapi/sdk/AsyncActivities.java new file mode 100644 index 00000000..6150ce16 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncActivities.java @@ -0,0 +1,104 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.CancelServerActivitiesRequest; +import dev.plexapi.sdk.models.operations.async.CancelServerActivitiesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.CancelServerActivitiesResponse; +import dev.plexapi.sdk.models.operations.async.GetServerActivitiesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetServerActivitiesResponse; +import dev.plexapi.sdk.operations.CancelServerActivities; +import dev.plexapi.sdk.operations.GetServerActivities; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +/** + * Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. + * Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. + * Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: + * - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. + * - They must contain an `type` which is used by clients to distinguish the specific activity. + * - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) + * - The may contain a `Response` object which attributes which represent the result of the asynchronous operation. + */ +public class AsyncActivities { + private final SDKConfiguration sdkConfiguration; + private final Activities syncSDK; + + AsyncActivities(Activities syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Activities sync() { + return syncSDK; + } + + + /** + * Get Server Activities + * + *

Get Server Activities + * + * @return The async call builder + */ + public GetServerActivitiesRequestBuilder getServerActivities() { + return new GetServerActivitiesRequestBuilder(sdkConfiguration); + } + + /** + * Get Server Activities + * + *

Get Server Activities + * + * @return CompletableFuture<GetServerActivitiesResponse> - The async response + */ + public CompletableFuture getServerActivitiesDirect() { + AsyncRequestlessOperation operation + = new GetServerActivities.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Cancel Server Activities + * + *

Cancel Server Activities + * + * @return The async call builder + */ + public CancelServerActivitiesRequestBuilder cancelServerActivities() { + return new CancelServerActivitiesRequestBuilder(sdkConfiguration); + } + + /** + * Cancel Server Activities + * + *

Cancel Server Activities + * + * @param activityUUID The UUID of the activity to cancel. + * @return CompletableFuture<CancelServerActivitiesResponse> - The async response + */ + public CompletableFuture cancelServerActivities(String activityUUID) { + CancelServerActivitiesRequest request = + CancelServerActivitiesRequest + .builder() + .activityUUID(activityUUID) + .build(); + AsyncRequestOperation operation + = new CancelServerActivities.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncAuthentication.java b/src/main/java/dev/plexapi/sdk/AsyncAuthentication.java new file mode 100644 index 00000000..911990c8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncAuthentication.java @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationRequest; +import dev.plexapi.sdk.models.operations.GetTransientTokenQueryParamType; +import dev.plexapi.sdk.models.operations.GetTransientTokenRequest; +import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequest; +import dev.plexapi.sdk.models.operations.Scope; +import dev.plexapi.sdk.models.operations.async.GetSourceConnectionInformationRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetSourceConnectionInformationResponse; +import dev.plexapi.sdk.models.operations.async.GetTokenDetailsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetTokenDetailsResponse; +import dev.plexapi.sdk.models.operations.async.GetTransientTokenRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetTransientTokenResponse; +import dev.plexapi.sdk.models.operations.async.PostUsersSignInDataRequestBuilder; +import dev.plexapi.sdk.models.operations.async.PostUsersSignInDataResponse; +import dev.plexapi.sdk.operations.GetSourceConnectionInformation; +import dev.plexapi.sdk.operations.GetTokenDetails; +import dev.plexapi.sdk.operations.GetTransientToken; +import dev.plexapi.sdk.operations.PostUsersSignInData; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls regarding authentication for Plex Media Server + */ +public class AsyncAuthentication { + private final SDKConfiguration sdkConfiguration; + private final Authentication syncSDK; + + AsyncAuthentication(Authentication syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Authentication sync() { + return syncSDK; + } + + + /** + * Get a Transient Token + * + *

This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. + * + * @return The async call builder + */ + public GetTransientTokenRequestBuilder getTransientToken() { + return new GetTransientTokenRequestBuilder(sdkConfiguration); + } + + /** + * Get a Transient Token + * + *

This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. + * + * @param type `delegation` - This is the only supported `type` parameter. + * @param scope `all` - This is the only supported `scope` parameter. + * @return CompletableFuture<GetTransientTokenResponse> - The async response + */ + public CompletableFuture getTransientToken(GetTransientTokenQueryParamType type, Scope scope) { + GetTransientTokenRequest request = + GetTransientTokenRequest + .builder() + .type(type) + .scope(scope) + .build(); + AsyncRequestOperation operation + = new GetTransientToken.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Source Connection Information + * + *

If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token. + * Note: requires Plex Media Server >= 1.15.4. + * + * @return The async call builder + */ + public GetSourceConnectionInformationRequestBuilder getSourceConnectionInformation() { + return new GetSourceConnectionInformationRequestBuilder(sdkConfiguration); + } + + /** + * Get Source Connection Information + * + *

If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token. + * Note: requires Plex Media Server >= 1.15.4. + * + * @param source The source identifier with an included prefix. + * @return CompletableFuture<GetSourceConnectionInformationResponse> - The async response + */ + public CompletableFuture getSourceConnectionInformation(String source) { + GetSourceConnectionInformationRequest request = + GetSourceConnectionInformationRequest + .builder() + .source(source) + .build(); + AsyncRequestOperation operation + = new GetSourceConnectionInformation.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Token Details + * + *

Get the User data from the provided X-Plex-Token + * + * @return The async call builder + */ + public GetTokenDetailsRequestBuilder getTokenDetails() { + return new GetTokenDetailsRequestBuilder(sdkConfiguration); + } + + /** + * Get Token Details + * + *

Get the User data from the provided X-Plex-Token + * + * @return CompletableFuture<GetTokenDetailsResponse> - The async response + */ + public CompletableFuture getTokenDetailsDirect() { + return getTokenDetails(Optional.empty()); + } + + /** + * Get Token Details + * + *

Get the User data from the provided X-Plex-Token + * + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetTokenDetailsResponse> - The async response + */ + public CompletableFuture getTokenDetails(Optional serverURL) { + AsyncRequestlessOperation operation + = new GetTokenDetails.Async(sdkConfiguration, serverURL); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get User Sign In Data + * + *

Sign in user with username and password and return user data with Plex authentication token + * + * @return The async call builder + */ + public PostUsersSignInDataRequestBuilder postUsersSignInData() { + return new PostUsersSignInDataRequestBuilder(sdkConfiguration); + } + + /** + * Get User Sign In Data + * + *

Sign in user with username and password and return user data with Plex authentication token + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<PostUsersSignInDataResponse> - The async response + */ + public CompletableFuture postUsersSignInData(PostUsersSignInDataRequest request) { + return postUsersSignInData(request, Optional.empty()); + } + + /** + * Get User Sign In Data + * + *

Sign in user with username and password and return user data with Plex authentication token + * + * @param request The request object containing all the parameters for the API call. + * @param serverURL Overrides the server URL. + * @return CompletableFuture<PostUsersSignInDataResponse> - The async response + */ + public CompletableFuture postUsersSignInData(PostUsersSignInDataRequest request, Optional serverURL) { + AsyncRequestOperation operation + = new PostUsersSignInData.Async(sdkConfiguration, serverURL); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncButler.java b/src/main/java/dev/plexapi/sdk/AsyncButler.java new file mode 100644 index 00000000..e93b92d9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncButler.java @@ -0,0 +1,209 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.PathParamTaskName; +import dev.plexapi.sdk.models.operations.StartTaskRequest; +import dev.plexapi.sdk.models.operations.StopTaskRequest; +import dev.plexapi.sdk.models.operations.TaskName; +import dev.plexapi.sdk.models.operations.async.GetButlerTasksRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetButlerTasksResponse; +import dev.plexapi.sdk.models.operations.async.StartAllTasksRequestBuilder; +import dev.plexapi.sdk.models.operations.async.StartAllTasksResponse; +import dev.plexapi.sdk.models.operations.async.StartTaskRequestBuilder; +import dev.plexapi.sdk.models.operations.async.StartTaskResponse; +import dev.plexapi.sdk.models.operations.async.StopAllTasksRequestBuilder; +import dev.plexapi.sdk.models.operations.async.StopAllTasksResponse; +import dev.plexapi.sdk.models.operations.async.StopTaskRequestBuilder; +import dev.plexapi.sdk.models.operations.async.StopTaskResponse; +import dev.plexapi.sdk.operations.GetButlerTasks; +import dev.plexapi.sdk.operations.StartAllTasks; +import dev.plexapi.sdk.operations.StartTask; +import dev.plexapi.sdk.operations.StopAllTasks; +import dev.plexapi.sdk.operations.StopTask; +import java.util.concurrent.CompletableFuture; + +/** + * Butler is the task manager of the Plex Media Server Ecosystem. + */ +public class AsyncButler { + private final SDKConfiguration sdkConfiguration; + private final Butler syncSDK; + + AsyncButler(Butler syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Butler sync() { + return syncSDK; + } + + + /** + * Get Butler tasks + * + *

Returns a list of butler tasks + * + * @return The async call builder + */ + public GetButlerTasksRequestBuilder getButlerTasks() { + return new GetButlerTasksRequestBuilder(sdkConfiguration); + } + + /** + * Get Butler tasks + * + *

Returns a list of butler tasks + * + * @return CompletableFuture<GetButlerTasksResponse> - The async response + */ + public CompletableFuture getButlerTasksDirect() { + AsyncRequestlessOperation operation + = new GetButlerTasks.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Start all Butler tasks + * + *

This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: + * 1. Any tasks not scheduled to run on the current day will be skipped. + * 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. + * 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. + * 4. If we are outside the configured window, the task will start immediately. + * + * @return The async call builder + */ + public StartAllTasksRequestBuilder startAllTasks() { + return new StartAllTasksRequestBuilder(sdkConfiguration); + } + + /** + * Start all Butler tasks + * + *

This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: + * 1. Any tasks not scheduled to run on the current day will be skipped. + * 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. + * 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. + * 4. If we are outside the configured window, the task will start immediately. + * + * @return CompletableFuture<StartAllTasksResponse> - The async response + */ + public CompletableFuture startAllTasksDirect() { + AsyncRequestlessOperation operation + = new StartAllTasks.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Stop all Butler tasks + * + *

This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. + * + * @return The async call builder + */ + public StopAllTasksRequestBuilder stopAllTasks() { + return new StopAllTasksRequestBuilder(sdkConfiguration); + } + + /** + * Stop all Butler tasks + * + *

This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. + * + * @return CompletableFuture<StopAllTasksResponse> - The async response + */ + public CompletableFuture stopAllTasksDirect() { + AsyncRequestlessOperation operation + = new StopAllTasks.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Start a single Butler task + * + *

This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: + * 1. Any tasks not scheduled to run on the current day will be skipped. + * 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. + * 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. + * 4. If we are outside the configured window, the task will start immediately. + * + * @return The async call builder + */ + public StartTaskRequestBuilder startTask() { + return new StartTaskRequestBuilder(sdkConfiguration); + } + + /** + * Start a single Butler task + * + *

This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: + * 1. Any tasks not scheduled to run on the current day will be skipped. + * 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. + * 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. + * 4. If we are outside the configured window, the task will start immediately. + * + * @param taskName the name of the task to be started. + * @return CompletableFuture<StartTaskResponse> - The async response + */ + public CompletableFuture startTask(TaskName taskName) { + StartTaskRequest request = + StartTaskRequest + .builder() + .taskName(taskName) + .build(); + AsyncRequestOperation operation + = new StartTask.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Stop a single Butler task + * + *

This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint. + * + * @return The async call builder + */ + public StopTaskRequestBuilder stopTask() { + return new StopTaskRequestBuilder(sdkConfiguration); + } + + /** + * Stop a single Butler task + * + *

This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint. + * + * @param taskName The name of the task to be started. + * @return CompletableFuture<StopTaskResponse> - The async response + */ + public CompletableFuture stopTask(PathParamTaskName taskName) { + StopTaskRequest request = + StopTaskRequest + .builder() + .taskName(taskName) + .build(); + AsyncRequestOperation operation + = new StopTask.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncHubs.java b/src/main/java/dev/plexapi/sdk/AsyncHubs.java new file mode 100644 index 00000000..0e1b6a8c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncHubs.java @@ -0,0 +1,169 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetGlobalHubsRequest; +import dev.plexapi.sdk.models.operations.GetLibraryHubsRequest; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedRequest; +import dev.plexapi.sdk.models.operations.OnlyTransient; +import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient; +import dev.plexapi.sdk.models.operations.async.GetGlobalHubsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetGlobalHubsResponse; +import dev.plexapi.sdk.models.operations.async.GetLibraryHubsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetLibraryHubsResponse; +import dev.plexapi.sdk.models.operations.async.GetRecentlyAddedRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetRecentlyAddedResponse; +import dev.plexapi.sdk.operations.GetGlobalHubs; +import dev.plexapi.sdk.operations.GetLibraryHubs; +import dev.plexapi.sdk.operations.GetRecentlyAdded; +import java.lang.Double; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. + */ +public class AsyncHubs { + private final SDKConfiguration sdkConfiguration; + private final Hubs syncSDK; + + AsyncHubs(Hubs syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Hubs sync() { + return syncSDK; + } + + + /** + * Get Global Hubs + * + *

Get Global Hubs filtered by the parameters provided. + * + * @return The async call builder + */ + public GetGlobalHubsRequestBuilder getGlobalHubs() { + return new GetGlobalHubsRequestBuilder(sdkConfiguration); + } + + /** + * Get Global Hubs + * + *

Get Global Hubs filtered by the parameters provided. + * + * @return CompletableFuture<GetGlobalHubsResponse> - The async response + */ + public CompletableFuture getGlobalHubsDirect() { + return getGlobalHubs(Optional.empty(), Optional.empty()); + } + + /** + * Get Global Hubs + * + *

Get Global Hubs filtered by the parameters provided. + * + * @param count The number of items to return with each hub. + * @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). + * @return CompletableFuture<GetGlobalHubsResponse> - The async response + */ + public CompletableFuture getGlobalHubs(Optional count, Optional onlyTransient) { + GetGlobalHubsRequest request = + GetGlobalHubsRequest + .builder() + .count(count) + .onlyTransient(onlyTransient) + .build(); + AsyncRequestOperation operation + = new GetGlobalHubs.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Recently Added + * + *

This endpoint will return the recently added content. + * + * @return The async call builder + */ + public GetRecentlyAddedRequestBuilder getRecentlyAdded() { + return new GetRecentlyAddedRequestBuilder(sdkConfiguration); + } + + /** + * Get Recently Added + * + *

This endpoint will return the recently added content. + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetRecentlyAddedResponse> - The async response + */ + public CompletableFuture getRecentlyAdded(GetRecentlyAddedRequest request) { + AsyncRequestOperation operation + = new GetRecentlyAdded.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get library specific hubs + * + *

This endpoint will return a list of library specific hubs + * + * @return The async call builder + */ + public GetLibraryHubsRequestBuilder getLibraryHubs() { + return new GetLibraryHubsRequestBuilder(sdkConfiguration); + } + + /** + * Get library specific hubs + * + *

This endpoint will return a list of library specific hubs + * + * @param sectionId the Id of the library to query + * @return CompletableFuture<GetLibraryHubsResponse> - The async response + */ + public CompletableFuture getLibraryHubs(double sectionId) { + return getLibraryHubs(sectionId, Optional.empty(), Optional.empty()); + } + + /** + * Get library specific hubs + * + *

This endpoint will return a list of library specific hubs + * + * @param sectionId the Id of the library to query + * @param count The number of items to return with each hub. + * @param onlyTransient Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). + * @return CompletableFuture<GetLibraryHubsResponse> - The async response + */ + public CompletableFuture getLibraryHubs( + double sectionId, Optional count, + Optional onlyTransient) { + GetLibraryHubsRequest request = + GetLibraryHubsRequest + .builder() + .sectionId(sectionId) + .count(count) + .onlyTransient(onlyTransient) + .build(); + AsyncRequestOperation operation + = new GetLibraryHubs.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncLibrary.java b/src/main/java/dev/plexapi/sdk/AsyncLibrary.java new file mode 100644 index 00000000..ec837ef3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncLibrary.java @@ -0,0 +1,1103 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.models.operations.DeleteLibraryRequest; +import dev.plexapi.sdk.models.operations.Force; +import dev.plexapi.sdk.models.operations.GetActorsLibraryQueryParamType; +import dev.plexapi.sdk.models.operations.GetActorsLibraryRequest; +import dev.plexapi.sdk.models.operations.GetCountriesLibraryQueryParamType; +import dev.plexapi.sdk.models.operations.GetCountriesLibraryRequest; +import dev.plexapi.sdk.models.operations.GetFileHashRequest; +import dev.plexapi.sdk.models.operations.GetGenresLibraryQueryParamType; +import dev.plexapi.sdk.models.operations.GetGenresLibraryRequest; +import dev.plexapi.sdk.models.operations.GetLibraryDetailsRequest; +import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest; +import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllRequest; +import dev.plexapi.sdk.models.operations.GetMediaArtsRequest; +import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequest; +import dev.plexapi.sdk.models.operations.GetMediaPostersRequest; +import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequest; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryRequest; +import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataRequest; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequest; +import dev.plexapi.sdk.models.operations.GetSearchLibraryQueryParamType; +import dev.plexapi.sdk.models.operations.GetSearchLibraryRequest; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamIncludeGuids; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamType; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentRequest; +import dev.plexapi.sdk.models.operations.IncludeDetails; +import dev.plexapi.sdk.models.operations.PostMediaArtsRequest; +import dev.plexapi.sdk.models.operations.PostMediaPosterRequest; +import dev.plexapi.sdk.models.operations.async.DeleteLibraryRequestBuilder; +import dev.plexapi.sdk.models.operations.async.DeleteLibraryResponse; +import dev.plexapi.sdk.models.operations.async.GetActorsLibraryRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetActorsLibraryResponse; +import dev.plexapi.sdk.models.operations.async.GetAllLibrariesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetAllLibrariesResponse; +import dev.plexapi.sdk.models.operations.async.GetCountriesLibraryRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetCountriesLibraryResponse; +import dev.plexapi.sdk.models.operations.async.GetFileHashRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetFileHashResponse; +import dev.plexapi.sdk.models.operations.async.GetGenresLibraryRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetGenresLibraryResponse; +import dev.plexapi.sdk.models.operations.async.GetLibraryDetailsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetLibraryDetailsResponse; +import dev.plexapi.sdk.models.operations.async.GetLibraryItemsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetLibraryItemsResponse; +import dev.plexapi.sdk.models.operations.async.GetLibrarySectionsAllRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetLibrarySectionsAllResponse; +import dev.plexapi.sdk.models.operations.async.GetMediaArtsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetMediaArtsResponse; +import dev.plexapi.sdk.models.operations.async.GetMediaMetaDataRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetMediaMetaDataResponse; +import dev.plexapi.sdk.models.operations.async.GetMediaPostersRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetMediaPostersResponse; +import dev.plexapi.sdk.models.operations.async.GetMetadataChildrenRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetMetadataChildrenResponse; +import dev.plexapi.sdk.models.operations.async.GetRecentlyAddedLibraryRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetRecentlyAddedLibraryResponse; +import dev.plexapi.sdk.models.operations.async.GetRefreshLibraryMetadataRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetRefreshLibraryMetadataResponse; +import dev.plexapi.sdk.models.operations.async.GetSearchAllLibrariesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetSearchAllLibrariesResponse; +import dev.plexapi.sdk.models.operations.async.GetSearchLibraryRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetSearchLibraryResponse; +import dev.plexapi.sdk.models.operations.async.GetTopWatchedContentRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetTopWatchedContentResponse; +import dev.plexapi.sdk.models.operations.async.PostMediaArtsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.PostMediaArtsResponse; +import dev.plexapi.sdk.models.operations.async.PostMediaPosterRequestBuilder; +import dev.plexapi.sdk.models.operations.async.PostMediaPosterResponse; +import dev.plexapi.sdk.operations.DeleteLibrary; +import dev.plexapi.sdk.operations.GetActorsLibrary; +import dev.plexapi.sdk.operations.GetAllLibraries; +import dev.plexapi.sdk.operations.GetCountriesLibrary; +import dev.plexapi.sdk.operations.GetFileHash; +import dev.plexapi.sdk.operations.GetGenresLibrary; +import dev.plexapi.sdk.operations.GetLibraryDetails; +import dev.plexapi.sdk.operations.GetLibraryItems; +import dev.plexapi.sdk.operations.GetLibrarySectionsAll; +import dev.plexapi.sdk.operations.GetMediaArts; +import dev.plexapi.sdk.operations.GetMediaMetaData; +import dev.plexapi.sdk.operations.GetMediaPosters; +import dev.plexapi.sdk.operations.GetMetadataChildren; +import dev.plexapi.sdk.operations.GetRecentlyAddedLibrary; +import dev.plexapi.sdk.operations.GetRefreshLibraryMetadata; +import dev.plexapi.sdk.operations.GetSearchAllLibraries; +import dev.plexapi.sdk.operations.GetSearchLibrary; +import dev.plexapi.sdk.operations.GetTopWatchedContent; +import dev.plexapi.sdk.operations.PostMediaArts; +import dev.plexapi.sdk.operations.PostMediaPoster; +import java.lang.Double; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls interacting with Plex Media Server Libraries + */ +public class AsyncLibrary { + private final SDKConfiguration sdkConfiguration; + private final Library syncSDK; + + AsyncLibrary(Library syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Library sync() { + return syncSDK; + } + + + /** + * Get Hash Value + * + *

This resource returns hash values for local files + * + * @return The async call builder + */ + public GetFileHashRequestBuilder getFileHash() { + return new GetFileHashRequestBuilder(sdkConfiguration); + } + + /** + * Get Hash Value + * + *

This resource returns hash values for local files + * + * @param url This is the path to the local file, must be prefixed by `file://` + * @return CompletableFuture<GetFileHashResponse> - The async response + */ + public CompletableFuture getFileHash(String url) { + return getFileHash(url, Optional.empty()); + } + + /** + * Get Hash Value + * + *

This resource returns hash values for local files + * + * @param url This is the path to the local file, must be prefixed by `file://` + * @param type Item type + * @return CompletableFuture<GetFileHashResponse> - The async response + */ + public CompletableFuture getFileHash(String url, Optional type) { + GetFileHashRequest request = + GetFileHashRequest + .builder() + .url(url) + .type(type) + .build(); + AsyncRequestOperation operation + = new GetFileHash.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Recently Added + * + *

This endpoint will return the recently added content. + * + * @return The async call builder + */ + public GetRecentlyAddedLibraryRequestBuilder getRecentlyAddedLibrary() { + return new GetRecentlyAddedLibraryRequestBuilder(sdkConfiguration); + } + + /** + * Get Recently Added + * + *

This endpoint will return the recently added content. + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetRecentlyAddedLibraryResponse> - The async response + */ + public CompletableFuture getRecentlyAddedLibrary(GetRecentlyAddedLibraryRequest request) { + AsyncRequestOperation operation + = new GetRecentlyAddedLibrary.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get All Libraries + * + *

A library section (commonly referred to as just a library) is a collection of media. + * Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. + * For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat. + * + *

Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. + * This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year). + * + * @return The async call builder + */ + public GetAllLibrariesRequestBuilder getAllLibraries() { + return new GetAllLibrariesRequestBuilder(sdkConfiguration); + } + + /** + * Get All Libraries + * + *

A library section (commonly referred to as just a library) is a collection of media. + * Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. + * For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat. + * + *

Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. + * This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year). + * + * @return CompletableFuture<GetAllLibrariesResponse> - The async response + */ + public CompletableFuture getAllLibrariesDirect() { + AsyncRequestlessOperation operation + = new GetAllLibraries.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Library Details + * + *

## Library Details Endpoint + * + *

This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself. + * + *

The details include: + * + *

### Directories + * Organized into three categories: + * + *

- **Primary Directories**: + * - Used in some clients for quick access to media subsets (e.g., "All", "On Deck"). + * - Most can be replicated via media queries. + * - Customizable by users. + * + *

- **Secondary Directories**: + * - Marked with `secondary="1"`. + * - Used in older clients for structured navigation. + * + *

- **Special Directories**: + * - Includes a "By Folder" entry for filesystem-based browsing. + * - Contains an obsolete `search="1"` entry for on-the-fly search dialog creation. + * + *

### Types + * Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + * + *

- **Type Object Attributes**: + * - `key`: Endpoint for the media list of this type. + * - `type`: Metadata type (if standard Plex type). + * - `title`: Title for this content type (e.g., "Movies"). + * + *

- **Filter Objects**: + * - Subset of the media query language. + * - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + * + *

- **Sort Objects**: + * - Description of sort fields. + * - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + * + *

> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + * + * @return The async call builder + */ + public GetLibraryDetailsRequestBuilder getLibraryDetails() { + return new GetLibraryDetailsRequestBuilder(sdkConfiguration); + } + + /** + * Get Library Details + * + *

## Library Details Endpoint + * + *

This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself. + * + *

The details include: + * + *

### Directories + * Organized into three categories: + * + *

- **Primary Directories**: + * - Used in some clients for quick access to media subsets (e.g., "All", "On Deck"). + * - Most can be replicated via media queries. + * - Customizable by users. + * + *

- **Secondary Directories**: + * - Marked with `secondary="1"`. + * - Used in older clients for structured navigation. + * + *

- **Special Directories**: + * - Includes a "By Folder" entry for filesystem-based browsing. + * - Contains an obsolete `search="1"` entry for on-the-fly search dialog creation. + * + *

### Types + * Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + * + *

- **Type Object Attributes**: + * - `key`: Endpoint for the media list of this type. + * - `type`: Metadata type (if standard Plex type). + * - `title`: Title for this content type (e.g., "Movies"). + * + *

- **Filter Objects**: + * - Subset of the media query language. + * - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + * + *

- **Sort Objects**: + * - Description of sort fields. + * - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + * + *

> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + * + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @return CompletableFuture<GetLibraryDetailsResponse> - The async response + */ + public CompletableFuture getLibraryDetails(int sectionKey) { + return getLibraryDetails(Optional.empty(), sectionKey); + } + + /** + * Get Library Details + * + *

## Library Details Endpoint + * + *

This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself. + * + *

The details include: + * + *

### Directories + * Organized into three categories: + * + *

- **Primary Directories**: + * - Used in some clients for quick access to media subsets (e.g., "All", "On Deck"). + * - Most can be replicated via media queries. + * - Customizable by users. + * + *

- **Secondary Directories**: + * - Marked with `secondary="1"`. + * - Used in older clients for structured navigation. + * + *

- **Special Directories**: + * - Includes a "By Folder" entry for filesystem-based browsing. + * - Contains an obsolete `search="1"` entry for on-the-fly search dialog creation. + * + *

### Types + * Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + * + *

- **Type Object Attributes**: + * - `key`: Endpoint for the media list of this type. + * - `type`: Metadata type (if standard Plex type). + * - `title`: Title for this content type (e.g., "Movies"). + * + *

- **Filter Objects**: + * - Subset of the media query language. + * - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + * + *

- **Sort Objects**: + * - Description of sort fields. + * - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + * + *

> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + * + * @param includeDetails Whether or not to include details for a section (types, filters, and sorts). + * Only exists for backwards compatibility, media providers other than the server libraries have it on always. + * + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @return CompletableFuture<GetLibraryDetailsResponse> - The async response + */ + public CompletableFuture getLibraryDetails(Optional includeDetails, int sectionKey) { + GetLibraryDetailsRequest request = + GetLibraryDetailsRequest + .builder() + .includeDetails(includeDetails) + .sectionKey(sectionKey) + .build(); + AsyncRequestOperation operation + = new GetLibraryDetails.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Delete Library Section + * + *

Delete a library using a specific section id + * + * @return The async call builder + */ + public DeleteLibraryRequestBuilder deleteLibrary() { + return new DeleteLibraryRequestBuilder(sdkConfiguration); + } + + /** + * Delete Library Section + * + *

Delete a library using a specific section id + * + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @return CompletableFuture<DeleteLibraryResponse> - The async response + */ + public CompletableFuture deleteLibrary(int sectionKey) { + DeleteLibraryRequest request = + DeleteLibraryRequest + .builder() + .sectionKey(sectionKey) + .build(); + AsyncRequestOperation operation + = new DeleteLibrary.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Library Items + * + *

Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values: + * - `all`: All items in the section. + * - `unwatched`: Items that have not been played. + * - `newest`: Items that are recently released. + * - `recentlyAdded`: Items that are recently added to the library. + * - `recentlyViewed`: Items that were recently viewed. + * - `onDeck`: Items to continue watching. + * - `collection`: Items categorized by collection. + * - `edition`: Items categorized by edition. + * - `genre`: Items categorized by genre. + * - `year`: Items categorized by year of release. + * - `decade`: Items categorized by decade. + * - `director`: Items categorized by director. + * - `actor`: Items categorized by starring actor. + * - `country`: Items categorized by country of origin. + * - `contentRating`: Items categorized by content rating. + * - `rating`: Items categorized by rating. + * - `resolution`: Items categorized by resolution. + * - `firstCharacter`: Items categorized by the first letter. + * - `folder`: Items categorized by folder. + * - `albums`: Items categorized by album. + * + * @return The async call builder + */ + public GetLibraryItemsRequestBuilder getLibraryItems() { + return new GetLibraryItemsRequestBuilder(sdkConfiguration); + } + + /** + * Get Library Items + * + *

Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values: + * - `all`: All items in the section. + * - `unwatched`: Items that have not been played. + * - `newest`: Items that are recently released. + * - `recentlyAdded`: Items that are recently added to the library. + * - `recentlyViewed`: Items that were recently viewed. + * - `onDeck`: Items to continue watching. + * - `collection`: Items categorized by collection. + * - `edition`: Items categorized by edition. + * - `genre`: Items categorized by genre. + * - `year`: Items categorized by year of release. + * - `decade`: Items categorized by decade. + * - `director`: Items categorized by director. + * - `actor`: Items categorized by starring actor. + * - `country`: Items categorized by country of origin. + * - `contentRating`: Items categorized by content rating. + * - `rating`: Items categorized by rating. + * - `resolution`: Items categorized by resolution. + * - `firstCharacter`: Items categorized by the first letter. + * - `folder`: Items categorized by folder. + * - `albums`: Items categorized by album. + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetLibraryItemsResponse> - The async response + */ + public CompletableFuture getLibraryItems(GetLibraryItemsRequest request) { + AsyncRequestOperation operation + = new GetLibraryItems.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Library section media by tag ALL + * + *

Retrieves a list of all general media data for this library. + * + * @return The async call builder + */ + public GetLibrarySectionsAllRequestBuilder getLibrarySectionsAll() { + return new GetLibrarySectionsAllRequestBuilder(sdkConfiguration); + } + + /** + * Get Library section media by tag ALL + * + *

Retrieves a list of all general media data for this library. + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetLibrarySectionsAllResponse> - The async response + */ + public CompletableFuture getLibrarySectionsAll(GetLibrarySectionsAllRequest request) { + AsyncRequestOperation operation + = new GetLibrarySectionsAll.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Refresh Metadata Of The Library + * + *

This endpoint Refreshes all the Metadata of the library. + * + * @return The async call builder + */ + public GetRefreshLibraryMetadataRequestBuilder getRefreshLibraryMetadata() { + return new GetRefreshLibraryMetadataRequestBuilder(sdkConfiguration); + } + + /** + * Refresh Metadata Of The Library + * + *

This endpoint Refreshes all the Metadata of the library. + * + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @return CompletableFuture<GetRefreshLibraryMetadataResponse> - The async response + */ + public CompletableFuture getRefreshLibraryMetadata(int sectionKey) { + return getRefreshLibraryMetadata(Optional.empty(), sectionKey); + } + + /** + * Refresh Metadata Of The Library + * + *

This endpoint Refreshes all the Metadata of the library. + * + * @param force Force the refresh even if the library is already being refreshed. + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @return CompletableFuture<GetRefreshLibraryMetadataResponse> - The async response + */ + public CompletableFuture getRefreshLibraryMetadata(Optional force, int sectionKey) { + GetRefreshLibraryMetadataRequest request = + GetRefreshLibraryMetadataRequest + .builder() + .force(force) + .sectionKey(sectionKey) + .build(); + AsyncRequestOperation operation + = new GetRefreshLibraryMetadata.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Search Library + * + *

Search for content within a specific section of the library. + * + *

### Types + * Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + * + *

- **Type Object Attributes**: + * - `type`: Metadata type (if standard Plex type). + * - `title`: Title for this content type (e.g., "Movies"). + * + *

- **Filter Objects**: + * - Subset of the media query language. + * - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + * + *

- **Sort Objects**: + * - Description of sort fields. + * - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + * + *

> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + * + * @return The async call builder + */ + public GetSearchLibraryRequestBuilder getSearchLibrary() { + return new GetSearchLibraryRequestBuilder(sdkConfiguration); + } + + /** + * Search Library + * + *

Search for content within a specific section of the library. + * + *

### Types + * Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls: + * + *

- **Type Object Attributes**: + * - `type`: Metadata type (if standard Plex type). + * - `title`: Title for this content type (e.g., "Movies"). + * + *

- **Filter Objects**: + * - Subset of the media query language. + * - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`. + * + *

- **Sort Objects**: + * - Description of sort fields. + * - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`. + * + *

> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered. + * + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @param type The type of media to retrieve or filter by. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + * @return CompletableFuture<GetSearchLibraryResponse> - The async response + */ + public CompletableFuture getSearchLibrary(int sectionKey, GetSearchLibraryQueryParamType type) { + GetSearchLibraryRequest request = + GetSearchLibraryRequest + .builder() + .sectionKey(sectionKey) + .type(type) + .build(); + AsyncRequestOperation operation + = new GetSearchLibrary.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Genres of library media + * + *

Retrieves a list of all the genres that are found for the media in this library. + * + * @return The async call builder + */ + public GetGenresLibraryRequestBuilder getGenresLibrary() { + return new GetGenresLibraryRequestBuilder(sdkConfiguration); + } + + /** + * Get Genres of library media + * + *

Retrieves a list of all the genres that are found for the media in this library. + * + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @param type The type of media to retrieve or filter by. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + * @return CompletableFuture<GetGenresLibraryResponse> - The async response + */ + public CompletableFuture getGenresLibrary(int sectionKey, GetGenresLibraryQueryParamType type) { + GetGenresLibraryRequest request = + GetGenresLibraryRequest + .builder() + .sectionKey(sectionKey) + .type(type) + .build(); + AsyncRequestOperation operation + = new GetGenresLibrary.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Countries of library media + * + *

Retrieves a list of all the countries that are found for the media in this library. + * + * @return The async call builder + */ + public GetCountriesLibraryRequestBuilder getCountriesLibrary() { + return new GetCountriesLibraryRequestBuilder(sdkConfiguration); + } + + /** + * Get Countries of library media + * + *

Retrieves a list of all the countries that are found for the media in this library. + * + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @param type The type of media to retrieve or filter by. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + * @return CompletableFuture<GetCountriesLibraryResponse> - The async response + */ + public CompletableFuture getCountriesLibrary(int sectionKey, GetCountriesLibraryQueryParamType type) { + GetCountriesLibraryRequest request = + GetCountriesLibraryRequest + .builder() + .sectionKey(sectionKey) + .type(type) + .build(); + AsyncRequestOperation operation + = new GetCountriesLibrary.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Actors of library media + * + *

Retrieves a list of all the actors that are found for the media in this library. + * + * @return The async call builder + */ + public GetActorsLibraryRequestBuilder getActorsLibrary() { + return new GetActorsLibraryRequestBuilder(sdkConfiguration); + } + + /** + * Get Actors of library media + * + *

Retrieves a list of all the actors that are found for the media in this library. + * + * @param sectionKey The unique key of the Plex library. + * Note: This is unique in the context of the Plex server. + * + * @param type The type of media to retrieve or filter by. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + * @return CompletableFuture<GetActorsLibraryResponse> - The async response + */ + public CompletableFuture getActorsLibrary(int sectionKey, GetActorsLibraryQueryParamType type) { + GetActorsLibraryRequest request = + GetActorsLibraryRequest + .builder() + .sectionKey(sectionKey) + .type(type) + .build(); + AsyncRequestOperation operation + = new GetActorsLibrary.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Search All Libraries + * + *

Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. + * + * @return The async call builder + */ + public GetSearchAllLibrariesRequestBuilder getSearchAllLibraries() { + return new GetSearchAllLibrariesRequestBuilder(sdkConfiguration); + } + + /** + * Search All Libraries + * + *

Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetSearchAllLibrariesResponse> - The async response + */ + public CompletableFuture getSearchAllLibraries(GetSearchAllLibrariesRequest request) { + AsyncRequestOperation operation + = new GetSearchAllLibraries.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Media Metadata + * + *

This endpoint will return all the (meta)data of one or more library items specified by the ratingKey. + * Multiple rating keys can be provided as a comma-separated list (e.g., "21119,21617"). + * + * @return The async call builder + */ + public GetMediaMetaDataRequestBuilder getMediaMetaData() { + return new GetMediaMetaDataRequestBuilder(sdkConfiguration); + } + + /** + * Get Media Metadata + * + *

This endpoint will return all the (meta)data of one or more library items specified by the ratingKey. + * Multiple rating keys can be provided as a comma-separated list (e.g., "21119,21617"). + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetMediaMetaDataResponse> - The async response + */ + public CompletableFuture getMediaMetaData(GetMediaMetaDataRequest request) { + AsyncRequestOperation operation + = new GetMediaMetaData.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Media Background Artwork + * + *

Returns the background artwork for a library item. + * + * @return The async call builder + */ + public GetMediaArtsRequestBuilder getMediaArts() { + return new GetMediaArtsRequestBuilder(sdkConfiguration); + } + + /** + * Get Media Background Artwork + * + *

Returns the background artwork for a library item. + * + * @param ratingKey the id of the library item to return the artwork of. + * @return CompletableFuture<GetMediaArtsResponse> - The async response + */ + public CompletableFuture getMediaArts(long ratingKey) { + GetMediaArtsRequest request = + GetMediaArtsRequest + .builder() + .ratingKey(ratingKey) + .build(); + AsyncRequestOperation operation + = new GetMediaArts.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Upload Media Background Artwork + * + *

Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL + * + * @return The async call builder + */ + public PostMediaArtsRequestBuilder postMediaArts() { + return new PostMediaArtsRequestBuilder(sdkConfiguration); + } + + /** + * Upload Media Background Artwork + * + *

Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL + * + * @param ratingKey the id of the library item to return the posters of. + * @return CompletableFuture<PostMediaArtsResponse> - The async response + */ + public CompletableFuture postMediaArts(long ratingKey) { + return postMediaArts(ratingKey, Optional.empty(), Optional.empty()); + } + + /** + * Upload Media Background Artwork + * + *

Uploads an image to use as the background artwork for a library item, either from a local file or a remote URL + * + * @param ratingKey the id of the library item to return the posters of. + * @param url The URL of the image, if uploading a remote image + * @param requestBody The contents of the image, if uploading a local file + * @return CompletableFuture<PostMediaArtsResponse> - The async response + */ + public CompletableFuture postMediaArts( + long ratingKey, Optional url, + Optional requestBody) { + PostMediaArtsRequest request = + PostMediaArtsRequest + .builder() + .ratingKey(ratingKey) + .url(url) + .requestBody(requestBody) + .build(); + AsyncRequestOperation operation + = new PostMediaArts.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Media Posters + * + *

Returns the available posters for a library item. + * + * @return The async call builder + */ + public GetMediaPostersRequestBuilder getMediaPosters() { + return new GetMediaPostersRequestBuilder(sdkConfiguration); + } + + /** + * Get Media Posters + * + *

Returns the available posters for a library item. + * + * @param ratingKey the id of the library item to return the posters of. + * @return CompletableFuture<GetMediaPostersResponse> - The async response + */ + public CompletableFuture getMediaPosters(long ratingKey) { + GetMediaPostersRequest request = + GetMediaPostersRequest + .builder() + .ratingKey(ratingKey) + .build(); + AsyncRequestOperation operation + = new GetMediaPosters.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Upload Media Poster + * + *

Uploads a poster to a library item, either from a local file or a remote URL + * + * @return The async call builder + */ + public PostMediaPosterRequestBuilder postMediaPoster() { + return new PostMediaPosterRequestBuilder(sdkConfiguration); + } + + /** + * Upload Media Poster + * + *

Uploads a poster to a library item, either from a local file or a remote URL + * + * @param ratingKey the id of the library item to return the posters of. + * @return CompletableFuture<PostMediaPosterResponse> - The async response + */ + public CompletableFuture postMediaPoster(long ratingKey) { + return postMediaPoster(ratingKey, Optional.empty(), Optional.empty()); + } + + /** + * Upload Media Poster + * + *

Uploads a poster to a library item, either from a local file or a remote URL + * + * @param ratingKey the id of the library item to return the posters of. + * @param url The URL of the image, if uploading a remote image + * @param requestBody The contents of the image, if uploading a local file + * @return CompletableFuture<PostMediaPosterResponse> - The async response + */ + public CompletableFuture postMediaPoster( + long ratingKey, Optional url, + Optional requestBody) { + PostMediaPosterRequest request = + PostMediaPosterRequest + .builder() + .ratingKey(ratingKey) + .url(url) + .requestBody(requestBody) + .build(); + AsyncRequestOperation operation + = new PostMediaPoster.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Items Children + * + *

This endpoint will return the children of of a library item specified with the ratingKey. + * + * @return The async call builder + */ + public GetMetadataChildrenRequestBuilder getMetadataChildren() { + return new GetMetadataChildrenRequestBuilder(sdkConfiguration); + } + + /** + * Get Items Children + * + *

This endpoint will return the children of of a library item specified with the ratingKey. + * + * @param ratingKey the id of the library item to return the children of. + * @return CompletableFuture<GetMetadataChildrenResponse> - The async response + */ + public CompletableFuture getMetadataChildren(double ratingKey) { + return getMetadataChildren(ratingKey, Optional.empty()); + } + + /** + * Get Items Children + * + *

This endpoint will return the children of of a library item specified with the ratingKey. + * + * @param ratingKey the id of the library item to return the children of. + * @param includeElements Adds additional elements to the response. Supported types are (Stream) + * + * @return CompletableFuture<GetMetadataChildrenResponse> - The async response + */ + public CompletableFuture getMetadataChildren(double ratingKey, Optional includeElements) { + GetMetadataChildrenRequest request = + GetMetadataChildrenRequest + .builder() + .ratingKey(ratingKey) + .includeElements(includeElements) + .build(); + AsyncRequestOperation operation + = new GetMetadataChildren.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Top Watched Content + * + *

This endpoint will return the top watched content from libraries of a certain type + * + * @return The async call builder + */ + public GetTopWatchedContentRequestBuilder getTopWatchedContent() { + return new GetTopWatchedContentRequestBuilder(sdkConfiguration); + } + + /** + * Get Top Watched Content + * + *

This endpoint will return the top watched content from libraries of a certain type + * + * @param type The type of media to retrieve or filter by. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + * @return CompletableFuture<GetTopWatchedContentResponse> - The async response + */ + public CompletableFuture getTopWatchedContent(GetTopWatchedContentQueryParamType type) { + return getTopWatchedContent(type, Optional.empty()); + } + + /** + * Get Top Watched Content + * + *

This endpoint will return the top watched content from libraries of a certain type + * + * @param type The type of media to retrieve or filter by. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + * @param includeGuids Adds the Guid object to the response + * + * @return CompletableFuture<GetTopWatchedContentResponse> - The async response + */ + public CompletableFuture getTopWatchedContent(GetTopWatchedContentQueryParamType type, Optional includeGuids) { + GetTopWatchedContentRequest request = + GetTopWatchedContentRequest + .builder() + .type(type) + .includeGuids(includeGuids) + .build(); + AsyncRequestOperation operation + = new GetTopWatchedContent.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncLog.java b/src/main/java/dev/plexapi/sdk/AsyncLog.java new file mode 100644 index 00000000..110f8a82 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncLog.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.models.operations.Level; +import dev.plexapi.sdk.models.operations.LogLineRequest; +import dev.plexapi.sdk.models.operations.async.EnablePaperTrailRequestBuilder; +import dev.plexapi.sdk.models.operations.async.EnablePaperTrailResponse; +import dev.plexapi.sdk.models.operations.async.LogLineRequestBuilder; +import dev.plexapi.sdk.models.operations.async.LogLineResponse; +import dev.plexapi.sdk.models.operations.async.LogMultiLineRequestBuilder; +import dev.plexapi.sdk.models.operations.async.LogMultiLineResponse; +import dev.plexapi.sdk.operations.EnablePaperTrail; +import dev.plexapi.sdk.operations.LogLine; +import dev.plexapi.sdk.operations.LogMultiLine; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +/** + * Submit logs to the Log Handler for Plex Media Server + */ +public class AsyncLog { + private final SDKConfiguration sdkConfiguration; + private final Log syncSDK; + + AsyncLog(Log syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Log sync() { + return syncSDK; + } + + + /** + * Logging a single line message. + * + *

This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. + * + * @return The async call builder + */ + public LogLineRequestBuilder logLine() { + return new LogLineRequestBuilder(sdkConfiguration); + } + + /** + * Logging a single line message. + * + *

This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. + * + * @param level An integer log level to write to the PMS log with. + * 0: Error + * 1: Warning + * 2: Info + * 3: Debug + * 4: Verbose + * + * @param message The text of the message to write to the log. + * @param source a string indicating the source of the message. + * @return CompletableFuture<LogLineResponse> - The async response + */ + public CompletableFuture logLine( + Level level, String message, + String source) { + LogLineRequest request = + LogLineRequest + .builder() + .level(level) + .message(message) + .source(source) + .build(); + AsyncRequestOperation operation + = new LogLine.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Logging a multi-line message + * + *

This endpoint allows for the batch addition of log entries to the main Plex Media Server log. + * It accepts a text/plain request body, where each line represents a distinct log entry. + * Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'. + * + *

Log entries are separated by a newline character (`\n`). + * Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters. + * This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. + * + *

The 'level' parameter specifies the log entry's severity or importance, with the following integer values: + * - `0`: Error - Critical issues that require immediate attention. + * - `1`: Warning - Important events that are not critical but may indicate potential issues. + * - `2`: Info - General informational messages about system operation. + * - `3`: Debug - Detailed information useful for debugging purposes. + * - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis. + * + *

The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module). + * + *

Example of a single log entry format: + * `level=4&message=Sample%20log%20entry&source=applicationName` + * + *

Ensure each parameter is properly URL-encoded to avoid interpretation issues. + * + * @return The async call builder + */ + public LogMultiLineRequestBuilder logMultiLine() { + return new LogMultiLineRequestBuilder(sdkConfiguration); + } + + /** + * Logging a multi-line message + * + *

This endpoint allows for the batch addition of log entries to the main Plex Media Server log. + * It accepts a text/plain request body, where each line represents a distinct log entry. + * Each log entry consists of URL-encoded key-value pairs, specifying log attributes such as 'level', 'message', and 'source'. + * + *

Log entries are separated by a newline character (`\n`). + * Each entry's parameters should be URL-encoded to ensure accurate parsing and handling of special characters. + * This method is efficient for logging multiple entries in a single API call, reducing the overhead of multiple individual requests. + * + *

The 'level' parameter specifies the log entry's severity or importance, with the following integer values: + * - `0`: Error - Critical issues that require immediate attention. + * - `1`: Warning - Important events that are not critical but may indicate potential issues. + * - `2`: Info - General informational messages about system operation. + * - `3`: Debug - Detailed information useful for debugging purposes. + * - `4`: Verbose - Highly detailed diagnostic information for in-depth analysis. + * + *

The 'message' parameter contains the log text, and 'source' identifies the log message's origin (e.g., an application name or module). + * + *

Example of a single log entry format: + * `level=4&message=Sample%20log%20entry&source=applicationName` + * + *

Ensure each parameter is properly URL-encoded to avoid interpretation issues. + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<LogMultiLineResponse> - The async response + */ + public CompletableFuture logMultiLine(String request) { + AsyncRequestOperation operation + = new LogMultiLine.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Enabling Papertrail + * + *

This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time. + * + * @return The async call builder + */ + public EnablePaperTrailRequestBuilder enablePaperTrail() { + return new EnablePaperTrailRequestBuilder(sdkConfiguration); + } + + /** + * Enabling Papertrail + * + *

This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time. + * + * @return CompletableFuture<EnablePaperTrailResponse> - The async response + */ + public CompletableFuture enablePaperTrailDirect() { + AsyncRequestlessOperation operation + = new EnablePaperTrail.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncMedia.java b/src/main/java/dev/plexapi/sdk/AsyncMedia.java new file mode 100644 index 00000000..cec32df2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncMedia.java @@ -0,0 +1,208 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetBannerImageRequest; +import dev.plexapi.sdk.models.operations.GetThumbImageRequest; +import dev.plexapi.sdk.models.operations.MarkPlayedRequest; +import dev.plexapi.sdk.models.operations.MarkUnplayedRequest; +import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest; +import dev.plexapi.sdk.models.operations.async.GetBannerImageRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetBannerImageResponse; +import dev.plexapi.sdk.models.operations.async.GetThumbImageRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetThumbImageResponse; +import dev.plexapi.sdk.models.operations.async.MarkPlayedRequestBuilder; +import dev.plexapi.sdk.models.operations.async.MarkPlayedResponse; +import dev.plexapi.sdk.models.operations.async.MarkUnplayedRequestBuilder; +import dev.plexapi.sdk.models.operations.async.MarkUnplayedResponse; +import dev.plexapi.sdk.models.operations.async.UpdatePlayProgressRequestBuilder; +import dev.plexapi.sdk.models.operations.async.UpdatePlayProgressResponse; +import dev.plexapi.sdk.operations.GetBannerImage; +import dev.plexapi.sdk.operations.GetThumbImage; +import dev.plexapi.sdk.operations.MarkPlayed; +import dev.plexapi.sdk.operations.MarkUnplayed; +import dev.plexapi.sdk.operations.UpdatePlayProgress; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls interacting with Plex Media Server Media + */ +public class AsyncMedia { + private final SDKConfiguration sdkConfiguration; + private final Media syncSDK; + + AsyncMedia(Media syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Media sync() { + return syncSDK; + } + + + /** + * Mark Media Played + * + *

This will mark the provided media key as Played. + * + * @return The async call builder + */ + public MarkPlayedRequestBuilder markPlayed() { + return new MarkPlayedRequestBuilder(sdkConfiguration); + } + + /** + * Mark Media Played + * + *

This will mark the provided media key as Played. + * + * @param key The media key to mark as played + * @return CompletableFuture<MarkPlayedResponse> - The async response + */ + public CompletableFuture markPlayed(double key) { + MarkPlayedRequest request = + MarkPlayedRequest + .builder() + .key(key) + .build(); + AsyncRequestOperation operation + = new MarkPlayed.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Mark Media Unplayed + * + *

This will mark the provided media key as Unplayed. + * + * @return The async call builder + */ + public MarkUnplayedRequestBuilder markUnplayed() { + return new MarkUnplayedRequestBuilder(sdkConfiguration); + } + + /** + * Mark Media Unplayed + * + *

This will mark the provided media key as Unplayed. + * + * @param key The media key to mark as Unplayed + * @return CompletableFuture<MarkUnplayedResponse> - The async response + */ + public CompletableFuture markUnplayed(double key) { + MarkUnplayedRequest request = + MarkUnplayedRequest + .builder() + .key(key) + .build(); + AsyncRequestOperation operation + = new MarkUnplayed.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Update Media Play Progress + * + *

This API command can be used to update the play progress of a media item. + * + * @return The async call builder + */ + public UpdatePlayProgressRequestBuilder updatePlayProgress() { + return new UpdatePlayProgressRequestBuilder(sdkConfiguration); + } + + /** + * Update Media Play Progress + * + *

This API command can be used to update the play progress of a media item. + * + * @param key the media key + * @param time The time, in milliseconds, used to set the media playback progress. + * @param state The playback state of the media item. + * @return CompletableFuture<UpdatePlayProgressResponse> - The async response + */ + public CompletableFuture updatePlayProgress( + String key, double time, + String state) { + UpdatePlayProgressRequest request = + UpdatePlayProgressRequest + .builder() + .key(key) + .time(time) + .state(state) + .build(); + AsyncRequestOperation operation + = new UpdatePlayProgress.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Banner Image + * + *

Gets the banner image of the media item + * + * @return The async call builder + */ + public GetBannerImageRequestBuilder getBannerImage() { + return new GetBannerImageRequestBuilder(sdkConfiguration); + } + + /** + * Get Banner Image + * + *

Gets the banner image of the media item + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetBannerImageResponse> - The async response + */ + public CompletableFuture getBannerImage(GetBannerImageRequest request) { + AsyncRequestOperation operation + = new GetBannerImage.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Thumb Image + * + *

Gets the thumbnail image of the media item + * + * @return The async call builder + */ + public GetThumbImageRequestBuilder getThumbImage() { + return new GetThumbImageRequestBuilder(sdkConfiguration); + } + + /** + * Get Thumb Image + * + *

Gets the thumbnail image of the media item + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetThumbImageResponse> - The async response + */ + public CompletableFuture getThumbImage(GetThumbImageRequest request) { + AsyncRequestOperation operation + = new GetThumbImage.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncPlaylists.java b/src/main/java/dev/plexapi/sdk/AsyncPlaylists.java new file mode 100644 index 00000000..f24f520e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncPlaylists.java @@ -0,0 +1,449 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.AddPlaylistContentsRequest; +import dev.plexapi.sdk.models.operations.ClearPlaylistContentsRequest; +import dev.plexapi.sdk.models.operations.CreatePlaylistRequest; +import dev.plexapi.sdk.models.operations.DeletePlaylistRequest; +import dev.plexapi.sdk.models.operations.GetPlaylistContentsQueryParamType; +import dev.plexapi.sdk.models.operations.GetPlaylistContentsRequest; +import dev.plexapi.sdk.models.operations.GetPlaylistRequest; +import dev.plexapi.sdk.models.operations.GetPlaylistsRequest; +import dev.plexapi.sdk.models.operations.PlaylistType; +import dev.plexapi.sdk.models.operations.QueryParamForce; +import dev.plexapi.sdk.models.operations.QueryParamSmart; +import dev.plexapi.sdk.models.operations.UpdatePlaylistRequest; +import dev.plexapi.sdk.models.operations.UploadPlaylistRequest; +import dev.plexapi.sdk.models.operations.async.AddPlaylistContentsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.AddPlaylistContentsResponse; +import dev.plexapi.sdk.models.operations.async.ClearPlaylistContentsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.ClearPlaylistContentsResponse; +import dev.plexapi.sdk.models.operations.async.CreatePlaylistRequestBuilder; +import dev.plexapi.sdk.models.operations.async.CreatePlaylistResponse; +import dev.plexapi.sdk.models.operations.async.DeletePlaylistRequestBuilder; +import dev.plexapi.sdk.models.operations.async.DeletePlaylistResponse; +import dev.plexapi.sdk.models.operations.async.GetPlaylistContentsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetPlaylistContentsResponse; +import dev.plexapi.sdk.models.operations.async.GetPlaylistRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetPlaylistResponse; +import dev.plexapi.sdk.models.operations.async.GetPlaylistsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetPlaylistsResponse; +import dev.plexapi.sdk.models.operations.async.UpdatePlaylistRequestBuilder; +import dev.plexapi.sdk.models.operations.async.UpdatePlaylistResponse; +import dev.plexapi.sdk.models.operations.async.UploadPlaylistRequestBuilder; +import dev.plexapi.sdk.models.operations.async.UploadPlaylistResponse; +import dev.plexapi.sdk.operations.AddPlaylistContents; +import dev.plexapi.sdk.operations.ClearPlaylistContents; +import dev.plexapi.sdk.operations.CreatePlaylist; +import dev.plexapi.sdk.operations.DeletePlaylist; +import dev.plexapi.sdk.operations.GetPlaylist; +import dev.plexapi.sdk.operations.GetPlaylistContents; +import dev.plexapi.sdk.operations.GetPlaylists; +import dev.plexapi.sdk.operations.UpdatePlaylist; +import dev.plexapi.sdk.operations.UploadPlaylist; +import java.lang.Double; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). + * They can be organized in (optionally nesting) folders. + * Retrieving a playlist, or its items, will trigger a refresh of its metadata. + * This may cause the duration and number of items to change. + */ +public class AsyncPlaylists { + private final SDKConfiguration sdkConfiguration; + private final Playlists syncSDK; + + AsyncPlaylists(Playlists syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Playlists sync() { + return syncSDK; + } + + + /** + * Create a Playlist + * + *

Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass: + * - `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`). + * - `playQueueID` - To create a playlist from an existing play queue. + * + * @return The async call builder + */ + public CreatePlaylistRequestBuilder createPlaylist() { + return new CreatePlaylistRequestBuilder(sdkConfiguration); + } + + /** + * Create a Playlist + * + *

Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass: + * - `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`). + * - `playQueueID` - To create a playlist from an existing play queue. + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<CreatePlaylistResponse> - The async response + */ + public CompletableFuture createPlaylist(CreatePlaylistRequest request) { + AsyncRequestOperation operation + = new CreatePlaylist.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get All Playlists + * + *

Get All Playlists given the specified filters. + * + * @return The async call builder + */ + public GetPlaylistsRequestBuilder getPlaylists() { + return new GetPlaylistsRequestBuilder(sdkConfiguration); + } + + /** + * Get All Playlists + * + *

Get All Playlists given the specified filters. + * + * @return CompletableFuture<GetPlaylistsResponse> - The async response + */ + public CompletableFuture getPlaylistsDirect() { + return getPlaylists(Optional.empty(), Optional.empty()); + } + + /** + * Get All Playlists + * + *

Get All Playlists given the specified filters. + * + * @param playlistType limit to a type of playlist. + * @param smart type of playlists to return (default is all). + * @return CompletableFuture<GetPlaylistsResponse> - The async response + */ + public CompletableFuture getPlaylists(Optional playlistType, Optional smart) { + GetPlaylistsRequest request = + GetPlaylistsRequest + .builder() + .playlistType(playlistType) + .smart(smart) + .build(); + AsyncRequestOperation operation + = new GetPlaylists.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Retrieve Playlist + * + *

Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item: + * Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing. + * + * @return The async call builder + */ + public GetPlaylistRequestBuilder getPlaylist() { + return new GetPlaylistRequestBuilder(sdkConfiguration); + } + + /** + * Retrieve Playlist + * + *

Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item: + * Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing. + * + * @param playlistID the ID of the playlist + * @return CompletableFuture<GetPlaylistResponse> - The async response + */ + public CompletableFuture getPlaylist(double playlistID) { + GetPlaylistRequest request = + GetPlaylistRequest + .builder() + .playlistID(playlistID) + .build(); + AsyncRequestOperation operation + = new GetPlaylist.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Deletes a Playlist + * + *

This endpoint will delete a playlist + * + * @return The async call builder + */ + public DeletePlaylistRequestBuilder deletePlaylist() { + return new DeletePlaylistRequestBuilder(sdkConfiguration); + } + + /** + * Deletes a Playlist + * + *

This endpoint will delete a playlist + * + * @param playlistID the ID of the playlist + * @return CompletableFuture<DeletePlaylistResponse> - The async response + */ + public CompletableFuture deletePlaylist(double playlistID) { + DeletePlaylistRequest request = + DeletePlaylistRequest + .builder() + .playlistID(playlistID) + .build(); + AsyncRequestOperation operation + = new DeletePlaylist.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Update a Playlist + * + *

From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}` + * + * @return The async call builder + */ + public UpdatePlaylistRequestBuilder updatePlaylist() { + return new UpdatePlaylistRequestBuilder(sdkConfiguration); + } + + /** + * Update a Playlist + * + *

From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}` + * + * @param playlistID the ID of the playlist + * @return CompletableFuture<UpdatePlaylistResponse> - The async response + */ + public CompletableFuture updatePlaylist(double playlistID) { + return updatePlaylist(playlistID, Optional.empty(), Optional.empty()); + } + + /** + * Update a Playlist + * + *

From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}` + * + * @param playlistID the ID of the playlist + * @param title name of the playlist + * @param summary summary description of the playlist + * @return CompletableFuture<UpdatePlaylistResponse> - The async response + */ + public CompletableFuture updatePlaylist( + double playlistID, Optional title, + Optional summary) { + UpdatePlaylistRequest request = + UpdatePlaylistRequest + .builder() + .playlistID(playlistID) + .title(title) + .summary(summary) + .build(); + AsyncRequestOperation operation + = new UpdatePlaylist.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Retrieve Playlist Contents + * + *

Gets the contents of a playlist. Should be paged by clients via standard mechanisms. + * By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter. + * For example, you could use this to display a list of recently added albums vis a smart playlist. + * Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items. + * + * @return The async call builder + */ + public GetPlaylistContentsRequestBuilder getPlaylistContents() { + return new GetPlaylistContentsRequestBuilder(sdkConfiguration); + } + + /** + * Retrieve Playlist Contents + * + *

Gets the contents of a playlist. Should be paged by clients via standard mechanisms. + * By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter. + * For example, you could use this to display a list of recently added albums vis a smart playlist. + * Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items. + * + * @param playlistID the ID of the playlist + * @param type The type of media to retrieve or filter by. + * 1 = movie + * 2 = show + * 3 = season + * 4 = episode + * E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + * + * @return CompletableFuture<GetPlaylistContentsResponse> - The async response + */ + public CompletableFuture getPlaylistContents(double playlistID, GetPlaylistContentsQueryParamType type) { + GetPlaylistContentsRequest request = + GetPlaylistContentsRequest + .builder() + .playlistID(playlistID) + .type(type) + .build(); + AsyncRequestOperation operation + = new GetPlaylistContents.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Delete Playlist Contents + * + *

Clears a playlist, only works with dumb playlists. Returns the playlist. + * + * @return The async call builder + */ + public ClearPlaylistContentsRequestBuilder clearPlaylistContents() { + return new ClearPlaylistContentsRequestBuilder(sdkConfiguration); + } + + /** + * Delete Playlist Contents + * + *

Clears a playlist, only works with dumb playlists. Returns the playlist. + * + * @param playlistID the ID of the playlist + * @return CompletableFuture<ClearPlaylistContentsResponse> - The async response + */ + public CompletableFuture clearPlaylistContents(double playlistID) { + ClearPlaylistContentsRequest request = + ClearPlaylistContentsRequest + .builder() + .playlistID(playlistID) + .build(); + AsyncRequestOperation operation + = new ClearPlaylistContents.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Adding to a Playlist + * + *

Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist. + * With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist. + * + * @return The async call builder + */ + public AddPlaylistContentsRequestBuilder addPlaylistContents() { + return new AddPlaylistContentsRequestBuilder(sdkConfiguration); + } + + /** + * Adding to a Playlist + * + *

Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist. + * With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist. + * + * @param playlistID the ID of the playlist + * @param uri the content URI for the playlist + * @return CompletableFuture<AddPlaylistContentsResponse> - The async response + */ + public CompletableFuture addPlaylistContents(double playlistID, String uri) { + return addPlaylistContents(playlistID, uri, Optional.empty()); + } + + /** + * Adding to a Playlist + * + *

Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist. + * With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist. + * + * @param playlistID the ID of the playlist + * @param uri the content URI for the playlist + * @param playQueueID the play queue to add to a playlist + * @return CompletableFuture<AddPlaylistContentsResponse> - The async response + */ + public CompletableFuture addPlaylistContents( + double playlistID, String uri, + Optional playQueueID) { + AddPlaylistContentsRequest request = + AddPlaylistContentsRequest + .builder() + .playlistID(playlistID) + .uri(uri) + .playQueueID(playQueueID) + .build(); + AsyncRequestOperation operation + = new AddPlaylistContents.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Upload Playlist + * + *

Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file. + * + * @return The async call builder + */ + public UploadPlaylistRequestBuilder uploadPlaylist() { + return new UploadPlaylistRequestBuilder(sdkConfiguration); + } + + /** + * Upload Playlist + * + *

Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file. + * + * @param path absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. + * If the `path` argument is a directory, that path will be scanned for playlist files to be processed. + * Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. + * The GUID of each playlist is based on the filename. + * If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. + * The GUID of each playlist is based on the filename. + * + * @param force Force overwriting of duplicate playlists. + * By default, a playlist file uploaded with the same path will overwrite the existing playlist. + * The `force` argument is used to disable overwriting. + * If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. + * + * @param sectionID Possibly the section ID to upload the playlist to, we are not certain. + * @return CompletableFuture<UploadPlaylistResponse> - The async response + */ + public CompletableFuture uploadPlaylist( + String path, QueryParamForce force, + long sectionID) { + UploadPlaylistRequest request = + UploadPlaylistRequest + .builder() + .path(path) + .force(force) + .sectionID(sectionID) + .build(); + AsyncRequestOperation operation + = new UploadPlaylist.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncPlex.java b/src/main/java/dev/plexapi/sdk/AsyncPlex.java new file mode 100644 index 00000000..bea03384 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncPlex.java @@ -0,0 +1,339 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetPinRequest; +import dev.plexapi.sdk.models.operations.GetServerResourcesRequest; +import dev.plexapi.sdk.models.operations.GetTokenByPinIdRequest; +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.operations.async.GetCompanionsDataRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetCompanionsDataResponse; +import dev.plexapi.sdk.models.operations.async.GetGeoDataRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetGeoDataResponse; +import dev.plexapi.sdk.models.operations.async.GetHomeDataRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetHomeDataResponse; +import dev.plexapi.sdk.models.operations.async.GetPinRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetPinResponse; +import dev.plexapi.sdk.models.operations.async.GetServerResourcesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetServerResourcesResponse; +import dev.plexapi.sdk.models.operations.async.GetTokenByPinIdRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetTokenByPinIdResponse; +import dev.plexapi.sdk.models.operations.async.GetUserFriendsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetUserFriendsResponse; +import dev.plexapi.sdk.operations.GetCompanionsData; +import dev.plexapi.sdk.operations.GetGeoData; +import dev.plexapi.sdk.operations.GetHomeData; +import dev.plexapi.sdk.operations.GetPin; +import dev.plexapi.sdk.operations.GetServerResources; +import dev.plexapi.sdk.operations.GetTokenByPinId; +import dev.plexapi.sdk.operations.GetUserFriends; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls that perform operations directly against https://Plex.tv + */ +public class AsyncPlex { + private final SDKConfiguration sdkConfiguration; + private final Plex syncSDK; + + AsyncPlex(Plex syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Plex sync() { + return syncSDK; + } + + + /** + * Get Companions Data + * + *

Get Companions Data + * + * @return The async call builder + */ + public GetCompanionsDataRequestBuilder getCompanionsData() { + return new GetCompanionsDataRequestBuilder(sdkConfiguration); + } + + /** + * Get Companions Data + * + *

Get Companions Data + * + * @return CompletableFuture<GetCompanionsDataResponse> - The async response + */ + public CompletableFuture getCompanionsDataDirect() { + return getCompanionsData(Optional.empty()); + } + + /** + * Get Companions Data + * + *

Get Companions Data + * + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetCompanionsDataResponse> - The async response + */ + public CompletableFuture getCompanionsData(Optional serverURL) { + AsyncRequestlessOperation operation + = new GetCompanionsData.Async(sdkConfiguration, serverURL); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get list of friends of the user logged in + * + *

Get friends of provided auth token. + * + * @return The async call builder + */ + public GetUserFriendsRequestBuilder getUserFriends() { + return new GetUserFriendsRequestBuilder(sdkConfiguration); + } + + /** + * Get list of friends of the user logged in + * + *

Get friends of provided auth token. + * + * @return CompletableFuture<GetUserFriendsResponse> - The async response + */ + public CompletableFuture getUserFriendsDirect() { + return getUserFriends(Optional.empty()); + } + + /** + * Get list of friends of the user logged in + * + *

Get friends of provided auth token. + * + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetUserFriendsResponse> - The async response + */ + public CompletableFuture getUserFriends(Optional serverURL) { + AsyncRequestlessOperation operation + = new GetUserFriends.Async(sdkConfiguration, serverURL); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Geo Data + * + *

Returns the geolocation and locale data of the caller + * + * @return The async call builder + */ + public GetGeoDataRequestBuilder getGeoData() { + return new GetGeoDataRequestBuilder(sdkConfiguration); + } + + /** + * Get Geo Data + * + *

Returns the geolocation and locale data of the caller + * + * @return CompletableFuture<GetGeoDataResponse> - The async response + */ + public CompletableFuture getGeoDataDirect() { + return getGeoData(Optional.empty()); + } + + /** + * Get Geo Data + * + *

Returns the geolocation and locale data of the caller + * + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetGeoDataResponse> - The async response + */ + public CompletableFuture getGeoData(Optional serverURL) { + AsyncRequestlessOperation operation + = new GetGeoData.Async(sdkConfiguration, serverURL); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Plex Home Data + * + *

Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. + * + * @return The async call builder + */ + public GetHomeDataRequestBuilder getHomeData() { + return new GetHomeDataRequestBuilder(sdkConfiguration); + } + + /** + * Get Plex Home Data + * + *

Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. + * + * @return CompletableFuture<GetHomeDataResponse> - The async response + */ + public CompletableFuture getHomeDataDirect() { + AsyncRequestlessOperation operation + = new GetHomeData.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Server Resources + * + *

Get Plex server access tokens and server connections + * + * @return The async call builder + */ + public GetServerResourcesRequestBuilder getServerResources() { + return new GetServerResourcesRequestBuilder(sdkConfiguration); + } + + /** + * Get Server Resources + * + *

Get Plex server access tokens and server connections + * + * @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + * @return CompletableFuture<GetServerResourcesResponse> - The async response + */ + public CompletableFuture getServerResources(String clientID) { + return getServerResources( + Optional.empty(), Optional.empty(), Optional.empty(), + clientID, Optional.empty()); + } + + /** + * Get Server Resources + * + *

Get Plex server access tokens and server connections + * + * @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 + * + * @param includeIPv6 Include IPv6 entries in the results + * @param clientID An opaque identifier unique to the client (UUID, serial number, or other unique device ID) + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetServerResourcesResponse> - The async response + */ + public CompletableFuture getServerResources( + Optional includeHttps, Optional includeRelay, + Optional includeIPv6, String clientID, + Optional serverURL) { + GetServerResourcesRequest request = + GetServerResourcesRequest + .builder() + .includeHttps(includeHttps) + .includeRelay(includeRelay) + .includeIPv6(includeIPv6) + .clientID(clientID) + .build(); + AsyncRequestOperation operation + = new GetServerResources.Async(sdkConfiguration, serverURL); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get a Pin + * + *

Retrieve a Pin ID from Plex.tv to use for authentication flows + * + * @return The async call builder + */ + public GetPinRequestBuilder getPin() { + return new GetPinRequestBuilder(sdkConfiguration); + } + + /** + * Get a Pin + * + *

Retrieve a Pin ID from Plex.tv to use for authentication flows + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetPinResponse> - The async response + */ + public CompletableFuture getPin(GetPinRequest request) { + return getPin(request, Optional.empty()); + } + + /** + * Get a Pin + * + *

Retrieve a Pin ID from Plex.tv to use for authentication flows + * + * @param request The request object containing all the parameters for the API call. + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetPinResponse> - The async response + */ + public CompletableFuture getPin(GetPinRequest request, Optional serverURL) { + AsyncRequestOperation operation + = new GetPin.Async(sdkConfiguration, serverURL); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Access Token by PinId + * + *

Retrieve an Access Token from Plex.tv after the Pin has been authenticated + * + * @return The async call builder + */ + public GetTokenByPinIdRequestBuilder getTokenByPinId() { + return new GetTokenByPinIdRequestBuilder(sdkConfiguration); + } + + /** + * Get Access Token by PinId + * + *

Retrieve an Access Token from Plex.tv after the Pin has been authenticated + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetTokenByPinIdResponse> - The async response + */ + public CompletableFuture getTokenByPinId(GetTokenByPinIdRequest request) { + return getTokenByPinId(request, Optional.empty()); + } + + /** + * Get Access Token by PinId + * + *

Retrieve an Access Token from Plex.tv after the Pin has been authenticated + * + * @param request The request object containing all the parameters for the API call. + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetTokenByPinIdResponse> - The async response + */ + public CompletableFuture getTokenByPinId(GetTokenByPinIdRequest request, Optional serverURL) { + AsyncRequestOperation operation + = new GetTokenByPinId.Async(sdkConfiguration, serverURL); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncPlexAPI.java b/src/main/java/dev/plexapi/sdk/AsyncPlexAPI.java new file mode 100644 index 00000000..a14d12f0 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncPlexAPI.java @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; +/** + * Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server + * + *

# Plex Media Server OpenAPI Specification + * + *

An Open Source OpenAPI Specification for Plex Media Server + * + *

Automation and SDKs provided by [Speakeasy](https://speakeasyapi.dev/) + * + *

## Documentation + * + *

[API Documentation](https://plexapi.dev) + * + *

## SDKs + * + *

The following SDKs are generated from the OpenAPI Specification. They are automatically generated and may not be fully tested. If you find any issues, please open an issue on the [main specification Repository](https://github.com/LukeHagar/plex-api-spec). + * + *

| Language | Repository | Releases | Other | + * | --------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------- | + * | Python | [GitHub](https://github.com/LukeHagar/plexpy) | [PyPI](https://pypi.org/project/plex-api-client/) | - | + * | JavaScript/TypeScript | [GitHub](https://github.com/LukeHagar/plexjs) | [NPM](https://www.npmjs.com/package/@lukehagar/plexjs) \ [JSR](https://jsr.io/@lukehagar/plexjs) | - | + * | Go | [GitHub](https://github.com/LukeHagar/plexgo) | [Releases](https://github.com/LukeHagar/plexgo/releases) | [GoDoc](https://pkg.go.dev/github.com/LukeHagar/plexgo) | + * | Ruby | [GitHub](https://github.com/LukeHagar/plexruby) | [Releases](https://github.com/LukeHagar/plexruby/releases) | - | + * | Swift | [GitHub](https://github.com/LukeHagar/plexswift) | [Releases](https://github.com/LukeHagar/plexswift/releases) | - | + * | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | + * | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | + * | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - + */ +public class AsyncPlexAPI { + /** + * Operations against the Plex Media Server System. + */ + private final AsyncServer server; + /** + * API Calls interacting with Plex Media Server Media + */ + private final AsyncMedia media; + /** + * API Calls that perform operations with Plex Media Server Videos + */ + private final AsyncVideo video; + /** + * Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. + * Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. + * Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: + * - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. + * - They must contain an `type` which is used by clients to distinguish the specific activity. + * - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) + * - The may contain a `Response` object which attributes which represent the result of the asynchronous operation. + */ + private final AsyncActivities activities; + /** + * Butler is the task manager of the Plex Media Server Ecosystem. + */ + private final AsyncButler butler; + /** + * API Calls that perform operations directly against https://Plex.tv + */ + private final AsyncPlex plex; + /** + * Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. + */ + private final AsyncHubs hubs; + /** + * API Calls that perform search operations with Plex Media Server + */ + private final AsyncSearch search; + /** + * API Calls interacting with Plex Media Server Libraries + */ + private final AsyncLibrary library; + /** + * API Calls that perform operations with Plex Media Server Watchlists + */ + private final AsyncWatchlist watchlist; + /** + * Submit logs to the Log Handler for Plex Media Server + */ + private final AsyncLog log; + /** + * Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). + * They can be organized in (optionally nesting) folders. + * Retrieving a playlist, or its items, will trigger a refresh of its metadata. + * This may cause the duration and number of items to change. + */ + private final AsyncPlaylists playlists; + /** + * API Calls regarding authentication for Plex Media Server + */ + private final AsyncAuthentication authentication; + /** + * API Calls that perform operations with Plex Media Server Statistics + */ + private final AsyncStatistics statistics; + /** + * API Calls that perform search operations with Plex Media Server Sessions + */ + private final AsyncSessions sessions; + /** + * This describes the API for searching and applying updates to the Plex Media Server. + * Updates to the status can be observed via the Event API. + */ + private final AsyncUpdater updater; + + private final AsyncUsers users; + /** + * Operations against the Plex Media Server System. + */ + public AsyncServer server() { + return server; + } + /** + * API Calls interacting with Plex Media Server Media + */ + public AsyncMedia media() { + return media; + } + /** + * API Calls that perform operations with Plex Media Server Videos + */ + public AsyncVideo video() { + return video; + } + /** + * Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. + * Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. + * Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: + * - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. + * - They must contain an `type` which is used by clients to distinguish the specific activity. + * - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) + * - The may contain a `Response` object which attributes which represent the result of the asynchronous operation. + */ + public AsyncActivities activities() { + return activities; + } + /** + * Butler is the task manager of the Plex Media Server Ecosystem. + */ + public AsyncButler butler() { + return butler; + } + /** + * API Calls that perform operations directly against https://Plex.tv + */ + public AsyncPlex plex() { + return plex; + } + /** + * Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. + */ + public AsyncHubs hubs() { + return hubs; + } + /** + * API Calls that perform search operations with Plex Media Server + */ + public AsyncSearch search() { + return search; + } + /** + * API Calls interacting with Plex Media Server Libraries + */ + public AsyncLibrary library() { + return library; + } + /** + * API Calls that perform operations with Plex Media Server Watchlists + */ + public AsyncWatchlist watchlist() { + return watchlist; + } + /** + * Submit logs to the Log Handler for Plex Media Server + */ + public AsyncLog log() { + return log; + } + /** + * Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). + * They can be organized in (optionally nesting) folders. + * Retrieving a playlist, or its items, will trigger a refresh of its metadata. + * This may cause the duration and number of items to change. + */ + public AsyncPlaylists playlists() { + return playlists; + } + /** + * API Calls regarding authentication for Plex Media Server + */ + public AsyncAuthentication authentication() { + return authentication; + } + /** + * API Calls that perform operations with Plex Media Server Statistics + */ + public AsyncStatistics statistics() { + return statistics; + } + /** + * API Calls that perform search operations with Plex Media Server Sessions + */ + public AsyncSessions sessions() { + return sessions; + } + /** + * This describes the API for searching and applying updates to the Plex Media Server. + * Updates to the status can be observed via the Event API. + */ + public AsyncUpdater updater() { + return updater; + } + + public AsyncUsers users() { + return users; + } + + private final SDKConfiguration sdkConfiguration; + private final PlexAPI syncSDK; + + AsyncPlexAPI(PlexAPI syncSDK, SDKConfiguration sdkConfiguration) { + this.syncSDK = syncSDK; + this.sdkConfiguration = sdkConfiguration; + this.server = new AsyncServer(syncSDK.server(), sdkConfiguration); + this.media = new AsyncMedia(syncSDK.media(), sdkConfiguration); + this.video = new AsyncVideo(syncSDK.video(), sdkConfiguration); + this.activities = new AsyncActivities(syncSDK.activities(), sdkConfiguration); + this.butler = new AsyncButler(syncSDK.butler(), sdkConfiguration); + this.plex = new AsyncPlex(syncSDK.plex(), sdkConfiguration); + this.hubs = new AsyncHubs(syncSDK.hubs(), sdkConfiguration); + this.search = new AsyncSearch(syncSDK.search(), sdkConfiguration); + this.library = new AsyncLibrary(syncSDK.library(), sdkConfiguration); + this.watchlist = new AsyncWatchlist(syncSDK.watchlist(), sdkConfiguration); + this.log = new AsyncLog(syncSDK.log(), sdkConfiguration); + this.playlists = new AsyncPlaylists(syncSDK.playlists(), sdkConfiguration); + this.authentication = new AsyncAuthentication(syncSDK.authentication(), sdkConfiguration); + this.statistics = new AsyncStatistics(syncSDK.statistics(), sdkConfiguration); + this.sessions = new AsyncSessions(syncSDK.sessions(), sdkConfiguration); + this.updater = new AsyncUpdater(syncSDK.updater(), sdkConfiguration); + this.users = new AsyncUsers(syncSDK.users(), sdkConfiguration); + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public PlexAPI sync() { + return syncSDK; + } +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncSearch.java b/src/main/java/dev/plexapi/sdk/AsyncSearch.java new file mode 100644 index 00000000..add2a3df --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncSearch.java @@ -0,0 +1,220 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetSearchResultsRequest; +import dev.plexapi.sdk.models.operations.PerformSearchRequest; +import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequest; +import dev.plexapi.sdk.models.operations.async.GetSearchResultsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetSearchResultsResponse; +import dev.plexapi.sdk.models.operations.async.PerformSearchRequestBuilder; +import dev.plexapi.sdk.models.operations.async.PerformSearchResponse; +import dev.plexapi.sdk.models.operations.async.PerformVoiceSearchRequestBuilder; +import dev.plexapi.sdk.models.operations.async.PerformVoiceSearchResponse; +import dev.plexapi.sdk.operations.GetSearchResults; +import dev.plexapi.sdk.operations.PerformSearch; +import dev.plexapi.sdk.operations.PerformVoiceSearch; +import java.lang.Double; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls that perform search operations with Plex Media Server + */ +public class AsyncSearch { + private final SDKConfiguration sdkConfiguration; + private final Search syncSDK; + + AsyncSearch(Search syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Search sync() { + return syncSDK; + } + + + /** + * Perform a search + * + *

This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor). + * + *

In the response's items, the following extra attributes are returned to further describe or disambiguate the result: + * + *

- `reason`: The reason for the result, if not because of a direct search term match; can be either: + * - `section`: There are multiple identical results from different sections. + * - `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language). + * - `<hub identifier>`: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor` + * - `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold"). + * - `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID. + * + *

This request is intended to be very fast, and called as the user types. + * + * @return The async call builder + */ + public PerformSearchRequestBuilder performSearch() { + return new PerformSearchRequestBuilder(sdkConfiguration); + } + + /** + * Perform a search + * + *

This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor). + * + *

In the response's items, the following extra attributes are returned to further describe or disambiguate the result: + * + *

- `reason`: The reason for the result, if not because of a direct search term match; can be either: + * - `section`: There are multiple identical results from different sections. + * - `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language). + * - `<hub identifier>`: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor` + * - `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold"). + * - `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID. + * + *

This request is intended to be very fast, and called as the user types. + * + * @param query The query term + * @return CompletableFuture<PerformSearchResponse> - The async response + */ + public CompletableFuture performSearch(String query) { + return performSearch(query, Optional.empty(), Optional.empty()); + } + + /** + * Perform a search + * + *

This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor). + * + *

In the response's items, the following extra attributes are returned to further describe or disambiguate the result: + * + *

- `reason`: The reason for the result, if not because of a direct search term match; can be either: + * - `section`: There are multiple identical results from different sections. + * - `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language). + * - `<hub identifier>`: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor` + * - `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold"). + * - `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID. + * + *

This request is intended to be very fast, and called as the user types. + * + * @param query The query term + * @param sectionId This gives context to the search, and can result in re-ordering of search result hubs + * @param limit The number of items to return per hub + * @return CompletableFuture<PerformSearchResponse> - The async response + */ + public CompletableFuture performSearch( + String query, Optional sectionId, + Optional limit) { + PerformSearchRequest request = + PerformSearchRequest + .builder() + .query(query) + .sectionId(sectionId) + .limit(limit) + .build(); + AsyncRequestOperation operation + = new PerformSearch.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Perform a voice search + * + *

This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. + * It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. + * Whenever possible, clients should limit the search to the appropriate type. + * Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality. + * + * @return The async call builder + */ + public PerformVoiceSearchRequestBuilder performVoiceSearch() { + return new PerformVoiceSearchRequestBuilder(sdkConfiguration); + } + + /** + * Perform a voice search + * + *

This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. + * It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. + * Whenever possible, clients should limit the search to the appropriate type. + * Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality. + * + * @param query The query term + * @return CompletableFuture<PerformVoiceSearchResponse> - The async response + */ + public CompletableFuture performVoiceSearch(String query) { + return performVoiceSearch(query, Optional.empty(), Optional.empty()); + } + + /** + * Perform a voice search + * + *

This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. + * It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. + * Whenever possible, clients should limit the search to the appropriate type. + * Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality. + * + * @param query The query term + * @param sectionId This gives context to the search, and can result in re-ordering of search result hubs + * @param limit The number of items to return per hub + * @return CompletableFuture<PerformVoiceSearchResponse> - The async response + */ + public CompletableFuture performVoiceSearch( + String query, Optional sectionId, + Optional limit) { + PerformVoiceSearchRequest request = + PerformVoiceSearchRequest + .builder() + .query(query) + .sectionId(sectionId) + .limit(limit) + .build(); + AsyncRequestOperation operation + = new PerformVoiceSearch.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Search Results + * + *

This will search the database for the string provided. + * + * @return The async call builder + */ + public GetSearchResultsRequestBuilder getSearchResults() { + return new GetSearchResultsRequestBuilder(sdkConfiguration); + } + + /** + * Get Search Results + * + *

This will search the database for the string provided. + * + * @param query The search query string to use + * @return CompletableFuture<GetSearchResultsResponse> - The async response + */ + public CompletableFuture getSearchResults(String query) { + GetSearchResultsRequest request = + GetSearchResultsRequest + .builder() + .query(query) + .build(); + AsyncRequestOperation operation + = new GetSearchResults.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncServer.java b/src/main/java/dev/plexapi/sdk/AsyncServer.java new file mode 100644 index 00000000..201c1659 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncServer.java @@ -0,0 +1,303 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetMediaProvidersRequest; +import dev.plexapi.sdk.models.operations.GetResizedPhotoRequest; +import dev.plexapi.sdk.models.operations.async.GetAvailableClientsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetAvailableClientsResponse; +import dev.plexapi.sdk.models.operations.async.GetDevicesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetDevicesResponse; +import dev.plexapi.sdk.models.operations.async.GetMediaProvidersRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetMediaProvidersResponse; +import dev.plexapi.sdk.models.operations.async.GetMyPlexAccountRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetMyPlexAccountResponse; +import dev.plexapi.sdk.models.operations.async.GetResizedPhotoRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetResizedPhotoResponse; +import dev.plexapi.sdk.models.operations.async.GetServerCapabilitiesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetServerCapabilitiesResponse; +import dev.plexapi.sdk.models.operations.async.GetServerIdentityRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetServerIdentityResponse; +import dev.plexapi.sdk.models.operations.async.GetServerListRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetServerListResponse; +import dev.plexapi.sdk.models.operations.async.GetServerPreferencesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetServerPreferencesResponse; +import dev.plexapi.sdk.operations.GetAvailableClients; +import dev.plexapi.sdk.operations.GetDevices; +import dev.plexapi.sdk.operations.GetMediaProviders; +import dev.plexapi.sdk.operations.GetMyPlexAccount; +import dev.plexapi.sdk.operations.GetResizedPhoto; +import dev.plexapi.sdk.operations.GetServerCapabilities; +import dev.plexapi.sdk.operations.GetServerIdentity; +import dev.plexapi.sdk.operations.GetServerList; +import dev.plexapi.sdk.operations.GetServerPreferences; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +/** + * Operations against the Plex Media Server System. + */ +public class AsyncServer { + private final SDKConfiguration sdkConfiguration; + private final Server syncSDK; + + AsyncServer(Server syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Server sync() { + return syncSDK; + } + + + /** + * Get Server Capabilities + * + *

Get Server Capabilities + * + * @return The async call builder + */ + public GetServerCapabilitiesRequestBuilder getServerCapabilities() { + return new GetServerCapabilitiesRequestBuilder(sdkConfiguration); + } + + /** + * Get Server Capabilities + * + *

Get Server Capabilities + * + * @return CompletableFuture<GetServerCapabilitiesResponse> - The async response + */ + public CompletableFuture getServerCapabilitiesDirect() { + AsyncRequestlessOperation operation + = new GetServerCapabilities.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Server Preferences + * + *

Get Server Preferences + * + * @return The async call builder + */ + public GetServerPreferencesRequestBuilder getServerPreferences() { + return new GetServerPreferencesRequestBuilder(sdkConfiguration); + } + + /** + * Get Server Preferences + * + *

Get Server Preferences + * + * @return CompletableFuture<GetServerPreferencesResponse> - The async response + */ + public CompletableFuture getServerPreferencesDirect() { + AsyncRequestlessOperation operation + = new GetServerPreferences.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Available Clients + * + *

Get Available Clients + * + * @return The async call builder + */ + public GetAvailableClientsRequestBuilder getAvailableClients() { + return new GetAvailableClientsRequestBuilder(sdkConfiguration); + } + + /** + * Get Available Clients + * + *

Get Available Clients + * + * @return CompletableFuture<GetAvailableClientsResponse> - The async response + */ + public CompletableFuture getAvailableClientsDirect() { + AsyncRequestlessOperation operation + = new GetAvailableClients.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Devices + * + *

Get Devices + * + * @return The async call builder + */ + public GetDevicesRequestBuilder getDevices() { + return new GetDevicesRequestBuilder(sdkConfiguration); + } + + /** + * Get Devices + * + *

Get Devices + * + * @return CompletableFuture<GetDevicesResponse> - The async response + */ + public CompletableFuture getDevicesDirect() { + AsyncRequestlessOperation operation + = new GetDevices.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Server Identity + * + *

This request is useful to determine if the server is online or offline + * + * @return The async call builder + */ + public GetServerIdentityRequestBuilder getServerIdentity() { + return new GetServerIdentityRequestBuilder(sdkConfiguration); + } + + /** + * Get Server Identity + * + *

This request is useful to determine if the server is online or offline + * + * @return CompletableFuture<GetServerIdentityResponse> - The async response + */ + public CompletableFuture getServerIdentityDirect() { + AsyncRequestlessOperation operation + = new GetServerIdentity.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get MyPlex Account + * + *

Returns MyPlex Account Information + * + * @return The async call builder + */ + public GetMyPlexAccountRequestBuilder getMyPlexAccount() { + return new GetMyPlexAccountRequestBuilder(sdkConfiguration); + } + + /** + * Get MyPlex Account + * + *

Returns MyPlex Account Information + * + * @return CompletableFuture<GetMyPlexAccountResponse> - The async response + */ + public CompletableFuture getMyPlexAccountDirect() { + AsyncRequestlessOperation operation + = new GetMyPlexAccount.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get a Resized Photo + * + *

Plex's Photo transcoder is used throughout the service to serve images at specified sizes. + * + * @return The async call builder + */ + public GetResizedPhotoRequestBuilder getResizedPhoto() { + return new GetResizedPhotoRequestBuilder(sdkConfiguration); + } + + /** + * Get a Resized Photo + * + *

Plex's Photo transcoder is used throughout the service to serve images at specified sizes. + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetResizedPhotoResponse> - The async response + */ + public CompletableFuture getResizedPhoto(GetResizedPhotoRequest request) { + AsyncRequestOperation operation + = new GetResizedPhoto.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Media Providers + * + *

Retrieves media providers and their features from the Plex server. + * + * @return The async call builder + */ + public GetMediaProvidersRequestBuilder getMediaProviders() { + return new GetMediaProvidersRequestBuilder(sdkConfiguration); + } + + /** + * Get Media Providers + * + *

Retrieves media providers and their features from the Plex server. + * + * @param xPlexToken An authentication token, obtained from plex.tv + * @return CompletableFuture<GetMediaProvidersResponse> - The async response + */ + public CompletableFuture getMediaProviders(String xPlexToken) { + GetMediaProvidersRequest request = + GetMediaProvidersRequest + .builder() + .xPlexToken(xPlexToken) + .build(); + AsyncRequestOperation operation + = new GetMediaProviders.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Server List + * + *

Get Server List + * + * @return The async call builder + */ + public GetServerListRequestBuilder getServerList() { + return new GetServerListRequestBuilder(sdkConfiguration); + } + + /** + * Get Server List + * + *

Get Server List + * + * @return CompletableFuture<GetServerListResponse> - The async response + */ + public CompletableFuture getServerListDirect() { + AsyncRequestlessOperation operation + = new GetServerList.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncSessions.java b/src/main/java/dev/plexapi/sdk/AsyncSessions.java new file mode 100644 index 00000000..a4d2da57 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncSessions.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetSessionHistoryRequest; +import dev.plexapi.sdk.models.operations.QueryParamFilter; +import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequest; +import dev.plexapi.sdk.models.operations.async.GetSessionHistoryRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetSessionHistoryResponse; +import dev.plexapi.sdk.models.operations.async.GetSessionsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetSessionsResponse; +import dev.plexapi.sdk.models.operations.async.GetTranscodeSessionsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetTranscodeSessionsResponse; +import dev.plexapi.sdk.models.operations.async.StopTranscodeSessionRequestBuilder; +import dev.plexapi.sdk.models.operations.async.StopTranscodeSessionResponse; +import dev.plexapi.sdk.operations.GetSessionHistory; +import dev.plexapi.sdk.operations.GetSessions; +import dev.plexapi.sdk.operations.GetTranscodeSessions; +import dev.plexapi.sdk.operations.StopTranscodeSession; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls that perform search operations with Plex Media Server Sessions + */ +public class AsyncSessions { + private final SDKConfiguration sdkConfiguration; + private final Sessions syncSDK; + + AsyncSessions(Sessions syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Sessions sync() { + return syncSDK; + } + + + /** + * Get Active Sessions + * + *

This will retrieve the "Now Playing" Information of the PMS. + * + * @return The async call builder + */ + public GetSessionsRequestBuilder getSessions() { + return new GetSessionsRequestBuilder(sdkConfiguration); + } + + /** + * Get Active Sessions + * + *

This will retrieve the "Now Playing" Information of the PMS. + * + * @return CompletableFuture<GetSessionsResponse> - The async response + */ + public CompletableFuture getSessionsDirect() { + AsyncRequestlessOperation operation + = new GetSessions.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Get Session History + * + *

This will Retrieve a listing of all history views. + * + * @return The async call builder + */ + public GetSessionHistoryRequestBuilder getSessionHistory() { + return new GetSessionHistoryRequestBuilder(sdkConfiguration); + } + + /** + * Get Session History + * + *

This will Retrieve a listing of all history views. + * + * @return CompletableFuture<GetSessionHistoryResponse> - The async response + */ + public CompletableFuture getSessionHistoryDirect() { + return getSessionHistory( + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); + } + + /** + * Get Session History + * + *

This will Retrieve a listing of all history views. + * + * @param sort Sorts the results by the specified field followed by the direction (asc, desc) + * + * @param accountId Filter results by those that are related to a specific users id + * + * @param filter Filters content by field and direction/equality + * (Unknown if viewedAt is the only supported column) + * + * @param librarySectionID Filters the results based on the id of a valid library section + * + * @return CompletableFuture<GetSessionHistoryResponse> - The async response + */ + public CompletableFuture getSessionHistory( + Optional sort, Optional accountId, + Optional filter, Optional librarySectionID) { + GetSessionHistoryRequest request = + GetSessionHistoryRequest + .builder() + .sort(sort) + .accountId(accountId) + .filter(filter) + .librarySectionID(librarySectionID) + .build(); + AsyncRequestOperation operation + = new GetSessionHistory.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Transcode Sessions + * + *

Get Transcode Sessions + * + * @return The async call builder + */ + public GetTranscodeSessionsRequestBuilder getTranscodeSessions() { + return new GetTranscodeSessionsRequestBuilder(sdkConfiguration); + } + + /** + * Get Transcode Sessions + * + *

Get Transcode Sessions + * + * @return CompletableFuture<GetTranscodeSessionsResponse> - The async response + */ + public CompletableFuture getTranscodeSessionsDirect() { + AsyncRequestlessOperation operation + = new GetTranscodeSessions.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Stop a Transcode Session + * + *

Stop a Transcode Session + * + * @return The async call builder + */ + public StopTranscodeSessionRequestBuilder stopTranscodeSession() { + return new StopTranscodeSessionRequestBuilder(sdkConfiguration); + } + + /** + * Stop a Transcode Session + * + *

Stop a Transcode Session + * + * @param sessionKey the Key of the transcode session to stop + * @return CompletableFuture<StopTranscodeSessionResponse> - The async response + */ + public CompletableFuture stopTranscodeSession(String sessionKey) { + StopTranscodeSessionRequest request = + StopTranscodeSessionRequest + .builder() + .sessionKey(sessionKey) + .build(); + AsyncRequestOperation operation + = new StopTranscodeSession.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncStatistics.java b/src/main/java/dev/plexapi/sdk/AsyncStatistics.java new file mode 100644 index 00000000..519c4ffd --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncStatistics.java @@ -0,0 +1,180 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsRequest; +import dev.plexapi.sdk.models.operations.GetResourcesStatisticsRequest; +import dev.plexapi.sdk.models.operations.GetStatisticsRequest; +import dev.plexapi.sdk.models.operations.async.GetBandwidthStatisticsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetBandwidthStatisticsResponse; +import dev.plexapi.sdk.models.operations.async.GetResourcesStatisticsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetResourcesStatisticsResponse; +import dev.plexapi.sdk.models.operations.async.GetStatisticsRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetStatisticsResponse; +import dev.plexapi.sdk.operations.GetBandwidthStatistics; +import dev.plexapi.sdk.operations.GetResourcesStatistics; +import dev.plexapi.sdk.operations.GetStatistics; +import java.lang.Long; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls that perform operations with Plex Media Server Statistics + */ +public class AsyncStatistics { + private final SDKConfiguration sdkConfiguration; + private final Statistics syncSDK; + + AsyncStatistics(Statistics syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Statistics sync() { + return syncSDK; + } + + + /** + * Get Media Statistics + * + *

This will return the media statistics for the server + * + * @return The async call builder + */ + public GetStatisticsRequestBuilder getStatistics() { + return new GetStatisticsRequestBuilder(sdkConfiguration); + } + + /** + * Get Media Statistics + * + *

This will return the media statistics for the server + * + * @return CompletableFuture<GetStatisticsResponse> - The async response + */ + public CompletableFuture getStatisticsDirect() { + return getStatistics(Optional.empty()); + } + + /** + * Get Media Statistics + * + *

This will return the media statistics for the server + * + * @param timespan The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + * @return CompletableFuture<GetStatisticsResponse> - The async response + */ + public CompletableFuture getStatistics(Optional timespan) { + GetStatisticsRequest request = + GetStatisticsRequest + .builder() + .timespan(timespan) + .build(); + AsyncRequestOperation operation + = new GetStatistics.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Resources Statistics + * + *

This will return the resources for the server + * + * @return The async call builder + */ + public GetResourcesStatisticsRequestBuilder getResourcesStatistics() { + return new GetResourcesStatisticsRequestBuilder(sdkConfiguration); + } + + /** + * Get Resources Statistics + * + *

This will return the resources for the server + * + * @return CompletableFuture<GetResourcesStatisticsResponse> - The async response + */ + public CompletableFuture getResourcesStatisticsDirect() { + return getResourcesStatistics(Optional.empty()); + } + + /** + * Get Resources Statistics + * + *

This will return the resources for the server + * + * @param timespan The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + * @return CompletableFuture<GetResourcesStatisticsResponse> - The async response + */ + public CompletableFuture getResourcesStatistics(Optional timespan) { + GetResourcesStatisticsRequest request = + GetResourcesStatisticsRequest + .builder() + .timespan(timespan) + .build(); + AsyncRequestOperation operation + = new GetResourcesStatistics.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Bandwidth Statistics + * + *

This will return the bandwidth statistics for the server + * + * @return The async call builder + */ + public GetBandwidthStatisticsRequestBuilder getBandwidthStatistics() { + return new GetBandwidthStatisticsRequestBuilder(sdkConfiguration); + } + + /** + * Get Bandwidth Statistics + * + *

This will return the bandwidth statistics for the server + * + * @return CompletableFuture<GetBandwidthStatisticsResponse> - The async response + */ + public CompletableFuture getBandwidthStatisticsDirect() { + return getBandwidthStatistics(Optional.empty()); + } + + /** + * Get Bandwidth Statistics + * + *

This will return the bandwidth statistics for the server + * + * @param timespan The timespan to retrieve statistics for + * the exact meaning of this parameter is not known + * + * @return CompletableFuture<GetBandwidthStatisticsResponse> - The async response + */ + public CompletableFuture getBandwidthStatistics(Optional timespan) { + GetBandwidthStatisticsRequest request = + GetBandwidthStatisticsRequest + .builder() + .timespan(timespan) + .build(); + AsyncRequestOperation operation + = new GetBandwidthStatistics.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncUpdater.java b/src/main/java/dev/plexapi/sdk/AsyncUpdater.java new file mode 100644 index 00000000..b597fdaf --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncUpdater.java @@ -0,0 +1,162 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.ApplyUpdatesRequest; +import dev.plexapi.sdk.models.operations.CheckForUpdatesRequest; +import dev.plexapi.sdk.models.operations.Download; +import dev.plexapi.sdk.models.operations.Skip; +import dev.plexapi.sdk.models.operations.Tonight; +import dev.plexapi.sdk.models.operations.async.ApplyUpdatesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.ApplyUpdatesResponse; +import dev.plexapi.sdk.models.operations.async.CheckForUpdatesRequestBuilder; +import dev.plexapi.sdk.models.operations.async.CheckForUpdatesResponse; +import dev.plexapi.sdk.models.operations.async.GetUpdateStatusRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetUpdateStatusResponse; +import dev.plexapi.sdk.operations.ApplyUpdates; +import dev.plexapi.sdk.operations.CheckForUpdates; +import dev.plexapi.sdk.operations.GetUpdateStatus; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * This describes the API for searching and applying updates to the Plex Media Server. + * Updates to the status can be observed via the Event API. + */ +public class AsyncUpdater { + private final SDKConfiguration sdkConfiguration; + private final Updater syncSDK; + + AsyncUpdater(Updater syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Updater sync() { + return syncSDK; + } + + + /** + * Querying status of updates + * + *

Querying status of updates + * + * @return The async call builder + */ + public GetUpdateStatusRequestBuilder getUpdateStatus() { + return new GetUpdateStatusRequestBuilder(sdkConfiguration); + } + + /** + * Querying status of updates + * + *

Querying status of updates + * + * @return CompletableFuture<GetUpdateStatusResponse> - The async response + */ + public CompletableFuture getUpdateStatusDirect() { + AsyncRequestlessOperation operation + = new GetUpdateStatus.Async(sdkConfiguration); + return operation.doRequest() + .thenCompose(operation::handleResponse); + } + + + /** + * Checking for updates + * + *

Checking for updates + * + * @return The async call builder + */ + public CheckForUpdatesRequestBuilder checkForUpdates() { + return new CheckForUpdatesRequestBuilder(sdkConfiguration); + } + + /** + * Checking for updates + * + *

Checking for updates + * + * @return CompletableFuture<CheckForUpdatesResponse> - The async response + */ + public CompletableFuture checkForUpdatesDirect() { + return checkForUpdates(Optional.empty()); + } + + /** + * Checking for updates + * + *

Checking for updates + * + * @param download Indicate that you want to start download any updates found. + * @return CompletableFuture<CheckForUpdatesResponse> - The async response + */ + public CompletableFuture checkForUpdates(Optional download) { + CheckForUpdatesRequest request = + CheckForUpdatesRequest + .builder() + .download(download) + .build(); + AsyncRequestOperation operation + = new CheckForUpdates.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Apply Updates + * + *

Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed + * + * @return The async call builder + */ + public ApplyUpdatesRequestBuilder applyUpdates() { + return new ApplyUpdatesRequestBuilder(sdkConfiguration); + } + + /** + * Apply Updates + * + *

Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed + * + * @return CompletableFuture<ApplyUpdatesResponse> - The async response + */ + public CompletableFuture applyUpdatesDirect() { + return applyUpdates(Optional.empty(), Optional.empty()); + } + + /** + * Apply Updates + * + *

Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed + * + * @param tonight Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install + * @param skip Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. + * @return CompletableFuture<ApplyUpdatesResponse> - The async response + */ + public CompletableFuture applyUpdates(Optional tonight, Optional skip) { + ApplyUpdatesRequest request = + ApplyUpdatesRequest + .builder() + .tonight(tonight) + .skip(skip) + .build(); + AsyncRequestOperation operation + = new ApplyUpdates.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncUsers.java b/src/main/java/dev/plexapi/sdk/AsyncUsers.java new file mode 100644 index 00000000..982c0b35 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncUsers.java @@ -0,0 +1,75 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetUsersRequest; +import dev.plexapi.sdk.models.operations.async.GetUsersRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetUsersResponse; +import dev.plexapi.sdk.operations.GetUsers; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + + +public class AsyncUsers { + private final SDKConfiguration sdkConfiguration; + private final Users syncSDK; + + AsyncUsers(Users syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Users sync() { + return syncSDK; + } + + + /** + * Get list of all connected users + * + *

Get list of all users that are friends and have library access with the provided Plex authentication token + * + * @return The async call builder + */ + public GetUsersRequestBuilder getUsers() { + return new GetUsersRequestBuilder(sdkConfiguration); + } + + /** + * Get list of all connected users + * + *

Get list of all users that are friends and have library access with the provided Plex authentication token + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetUsersResponse> - The async response + */ + public CompletableFuture getUsers(GetUsersRequest request) { + return getUsers(request, Optional.empty()); + } + + /** + * Get list of all connected users + * + *

Get list of all users that are friends and have library access with the provided Plex authentication token + * + * @param request The request object containing all the parameters for the API call. + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetUsersResponse> - The async response + */ + public CompletableFuture getUsers(GetUsersRequest request, Optional serverURL) { + AsyncRequestOperation operation + = new GetUsers.Async(sdkConfiguration, serverURL); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncVideo.java b/src/main/java/dev/plexapi/sdk/AsyncVideo.java new file mode 100644 index 00000000..dc5651ea --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncVideo.java @@ -0,0 +1,93 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetTimelineRequest; +import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest; +import dev.plexapi.sdk.models.operations.async.GetTimelineRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetTimelineResponse; +import dev.plexapi.sdk.models.operations.async.StartUniversalTranscodeRequestBuilder; +import dev.plexapi.sdk.models.operations.async.StartUniversalTranscodeResponse; +import dev.plexapi.sdk.operations.GetTimeline; +import dev.plexapi.sdk.operations.StartUniversalTranscode; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls that perform operations with Plex Media Server Videos + */ +public class AsyncVideo { + private final SDKConfiguration sdkConfiguration; + private final Video syncSDK; + + AsyncVideo(Video syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Video sync() { + return syncSDK; + } + + + /** + * Get the timeline for a media item + * + *

Get the timeline for a media item + * + * @return The async call builder + */ + public GetTimelineRequestBuilder getTimeline() { + return new GetTimelineRequestBuilder(sdkConfiguration); + } + + /** + * Get the timeline for a media item + * + *

Get the timeline for a media item + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetTimelineResponse> - The async response + */ + public CompletableFuture getTimeline(GetTimelineRequest request) { + AsyncRequestOperation operation + = new GetTimeline.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Start Universal Transcode + * + *

Begin a Universal Transcode Session + * + * @return The async call builder + */ + public StartUniversalTranscodeRequestBuilder startUniversalTranscode() { + return new StartUniversalTranscodeRequestBuilder(sdkConfiguration); + } + + /** + * Start Universal Transcode + * + *

Begin a Universal Transcode Session + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<StartUniversalTranscodeResponse> - The async response + */ + public CompletableFuture startUniversalTranscode(StartUniversalTranscodeRequest request) { + AsyncRequestOperation operation + = new StartUniversalTranscode.Async(sdkConfiguration); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/AsyncWatchlist.java b/src/main/java/dev/plexapi/sdk/AsyncWatchlist.java new file mode 100644 index 00000000..aa44b2b4 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/AsyncWatchlist.java @@ -0,0 +1,77 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.models.operations.GetWatchListRequest; +import dev.plexapi.sdk.models.operations.async.GetWatchListRequestBuilder; +import dev.plexapi.sdk.models.operations.async.GetWatchListResponse; +import dev.plexapi.sdk.operations.GetWatchList; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * API Calls that perform operations with Plex Media Server Watchlists + */ +public class AsyncWatchlist { + private final SDKConfiguration sdkConfiguration; + private final Watchlist syncSDK; + + AsyncWatchlist(Watchlist syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public Watchlist sync() { + return syncSDK; + } + + + /** + * Get User Watchlist + * + *

Get User Watchlist + * + * @return The async call builder + */ + public GetWatchListRequestBuilder getWatchList() { + return new GetWatchListRequestBuilder(sdkConfiguration); + } + + /** + * Get User Watchlist + * + *

Get User Watchlist + * + * @param request The request object containing all the parameters for the API call. + * @return CompletableFuture<GetWatchListResponse> - The async response + */ + public CompletableFuture getWatchList(GetWatchListRequest request) { + return getWatchList(request, Optional.empty()); + } + + /** + * Get User Watchlist + * + *

Get User Watchlist + * + * @param request The request object containing all the parameters for the API call. + * @param serverURL Overrides the server URL. + * @return CompletableFuture<GetWatchListResponse> - The async response + */ + public CompletableFuture getWatchList(GetWatchListRequest request, Optional serverURL) { + AsyncRequestOperation operation + = new GetWatchList.Async(sdkConfiguration, serverURL); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/dev/plexapi/sdk/Authentication.java b/src/main/java/dev/plexapi/sdk/Authentication.java index 835c996f..30f1ec61 100644 --- a/src/main/java/dev/plexapi/sdk/Authentication.java +++ b/src/main/java/dev/plexapi/sdk/Authentication.java @@ -3,22 +3,14 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationBadRequest; -import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationUnauthorized; -import dev.plexapi.sdk.models.errors.GetTokenDetailsBadRequest; -import dev.plexapi.sdk.models.errors.GetTokenDetailsUnauthorized; -import dev.plexapi.sdk.models.errors.GetTransientTokenBadRequest; -import dev.plexapi.sdk.models.errors.GetTransientTokenUnauthorized; -import dev.plexapi.sdk.models.errors.PostUsersSignInDataBadRequest; -import dev.plexapi.sdk.models.errors.PostUsersSignInDataUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationRequest; import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationRequestBuilder; import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationResponse; import dev.plexapi.sdk.models.operations.GetTokenDetailsRequestBuilder; import dev.plexapi.sdk.models.operations.GetTokenDetailsResponse; -import dev.plexapi.sdk.models.operations.GetTokenDetailsUserPlexAccount; import dev.plexapi.sdk.models.operations.GetTransientTokenQueryParamType; import dev.plexapi.sdk.models.operations.GetTransientTokenRequest; import dev.plexapi.sdk.models.operations.GetTransientTokenRequestBuilder; @@ -26,56 +18,35 @@ import dev.plexapi.sdk.models.operations.GetTransientTokenResponse; import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequest; import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequestBuilder; import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse; -import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.Scope; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.SerializedBody; -import dev.plexapi.sdk.utils.Utils.JsonShape; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetSourceConnectionInformation; +import dev.plexapi.sdk.operations.GetTokenDetails; +import dev.plexapi.sdk.operations.GetTransientToken; +import dev.plexapi.sdk.operations.PostUsersSignInData; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.HashMap; -import java.util.List; import java.util.Optional; /** * API Calls regarding authentication for Plex Media Server */ -public class Authentication implements - MethodCallGetTransientToken, - MethodCallGetSourceConnectionInformation, - MethodCallGetTokenDetails, - MethodCallPostUsersSignInData { - - /** - * GET_TOKEN_DETAILS_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_TOKEN_DETAILS_SERVERS = { - "https://plex.tv/api/v2", - }; - - /** - * POST_USERS_SIGN_IN_DATA_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] POST_USERS_SIGN_IN_DATA_SERVERS = { - "https://plex.tv/api/v2", - }; - +public class Authentication { private final SDKConfiguration sdkConfiguration; + private final AsyncAuthentication asyncSDK; Authentication(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncAuthentication(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncAuthentication async() { + return asyncSDK; + } /** * Get a Transient Token @@ -85,7 +56,7 @@ public class Authentication implements * @return The call builder */ public GetTransientTokenRequestBuilder getTransientToken() { - return new GetTransientTokenRequestBuilder(this); + return new GetTransientTokenRequestBuilder(sdkConfiguration); } /** @@ -98,157 +69,18 @@ public class Authentication implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetTransientTokenResponse getTransientToken( - GetTransientTokenQueryParamType type, - Scope scope) throws Exception { + public GetTransientTokenResponse getTransientToken(GetTransientTokenQueryParamType type, Scope scope) throws Exception { GetTransientTokenRequest request = GetTransientTokenRequest .builder() .type(type) .scope(scope) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/security/token"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetTransientTokenRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTransientToken", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTransientToken", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTransientToken", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTransientToken", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetTransientTokenResponse.Builder _resBuilder = - GetTransientTokenResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetTransientTokenResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTransientTokenBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTransientTokenUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetTransientToken.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Source Connection Information * @@ -258,7 +90,7 @@ public class Authentication implements * @return The call builder */ public GetSourceConnectionInformationRequestBuilder getSourceConnectionInformation() { - return new GetSourceConnectionInformationRequestBuilder(this); + return new GetSourceConnectionInformationRequestBuilder(sdkConfiguration); } /** @@ -271,155 +103,17 @@ public class Authentication implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetSourceConnectionInformationResponse getSourceConnectionInformation( - String source) throws Exception { + public GetSourceConnectionInformationResponse getSourceConnectionInformation(String source) throws Exception { GetSourceConnectionInformationRequest request = GetSourceConnectionInformationRequest .builder() .source(source) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/security/resources"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetSourceConnectionInformationRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSourceConnectionInformation", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSourceConnectionInformation", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSourceConnectionInformation", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSourceConnectionInformation", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetSourceConnectionInformationResponse.Builder _resBuilder = - GetSourceConnectionInformationResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetSourceConnectionInformationResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSourceConnectionInformationBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSourceConnectionInformationUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetSourceConnectionInformation.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Token Details * @@ -428,7 +122,7 @@ public class Authentication implements * @return The call builder */ public GetTokenDetailsRequestBuilder getTokenDetails() { - return new GetTokenDetailsRequestBuilder(this); + return new GetTokenDetailsRequestBuilder(sdkConfiguration); } /** @@ -442,7 +136,7 @@ public class Authentication implements public GetTokenDetailsResponse getTokenDetailsDirect() throws Exception { return getTokenDetails(Optional.empty()); } - + /** * Get Token Details * @@ -452,159 +146,12 @@ public class Authentication implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetTokenDetailsResponse getTokenDetails( - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_TOKEN_DETAILS_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - _baseUrl, - "/user"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTokenDetails", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTokenDetails", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTokenDetails", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTokenDetails", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetTokenDetailsResponse.Builder _resBuilder = - GetTokenDetailsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetTokenDetailsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTokenDetailsUserPlexAccount _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withUserPlexAccount(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTokenDetailsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTokenDetailsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetTokenDetailsResponse getTokenDetails(Optional serverURL) throws Exception { + RequestlessOperation operation + = new GetTokenDetails.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest()); } - - /** * Get User Sign In Data * @@ -613,7 +160,7 @@ public class Authentication implements * @return The call builder */ public PostUsersSignInDataRequestBuilder postUsersSignInData() { - return new PostUsersSignInDataRequestBuilder(this); + return new PostUsersSignInDataRequestBuilder(sdkConfiguration); } /** @@ -621,183 +168,28 @@ public class Authentication implements * *

Sign in user with username and password and return user data with Plex authentication token * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public PostUsersSignInDataResponse postUsersSignInData( - PostUsersSignInDataRequest request) throws Exception { + public PostUsersSignInDataResponse postUsersSignInData(PostUsersSignInDataRequest request) throws Exception { return postUsersSignInData(request, Optional.empty()); } - + /** * Get User Sign In Data * *

Sign in user with username and password and return user data with Plex authentication token * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all 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( - PostUsersSignInDataRequest request, - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(POST_USERS_SIGN_IN_DATA_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - _baseUrl, - "/users/signin"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "requestBody", - "form", - false); - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - Optional _hookSecuritySource = Optional.empty(); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-users-sign-in-data", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-users-sign-in-data", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-users-sign-in-data", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-users-sign-in-data", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostUsersSignInDataResponse.Builder _resBuilder = - PostUsersSignInDataResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostUsersSignInDataResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "201")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PostUsersSignInDataUserPlexAccount _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withUserPlexAccount(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PostUsersSignInDataBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PostUsersSignInDataUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public PostUsersSignInDataResponse postUsersSignInData(PostUsersSignInDataRequest request, Optional serverURL) throws Exception { + RequestOperation operation + = new PostUsersSignInData.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Butler.java b/src/main/java/dev/plexapi/sdk/Butler.java index 6e6622e5..27c19b82 100644 --- a/src/main/java/dev/plexapi/sdk/Butler.java +++ b/src/main/java/dev/plexapi/sdk/Butler.java @@ -3,23 +3,12 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetButlerTasksBadRequest; -import dev.plexapi.sdk.models.errors.GetButlerTasksUnauthorized; -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.errors.StartTaskBadRequest; -import dev.plexapi.sdk.models.errors.StartTaskUnauthorized; -import dev.plexapi.sdk.models.errors.StopAllTasksBadRequest; -import dev.plexapi.sdk.models.errors.StopAllTasksUnauthorized; -import dev.plexapi.sdk.models.errors.StopTaskBadRequest; -import dev.plexapi.sdk.models.errors.StopTaskUnauthorized; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetButlerTasksRequestBuilder; import dev.plexapi.sdk.models.operations.GetButlerTasksResponse; -import dev.plexapi.sdk.models.operations.GetButlerTasksResponseBody; import dev.plexapi.sdk.models.operations.PathParamTaskName; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.StartAllTasksRequestBuilder; import dev.plexapi.sdk.models.operations.StartAllTasksResponse; import dev.plexapi.sdk.models.operations.StartTaskRequest; @@ -31,36 +20,33 @@ import dev.plexapi.sdk.models.operations.StopTaskRequest; import dev.plexapi.sdk.models.operations.StopTaskRequestBuilder; import dev.plexapi.sdk.models.operations.StopTaskResponse; import dev.plexapi.sdk.models.operations.TaskName; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetButlerTasks; +import dev.plexapi.sdk.operations.StartAllTasks; +import dev.plexapi.sdk.operations.StartTask; +import dev.plexapi.sdk.operations.StopAllTasks; +import dev.plexapi.sdk.operations.StopTask; import java.lang.Exception; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; -import java.util.Optional; /** * Butler is the task manager of the Plex Media Server Ecosystem. */ -public class Butler implements - MethodCallGetButlerTasks, - MethodCallStartAllTasks, - MethodCallStopAllTasks, - MethodCallStartTask, - MethodCallStopTask { - +public class Butler { private final SDKConfiguration sdkConfiguration; + private final AsyncButler asyncSDK; Butler(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncButler(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncButler async() { + return asyncSDK; + } /** * Get Butler tasks @@ -70,7 +56,7 @@ public class Butler implements * @return The call builder */ public GetButlerTasksRequestBuilder getButlerTasks() { - return new GetButlerTasksRequestBuilder(this); + return new GetButlerTasksRequestBuilder(sdkConfiguration); } /** @@ -82,153 +68,11 @@ public class Butler implements * @throws Exception if the API call fails */ public GetButlerTasksResponse getButlerTasksDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/butler"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getButlerTasks", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getButlerTasks", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getButlerTasks", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getButlerTasks", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetButlerTasksResponse.Builder _resBuilder = - GetButlerTasksResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetButlerTasksResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetButlerTasksResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetButlerTasksBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetButlerTasksUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetButlerTasks.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Start all Butler tasks * @@ -241,7 +85,7 @@ public class Butler implements * @return The call builder */ public StartAllTasksRequestBuilder startAllTasks() { - return new StartAllTasksRequestBuilder(this); + return new StartAllTasksRequestBuilder(sdkConfiguration); } /** @@ -257,142 +101,11 @@ public class Butler implements * @throws Exception if the API call fails */ public StartAllTasksResponse startAllTasksDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/butler"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "startAllTasks", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "startAllTasks", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "startAllTasks", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "startAllTasks", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - StartAllTasksResponse.Builder _resBuilder = - StartAllTasksResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - StartAllTasksResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StartAllTasksBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StartAllTasksUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new StartAllTasks.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Stop all Butler tasks * @@ -401,7 +114,7 @@ public class Butler implements * @return The call builder */ public StopAllTasksRequestBuilder stopAllTasks() { - return new StopAllTasksRequestBuilder(this); + return new StopAllTasksRequestBuilder(sdkConfiguration); } /** @@ -413,142 +126,11 @@ public class Butler implements * @throws Exception if the API call fails */ public StopAllTasksResponse stopAllTasksDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/butler"); - - HTTPRequest _req = new HTTPRequest(_url, "DELETE"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopAllTasks", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopAllTasks", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopAllTasks", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopAllTasks", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - StopAllTasksResponse.Builder _resBuilder = - StopAllTasksResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - StopAllTasksResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StopAllTasksBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StopAllTasksUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new StopAllTasks.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Start a single Butler task * @@ -561,7 +143,7 @@ public class Butler implements * @return The call builder */ public StartTaskRequestBuilder startTask() { - return new StartTaskRequestBuilder(this); + return new StartTaskRequestBuilder(sdkConfiguration); } /** @@ -577,152 +159,17 @@ public class Butler implements * @return The response from the API call * @throws Exception if the API call fails */ - public StartTaskResponse startTask( - TaskName taskName) throws Exception { + public StartTaskResponse startTask(TaskName taskName) throws Exception { StartTaskRequest request = StartTaskRequest .builder() .taskName(taskName) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - StartTaskRequest.class, - _baseUrl, - "/butler/{taskName}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "startTask", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "startTask", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "startTask", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "startTask", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - StartTaskResponse.Builder _resBuilder = - StartTaskResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - StartTaskResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200", "202")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StartTaskBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StartTaskUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new StartTask.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Stop a single Butler task * @@ -731,7 +178,7 @@ public class Butler implements * @return The call builder */ public StopTaskRequestBuilder stopTask() { - return new StopTaskRequestBuilder(this); + return new StopTaskRequestBuilder(sdkConfiguration); } /** @@ -743,148 +190,15 @@ public class Butler implements * @return The response from the API call * @throws Exception if the API call fails */ - public StopTaskResponse stopTask( - PathParamTaskName taskName) throws Exception { + public StopTaskResponse stopTask(PathParamTaskName taskName) throws Exception { StopTaskRequest request = StopTaskRequest .builder() .taskName(taskName) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - StopTaskRequest.class, - _baseUrl, - "/butler/{taskName}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "DELETE"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopTask", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopTask", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopTask", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopTask", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - StopTaskResponse.Builder _resBuilder = - StopTaskResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - StopTaskResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StopTaskBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StopTaskUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new StopTask.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Hubs.java b/src/main/java/dev/plexapi/sdk/Hubs.java index 85fa7a6c..db6dbd88 100644 --- a/src/main/java/dev/plexapi/sdk/Hubs.java +++ b/src/main/java/dev/plexapi/sdk/Hubs.java @@ -3,56 +3,46 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetGlobalHubsBadRequest; -import dev.plexapi.sdk.models.errors.GetGlobalHubsUnauthorized; -import dev.plexapi.sdk.models.errors.GetLibraryHubsBadRequest; -import dev.plexapi.sdk.models.errors.GetLibraryHubsUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetGlobalHubsRequest; import dev.plexapi.sdk.models.operations.GetGlobalHubsRequestBuilder; import dev.plexapi.sdk.models.operations.GetGlobalHubsResponse; -import dev.plexapi.sdk.models.operations.GetGlobalHubsResponseBody; import dev.plexapi.sdk.models.operations.GetLibraryHubsRequest; import dev.plexapi.sdk.models.operations.GetLibraryHubsRequestBuilder; import dev.plexapi.sdk.models.operations.GetLibraryHubsResponse; -import dev.plexapi.sdk.models.operations.GetLibraryHubsResponseBody; import dev.plexapi.sdk.models.operations.GetRecentlyAddedRequest; import dev.plexapi.sdk.models.operations.GetRecentlyAddedRequestBuilder; import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponse; -import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponseBody; import dev.plexapi.sdk.models.operations.OnlyTransient; import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetGlobalHubs; +import dev.plexapi.sdk.operations.GetLibraryHubs; +import dev.plexapi.sdk.operations.GetRecentlyAdded; import java.lang.Double; import java.lang.Exception; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; import java.util.Optional; /** * Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. */ -public class Hubs implements - MethodCallGetGlobalHubs, - MethodCallGetRecentlyAdded, - MethodCallGetLibraryHubs { - +public class Hubs { private final SDKConfiguration sdkConfiguration; + private final AsyncHubs asyncSDK; Hubs(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncHubs(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncHubs async() { + return asyncSDK; + } /** * Get Global Hubs @@ -62,7 +52,7 @@ public class Hubs implements * @return The call builder */ public GetGlobalHubsRequestBuilder getGlobalHubs() { - return new GetGlobalHubsRequestBuilder(this); + return new GetGlobalHubsRequestBuilder(sdkConfiguration); } /** @@ -76,7 +66,7 @@ public class Hubs implements public GetGlobalHubsResponse getGlobalHubsDirect() throws Exception { return getGlobalHubs(Optional.empty(), Optional.empty()); } - + /** * Get Global Hubs * @@ -87,168 +77,18 @@ public class Hubs implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetGlobalHubsResponse getGlobalHubs( - Optional count, - Optional onlyTransient) throws Exception { + public GetGlobalHubsResponse getGlobalHubs(Optional count, Optional onlyTransient) throws Exception { GetGlobalHubsRequest request = GetGlobalHubsRequest .builder() .count(count) .onlyTransient(onlyTransient) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/hubs"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetGlobalHubsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getGlobalHubs", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getGlobalHubs", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getGlobalHubs", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getGlobalHubs", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetGlobalHubsResponse.Builder _resBuilder = - GetGlobalHubsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetGlobalHubsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGlobalHubsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGlobalHubsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGlobalHubsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetGlobalHubs.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Recently Added * @@ -257,7 +97,7 @@ public class Hubs implements * @return The call builder */ public GetRecentlyAddedRequestBuilder getRecentlyAdded() { - return new GetRecentlyAddedRequestBuilder(this); + return new GetRecentlyAddedRequestBuilder(sdkConfiguration); } /** @@ -265,132 +105,16 @@ public class Hubs implements * *

This endpoint will return the recently added content. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetRecentlyAddedResponse getRecentlyAdded( - GetRecentlyAddedRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/hubs/home/recentlyAdded"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetRecentlyAddedRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-recently-added", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-recently-added", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-recently-added", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-recently-added", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetRecentlyAddedResponse.Builder _resBuilder = - GetRecentlyAddedResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetRecentlyAddedResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetRecentlyAddedResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetRecentlyAddedResponse getRecentlyAdded(GetRecentlyAddedRequest request) throws Exception { + RequestOperation operation + = new GetRecentlyAdded.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get library specific hubs * @@ -399,7 +123,7 @@ public class Hubs implements * @return The call builder */ public GetLibraryHubsRequestBuilder getLibraryHubs() { - return new GetLibraryHubsRequestBuilder(this); + return new GetLibraryHubsRequestBuilder(sdkConfiguration); } /** @@ -411,11 +135,10 @@ public class Hubs implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetLibraryHubsResponse getLibraryHubs( - double sectionId) throws Exception { + public GetLibraryHubsResponse getLibraryHubs(double sectionId) throws Exception { return getLibraryHubs(sectionId, Optional.empty(), Optional.empty()); } - + /** * Get library specific hubs * @@ -428,8 +151,7 @@ public class Hubs implements * @throws Exception if the API call fails */ public GetLibraryHubsResponse getLibraryHubs( - double sectionId, - Optional count, + double sectionId, Optional count, Optional onlyTransient) throws Exception { GetLibraryHubsRequest request = GetLibraryHubsRequest @@ -438,157 +160,9 @@ public class Hubs implements .count(count) .onlyTransient(onlyTransient) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetLibraryHubsRequest.class, - _baseUrl, - "/hubs/sections/{sectionId}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetLibraryHubsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getLibraryHubs", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getLibraryHubs", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getLibraryHubs", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getLibraryHubs", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetLibraryHubsResponse.Builder _resBuilder = - GetLibraryHubsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetLibraryHubsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryHubsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryHubsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryHubsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetLibraryHubs.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Library.java b/src/main/java/dev/plexapi/sdk/Library.java index d8951f7c..c29792ca 100644 --- a/src/main/java/dev/plexapi/sdk/Library.java +++ b/src/main/java/dev/plexapi/sdk/Library.java @@ -3,40 +3,9 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.DeleteLibraryBadRequest; -import dev.plexapi.sdk.models.errors.DeleteLibraryUnauthorized; -import dev.plexapi.sdk.models.errors.GetActorsLibraryBadRequest; -import dev.plexapi.sdk.models.errors.GetActorsLibraryUnauthorized; -import dev.plexapi.sdk.models.errors.GetAllLibrariesBadRequest; -import dev.plexapi.sdk.models.errors.GetAllLibrariesUnauthorized; -import dev.plexapi.sdk.models.errors.GetCountriesLibraryBadRequest; -import dev.plexapi.sdk.models.errors.GetCountriesLibraryUnauthorized; -import dev.plexapi.sdk.models.errors.GetFileHashBadRequest; -import dev.plexapi.sdk.models.errors.GetFileHashUnauthorized; -import dev.plexapi.sdk.models.errors.GetGenresLibraryBadRequest; -import dev.plexapi.sdk.models.errors.GetGenresLibraryUnauthorized; -import dev.plexapi.sdk.models.errors.GetLibraryDetailsBadRequest; -import dev.plexapi.sdk.models.errors.GetLibraryDetailsUnauthorized; -import dev.plexapi.sdk.models.errors.GetLibraryItemsBadRequest; -import dev.plexapi.sdk.models.errors.GetLibraryItemsUnauthorized; -import dev.plexapi.sdk.models.errors.GetLibrarySectionsAllBadRequest; -import dev.plexapi.sdk.models.errors.GetLibrarySectionsAllUnauthorized; -import dev.plexapi.sdk.models.errors.GetMediaMetaDataBadRequest; -import dev.plexapi.sdk.models.errors.GetMediaMetaDataUnauthorized; -import dev.plexapi.sdk.models.errors.GetMetadataChildrenBadRequest; -import dev.plexapi.sdk.models.errors.GetMetadataChildrenUnauthorized; -import dev.plexapi.sdk.models.errors.GetRecentlyAddedLibraryBadRequest; -import dev.plexapi.sdk.models.errors.GetRecentlyAddedLibraryUnauthorized; -import dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataBadRequest; -import dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataUnauthorized; -import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesBadRequest; -import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesUnauthorized; -import dev.plexapi.sdk.models.errors.GetSearchLibraryBadRequest; -import dev.plexapi.sdk.models.errors.GetSearchLibraryUnauthorized; -import dev.plexapi.sdk.models.errors.GetTopWatchedContentBadRequest; -import dev.plexapi.sdk.models.errors.GetTopWatchedContentUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + import dev.plexapi.sdk.models.operations.DeleteLibraryRequest; import dev.plexapi.sdk.models.operations.DeleteLibraryRequestBuilder; import dev.plexapi.sdk.models.operations.DeleteLibraryResponse; @@ -45,15 +14,12 @@ import dev.plexapi.sdk.models.operations.GetActorsLibraryQueryParamType; import dev.plexapi.sdk.models.operations.GetActorsLibraryRequest; import dev.plexapi.sdk.models.operations.GetActorsLibraryRequestBuilder; import dev.plexapi.sdk.models.operations.GetActorsLibraryResponse; -import dev.plexapi.sdk.models.operations.GetActorsLibraryResponseBody; import dev.plexapi.sdk.models.operations.GetAllLibrariesRequestBuilder; import dev.plexapi.sdk.models.operations.GetAllLibrariesResponse; -import dev.plexapi.sdk.models.operations.GetAllLibrariesResponseBody; import dev.plexapi.sdk.models.operations.GetCountriesLibraryQueryParamType; import dev.plexapi.sdk.models.operations.GetCountriesLibraryRequest; import dev.plexapi.sdk.models.operations.GetCountriesLibraryRequestBuilder; import dev.plexapi.sdk.models.operations.GetCountriesLibraryResponse; -import dev.plexapi.sdk.models.operations.GetCountriesLibraryResponseBody; import dev.plexapi.sdk.models.operations.GetFileHashRequest; import dev.plexapi.sdk.models.operations.GetFileHashRequestBuilder; import dev.plexapi.sdk.models.operations.GetFileHashResponse; @@ -61,57 +27,45 @@ import dev.plexapi.sdk.models.operations.GetGenresLibraryQueryParamType; import dev.plexapi.sdk.models.operations.GetGenresLibraryRequest; import dev.plexapi.sdk.models.operations.GetGenresLibraryRequestBuilder; import dev.plexapi.sdk.models.operations.GetGenresLibraryResponse; -import dev.plexapi.sdk.models.operations.GetGenresLibraryResponseBody; import dev.plexapi.sdk.models.operations.GetLibraryDetailsRequest; import dev.plexapi.sdk.models.operations.GetLibraryDetailsRequestBuilder; import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponse; -import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponseBody; import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest; import dev.plexapi.sdk.models.operations.GetLibraryItemsRequestBuilder; import dev.plexapi.sdk.models.operations.GetLibraryItemsResponse; -import dev.plexapi.sdk.models.operations.GetLibraryItemsResponseBody; import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllRequest; import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllRequestBuilder; import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllResponse; -import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllResponseBody; import dev.plexapi.sdk.models.operations.GetMediaArtsRequest; import dev.plexapi.sdk.models.operations.GetMediaArtsRequestBuilder; import dev.plexapi.sdk.models.operations.GetMediaArtsResponse; -import dev.plexapi.sdk.models.operations.GetMediaArtsResponseBody; import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequest; import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequestBuilder; import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponse; -import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponseBody; import dev.plexapi.sdk.models.operations.GetMediaPostersRequest; import dev.plexapi.sdk.models.operations.GetMediaPostersRequestBuilder; import dev.plexapi.sdk.models.operations.GetMediaPostersResponse; -import dev.plexapi.sdk.models.operations.GetMediaPostersResponseBody; import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequest; import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequestBuilder; import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponse; -import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponseBody; import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryRequest; import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryRequestBuilder; import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryResponse; -import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryResponseBody; import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataRequest; import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataRequestBuilder; import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataResponse; import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequest; import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequestBuilder; import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponse; -import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponseBody; import dev.plexapi.sdk.models.operations.GetSearchLibraryQueryParamType; import dev.plexapi.sdk.models.operations.GetSearchLibraryRequest; import dev.plexapi.sdk.models.operations.GetSearchLibraryRequestBuilder; import dev.plexapi.sdk.models.operations.GetSearchLibraryResponse; -import dev.plexapi.sdk.models.operations.GetSearchLibraryResponseBody; import dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamIncludeGuids; import dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamType; import dev.plexapi.sdk.models.operations.GetTopWatchedContentRequest; import dev.plexapi.sdk.models.operations.GetTopWatchedContentRequestBuilder; import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponse; -import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponseBody; import dev.plexapi.sdk.models.operations.IncludeDetails; import dev.plexapi.sdk.models.operations.PostMediaArtsRequest; import dev.plexapi.sdk.models.operations.PostMediaArtsRequestBuilder; @@ -119,56 +73,51 @@ import dev.plexapi.sdk.models.operations.PostMediaArtsResponse; import dev.plexapi.sdk.models.operations.PostMediaPosterRequest; import dev.plexapi.sdk.models.operations.PostMediaPosterRequestBuilder; import dev.plexapi.sdk.models.operations.PostMediaPosterResponse; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.SerializedBody; -import dev.plexapi.sdk.utils.Utils.JsonShape; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.DeleteLibrary; +import dev.plexapi.sdk.operations.GetActorsLibrary; +import dev.plexapi.sdk.operations.GetAllLibraries; +import dev.plexapi.sdk.operations.GetCountriesLibrary; +import dev.plexapi.sdk.operations.GetFileHash; +import dev.plexapi.sdk.operations.GetGenresLibrary; +import dev.plexapi.sdk.operations.GetLibraryDetails; +import dev.plexapi.sdk.operations.GetLibraryItems; +import dev.plexapi.sdk.operations.GetLibrarySectionsAll; +import dev.plexapi.sdk.operations.GetMediaArts; +import dev.plexapi.sdk.operations.GetMediaMetaData; +import dev.plexapi.sdk.operations.GetMediaPosters; +import dev.plexapi.sdk.operations.GetMetadataChildren; +import dev.plexapi.sdk.operations.GetRecentlyAddedLibrary; +import dev.plexapi.sdk.operations.GetRefreshLibraryMetadata; +import dev.plexapi.sdk.operations.GetSearchAllLibraries; +import dev.plexapi.sdk.operations.GetSearchLibrary; +import dev.plexapi.sdk.operations.GetTopWatchedContent; +import dev.plexapi.sdk.operations.PostMediaArts; +import dev.plexapi.sdk.operations.PostMediaPoster; import java.lang.Double; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; import java.util.Optional; /** * API Calls interacting with Plex Media Server Libraries */ -public class Library implements - MethodCallGetFileHash, - MethodCallGetRecentlyAddedLibrary, - MethodCallGetAllLibraries, - MethodCallGetLibraryDetails, - MethodCallDeleteLibrary, - MethodCallGetLibraryItems, - MethodCallGetLibrarySectionsAll, - MethodCallGetRefreshLibraryMetadata, - MethodCallGetSearchLibrary, - MethodCallGetGenresLibrary, - MethodCallGetCountriesLibrary, - MethodCallGetActorsLibrary, - MethodCallGetSearchAllLibraries, - MethodCallGetMediaMetaData, - MethodCallGetMediaArts, - MethodCallPostMediaArts, - MethodCallGetMediaPosters, - MethodCallPostMediaPoster, - MethodCallGetMetadataChildren, - MethodCallGetTopWatchedContent { - +public class Library { private final SDKConfiguration sdkConfiguration; + private final AsyncLibrary asyncSDK; Library(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncLibrary(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncLibrary async() { + return asyncSDK; + } /** * Get Hash Value @@ -178,7 +127,7 @@ public class Library implements * @return The call builder */ public GetFileHashRequestBuilder getFileHash() { - return new GetFileHashRequestBuilder(this); + return new GetFileHashRequestBuilder(sdkConfiguration); } /** @@ -190,11 +139,10 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetFileHashResponse getFileHash( - String url) throws Exception { + public GetFileHashResponse getFileHash(String url) throws Exception { return getFileHash(url, Optional.empty()); } - + /** * Get Hash Value * @@ -205,157 +153,18 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetFileHashResponse getFileHash( - String url, - Optional type) throws Exception { + public GetFileHashResponse getFileHash(String url, Optional type) throws Exception { GetFileHashRequest request = GetFileHashRequest .builder() .url(url) .type(type) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/library/hashes"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetFileHashRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getFileHash", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getFileHash", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getFileHash", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getFileHash", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetFileHashResponse.Builder _resBuilder = - GetFileHashResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetFileHashResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetFileHashBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetFileHashUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetFileHash.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Recently Added * @@ -364,7 +173,7 @@ public class Library implements * @return The call builder */ public GetRecentlyAddedLibraryRequestBuilder getRecentlyAddedLibrary() { - return new GetRecentlyAddedLibraryRequestBuilder(this); + return new GetRecentlyAddedLibraryRequestBuilder(sdkConfiguration); } /** @@ -372,164 +181,16 @@ public class Library implements * *

This endpoint will return the recently added content. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetRecentlyAddedLibraryResponse getRecentlyAddedLibrary( - GetRecentlyAddedLibraryRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/library/recentlyAdded"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetRecentlyAddedLibraryRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-recently-added-library", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-recently-added-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-recently-added-library", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-recently-added-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetRecentlyAddedLibraryResponse.Builder _resBuilder = - GetRecentlyAddedLibraryResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetRecentlyAddedLibraryResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetRecentlyAddedLibraryResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetRecentlyAddedLibraryBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetRecentlyAddedLibraryUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetRecentlyAddedLibraryResponse getRecentlyAddedLibrary(GetRecentlyAddedLibraryRequest request) throws Exception { + RequestOperation operation + = new GetRecentlyAddedLibrary.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get All Libraries * @@ -543,7 +204,7 @@ public class Library implements * @return The call builder */ public GetAllLibrariesRequestBuilder getAllLibraries() { - return new GetAllLibrariesRequestBuilder(this); + return new GetAllLibrariesRequestBuilder(sdkConfiguration); } /** @@ -560,153 +221,11 @@ public class Library implements * @throws Exception if the API call fails */ public GetAllLibrariesResponse getAllLibrariesDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/library/sections"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-all-libraries", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-all-libraries", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-all-libraries", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-all-libraries", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetAllLibrariesResponse.Builder _resBuilder = - GetAllLibrariesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetAllLibrariesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetAllLibrariesResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetAllLibrariesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetAllLibrariesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetAllLibraries.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Library Details * @@ -753,7 +272,7 @@ public class Library implements * @return The call builder */ public GetLibraryDetailsRequestBuilder getLibraryDetails() { - return new GetLibraryDetailsRequestBuilder(this); + return new GetLibraryDetailsRequestBuilder(sdkConfiguration); } /** @@ -805,11 +324,10 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetLibraryDetailsResponse getLibraryDetails( - int sectionKey) throws Exception { + public GetLibraryDetailsResponse getLibraryDetails(int sectionKey) throws Exception { return getLibraryDetails(Optional.empty(), sectionKey); } - + /** * Get Library Details * @@ -862,170 +380,18 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetLibraryDetailsResponse getLibraryDetails( - Optional includeDetails, - int sectionKey) throws Exception { + public GetLibraryDetailsResponse getLibraryDetails(Optional includeDetails, int sectionKey) throws Exception { GetLibraryDetailsRequest request = GetLibraryDetailsRequest .builder() .includeDetails(includeDetails) .sectionKey(sectionKey) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetLibraryDetailsRequest.class, - _baseUrl, - "/library/sections/{sectionKey}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetLibraryDetailsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-details", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-details", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-details", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-details", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetLibraryDetailsResponse.Builder _resBuilder = - GetLibraryDetailsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetLibraryDetailsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryDetailsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryDetailsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryDetailsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetLibraryDetails.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Delete Library Section * @@ -1034,7 +400,7 @@ public class Library implements * @return The call builder */ public DeleteLibraryRequestBuilder deleteLibrary() { - return new DeleteLibraryRequestBuilder(this); + return new DeleteLibraryRequestBuilder(sdkConfiguration); } /** @@ -1048,152 +414,17 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public DeleteLibraryResponse deleteLibrary( - int sectionKey) throws Exception { + public DeleteLibraryResponse deleteLibrary(int sectionKey) throws Exception { DeleteLibraryRequest request = DeleteLibraryRequest .builder() .sectionKey(sectionKey) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - DeleteLibraryRequest.class, - _baseUrl, - "/library/sections/{sectionKey}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "DELETE"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteLibrary", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteLibrary", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteLibrary", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deleteLibrary", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeleteLibraryResponse.Builder _resBuilder = - DeleteLibraryResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeleteLibraryResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - DeleteLibraryBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - DeleteLibraryUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeleteLibrary.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Library Items * @@ -1222,7 +453,7 @@ public class Library implements * @return The call builder */ public GetLibraryItemsRequestBuilder getLibraryItems() { - return new GetLibraryItemsRequestBuilder(this); + return new GetLibraryItemsRequestBuilder(sdkConfiguration); } /** @@ -1250,166 +481,16 @@ public class Library implements * - `folder`: Items categorized by folder. * - `albums`: Items categorized by album. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetLibraryItemsResponse getLibraryItems( - GetLibraryItemsRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetLibraryItemsRequest.class, - _baseUrl, - "/library/sections/{sectionKey}/{tag}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetLibraryItemsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-items", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-items", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-items", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-items", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetLibraryItemsResponse.Builder _resBuilder = - GetLibraryItemsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetLibraryItemsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryItemsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryItemsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibraryItemsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetLibraryItemsResponse getLibraryItems(GetLibraryItemsRequest request) throws Exception { + RequestOperation operation + = new GetLibraryItems.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Library section media by tag ALL * @@ -1418,7 +499,7 @@ public class Library implements * @return The call builder */ public GetLibrarySectionsAllRequestBuilder getLibrarySectionsAll() { - return new GetLibrarySectionsAllRequestBuilder(this); + return new GetLibrarySectionsAllRequestBuilder(sdkConfiguration); } /** @@ -1426,166 +507,16 @@ public class Library implements * *

Retrieves a list of all general media data for this library. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetLibrarySectionsAllResponse getLibrarySectionsAll( - GetLibrarySectionsAllRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetLibrarySectionsAllRequest.class, - _baseUrl, - "/library/sections/{sectionKey}/all", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetLibrarySectionsAllRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-sections-all", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-sections-all", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-sections-all", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-library-sections-all", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetLibrarySectionsAllResponse.Builder _resBuilder = - GetLibrarySectionsAllResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetLibrarySectionsAllResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibrarySectionsAllResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibrarySectionsAllBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetLibrarySectionsAllUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetLibrarySectionsAllResponse getLibrarySectionsAll(GetLibrarySectionsAllRequest request) throws Exception { + RequestOperation operation + = new GetLibrarySectionsAll.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Refresh Metadata Of The Library * @@ -1594,7 +525,7 @@ public class Library implements * @return The call builder */ public GetRefreshLibraryMetadataRequestBuilder getRefreshLibraryMetadata() { - return new GetRefreshLibraryMetadataRequestBuilder(this); + return new GetRefreshLibraryMetadataRequestBuilder(sdkConfiguration); } /** @@ -1608,11 +539,10 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata( - int sectionKey) throws Exception { + public GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata(int sectionKey) throws Exception { return getRefreshLibraryMetadata(Optional.empty(), sectionKey); } - + /** * Refresh Metadata Of The Library * @@ -1625,159 +555,18 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata( - Optional force, - int sectionKey) throws Exception { + public GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata(Optional force, int sectionKey) throws Exception { GetRefreshLibraryMetadataRequest request = GetRefreshLibraryMetadataRequest .builder() .force(force) .sectionKey(sectionKey) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetRefreshLibraryMetadataRequest.class, - _baseUrl, - "/library/sections/{sectionKey}/refresh", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetRefreshLibraryMetadataRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-refresh-library-metadata", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-refresh-library-metadata", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-refresh-library-metadata", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-refresh-library-metadata", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetRefreshLibraryMetadataResponse.Builder _resBuilder = - GetRefreshLibraryMetadataResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetRefreshLibraryMetadataResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetRefreshLibraryMetadataBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetRefreshLibraryMetadataUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetRefreshLibraryMetadata.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Search Library * @@ -1803,7 +592,7 @@ public class Library implements * @return The call builder */ public GetSearchLibraryRequestBuilder getSearchLibrary() { - return new GetSearchLibraryRequestBuilder(this); + return new GetSearchLibraryRequestBuilder(sdkConfiguration); } /** @@ -1841,170 +630,18 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetSearchLibraryResponse getSearchLibrary( - int sectionKey, - GetSearchLibraryQueryParamType type) throws Exception { + public GetSearchLibraryResponse getSearchLibrary(int sectionKey, GetSearchLibraryQueryParamType type) throws Exception { GetSearchLibraryRequest request = GetSearchLibraryRequest .builder() .sectionKey(sectionKey) .type(type) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetSearchLibraryRequest.class, - _baseUrl, - "/library/sections/{sectionKey}/search", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetSearchLibraryRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-search-library", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-search-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-search-library", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-search-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetSearchLibraryResponse.Builder _resBuilder = - GetSearchLibraryResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetSearchLibraryResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchLibraryResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchLibraryBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchLibraryUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetSearchLibrary.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Genres of library media * @@ -2013,7 +650,7 @@ public class Library implements * @return The call builder */ public GetGenresLibraryRequestBuilder getGenresLibrary() { - return new GetGenresLibraryRequestBuilder(this); + return new GetGenresLibraryRequestBuilder(sdkConfiguration); } /** @@ -2034,170 +671,18 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetGenresLibraryResponse getGenresLibrary( - int sectionKey, - GetGenresLibraryQueryParamType type) throws Exception { + public GetGenresLibraryResponse getGenresLibrary(int sectionKey, GetGenresLibraryQueryParamType type) throws Exception { GetGenresLibraryRequest request = GetGenresLibraryRequest .builder() .sectionKey(sectionKey) .type(type) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetGenresLibraryRequest.class, - _baseUrl, - "/library/sections/{sectionKey}/genre", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetGenresLibraryRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-genres-library", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-genres-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-genres-library", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-genres-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetGenresLibraryResponse.Builder _resBuilder = - GetGenresLibraryResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetGenresLibraryResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGenresLibraryResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGenresLibraryBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGenresLibraryUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetGenresLibrary.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Countries of library media * @@ -2206,7 +691,7 @@ public class Library implements * @return The call builder */ public GetCountriesLibraryRequestBuilder getCountriesLibrary() { - return new GetCountriesLibraryRequestBuilder(this); + return new GetCountriesLibraryRequestBuilder(sdkConfiguration); } /** @@ -2227,170 +712,18 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetCountriesLibraryResponse getCountriesLibrary( - int sectionKey, - GetCountriesLibraryQueryParamType type) throws Exception { + public GetCountriesLibraryResponse getCountriesLibrary(int sectionKey, GetCountriesLibraryQueryParamType type) throws Exception { GetCountriesLibraryRequest request = GetCountriesLibraryRequest .builder() .sectionKey(sectionKey) .type(type) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetCountriesLibraryRequest.class, - _baseUrl, - "/library/sections/{sectionKey}/country", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetCountriesLibraryRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-countries-library", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-countries-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-countries-library", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-countries-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetCountriesLibraryResponse.Builder _resBuilder = - GetCountriesLibraryResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetCountriesLibraryResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetCountriesLibraryResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetCountriesLibraryBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetCountriesLibraryUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetCountriesLibrary.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Actors of library media * @@ -2399,7 +732,7 @@ public class Library implements * @return The call builder */ public GetActorsLibraryRequestBuilder getActorsLibrary() { - return new GetActorsLibraryRequestBuilder(this); + return new GetActorsLibraryRequestBuilder(sdkConfiguration); } /** @@ -2420,170 +753,18 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetActorsLibraryResponse getActorsLibrary( - int sectionKey, - GetActorsLibraryQueryParamType type) throws Exception { + public GetActorsLibraryResponse getActorsLibrary(int sectionKey, GetActorsLibraryQueryParamType type) throws Exception { GetActorsLibraryRequest request = GetActorsLibraryRequest .builder() .sectionKey(sectionKey) .type(type) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetActorsLibraryRequest.class, - _baseUrl, - "/library/sections/{sectionKey}/actor", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetActorsLibraryRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-actors-library", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-actors-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-actors-library", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-actors-library", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetActorsLibraryResponse.Builder _resBuilder = - GetActorsLibraryResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetActorsLibraryResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetActorsLibraryResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetActorsLibraryBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetActorsLibraryUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetActorsLibrary.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Search All Libraries * @@ -2592,7 +773,7 @@ public class Library implements * @return The call builder */ public GetSearchAllLibrariesRequestBuilder getSearchAllLibraries() { - return new GetSearchAllLibrariesRequestBuilder(this); + return new GetSearchAllLibrariesRequestBuilder(sdkConfiguration); } /** @@ -2600,165 +781,16 @@ public class Library implements * *

Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetSearchAllLibrariesResponse getSearchAllLibraries( - GetSearchAllLibrariesRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/library/search"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetSearchAllLibrariesRequest.class, - request, - null)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-search-all-libraries", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-search-all-libraries", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-search-all-libraries", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-search-all-libraries", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetSearchAllLibrariesResponse.Builder _resBuilder = - GetSearchAllLibrariesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetSearchAllLibrariesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchAllLibrariesResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchAllLibrariesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchAllLibrariesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetSearchAllLibrariesResponse getSearchAllLibraries(GetSearchAllLibrariesRequest request) throws Exception { + RequestOperation operation + = new GetSearchAllLibraries.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Media Metadata * @@ -2768,7 +800,7 @@ public class Library implements * @return The call builder */ public GetMediaMetaDataRequestBuilder getMediaMetaData() { - return new GetMediaMetaDataRequestBuilder(this); + return new GetMediaMetaDataRequestBuilder(sdkConfiguration); } /** @@ -2777,166 +809,16 @@ public class Library implements *

This endpoint will return all the (meta)data of one or more library items specified by the ratingKey. * Multiple rating keys can be provided as a comma-separated list (e.g., "21119,21617"). * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetMediaMetaDataResponse getMediaMetaData( - GetMediaMetaDataRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetMediaMetaDataRequest.class, - _baseUrl, - "/library/metadata/{ratingKey}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetMediaMetaDataRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-meta-data", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-meta-data", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-meta-data", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-meta-data", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetMediaMetaDataResponse.Builder _resBuilder = - GetMediaMetaDataResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetMediaMetaDataResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMediaMetaDataResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMediaMetaDataBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMediaMetaDataUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetMediaMetaDataResponse getMediaMetaData(GetMediaMetaDataRequest request) throws Exception { + RequestOperation operation + = new GetMediaMetaData.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Media Background Artwork * @@ -2945,7 +827,7 @@ public class Library implements * @return The call builder */ public GetMediaArtsRequestBuilder getMediaArts() { - return new GetMediaArtsRequestBuilder(this); + return new GetMediaArtsRequestBuilder(sdkConfiguration); } /** @@ -2957,131 +839,17 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetMediaArtsResponse getMediaArts( - long ratingKey) throws Exception { + public GetMediaArtsResponse getMediaArts(long ratingKey) throws Exception { GetMediaArtsRequest request = GetMediaArtsRequest .builder() .ratingKey(ratingKey) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetMediaArtsRequest.class, - _baseUrl, - "/library/metadata/{ratingKey}/arts", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-arts", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-arts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-arts", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-arts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetMediaArtsResponse.Builder _resBuilder = - GetMediaArtsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetMediaArtsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMediaArtsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetMediaArts.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Upload Media Background Artwork * @@ -3090,7 +858,7 @@ public class Library implements * @return The call builder */ public PostMediaArtsRequestBuilder postMediaArts() { - return new PostMediaArtsRequestBuilder(this); + return new PostMediaArtsRequestBuilder(sdkConfiguration); } /** @@ -3102,11 +870,10 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public PostMediaArtsResponse postMediaArts( - long ratingKey) throws Exception { + public PostMediaArtsResponse postMediaArts(long ratingKey) throws Exception { return postMediaArts(ratingKey, Optional.empty(), Optional.empty()); } - + /** * Upload Media Background Artwork * @@ -3119,8 +886,7 @@ public class Library implements * @throws Exception if the API call fails */ public PostMediaArtsResponse postMediaArts( - long ratingKey, - Optional url, + long ratingKey, Optional url, Optional requestBody) throws Exception { PostMediaArtsRequest request = PostMediaArtsRequest @@ -3129,128 +895,11 @@ public class Library implements .url(url) .requestBody(requestBody) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - PostMediaArtsRequest.class, - _baseUrl, - "/library/metadata/{ratingKey}/arts", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "requestBody", - "raw", - false); - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - PostMediaArtsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-media-arts", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-media-arts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-media-arts", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-media-arts", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostMediaArtsResponse.Builder _resBuilder = - PostMediaArtsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostMediaArtsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostMediaArts.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Media Posters * @@ -3259,7 +908,7 @@ public class Library implements * @return The call builder */ public GetMediaPostersRequestBuilder getMediaPosters() { - return new GetMediaPostersRequestBuilder(this); + return new GetMediaPostersRequestBuilder(sdkConfiguration); } /** @@ -3271,131 +920,17 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetMediaPostersResponse getMediaPosters( - long ratingKey) throws Exception { + public GetMediaPostersResponse getMediaPosters(long ratingKey) throws Exception { GetMediaPostersRequest request = GetMediaPostersRequest .builder() .ratingKey(ratingKey) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetMediaPostersRequest.class, - _baseUrl, - "/library/metadata/{ratingKey}/posters", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-posters", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-posters", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-posters", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-posters", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetMediaPostersResponse.Builder _resBuilder = - GetMediaPostersResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetMediaPostersResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMediaPostersResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetMediaPosters.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Upload Media Poster * @@ -3404,7 +939,7 @@ public class Library implements * @return The call builder */ public PostMediaPosterRequestBuilder postMediaPoster() { - return new PostMediaPosterRequestBuilder(this); + return new PostMediaPosterRequestBuilder(sdkConfiguration); } /** @@ -3416,11 +951,10 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public PostMediaPosterResponse postMediaPoster( - long ratingKey) throws Exception { + public PostMediaPosterResponse postMediaPoster(long ratingKey) throws Exception { return postMediaPoster(ratingKey, Optional.empty(), Optional.empty()); } - + /** * Upload Media Poster * @@ -3433,8 +967,7 @@ public class Library implements * @throws Exception if the API call fails */ public PostMediaPosterResponse postMediaPoster( - long ratingKey, - Optional url, + long ratingKey, Optional url, Optional requestBody) throws Exception { PostMediaPosterRequest request = PostMediaPosterRequest @@ -3443,128 +976,11 @@ public class Library implements .url(url) .requestBody(requestBody) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - PostMediaPosterRequest.class, - _baseUrl, - "/library/metadata/{ratingKey}/posters", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "requestBody", - "raw", - false); - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "*/*") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - PostMediaPosterRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-media-poster", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-media-poster", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-media-poster", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "post-media-poster", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PostMediaPosterResponse.Builder _resBuilder = - PostMediaPosterResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PostMediaPosterResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PostMediaPoster.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Items Children * @@ -3573,7 +989,7 @@ public class Library implements * @return The call builder */ public GetMetadataChildrenRequestBuilder getMetadataChildren() { - return new GetMetadataChildrenRequestBuilder(this); + return new GetMetadataChildrenRequestBuilder(sdkConfiguration); } /** @@ -3585,11 +1001,10 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetMetadataChildrenResponse getMetadataChildren( - double ratingKey) throws Exception { + public GetMetadataChildrenResponse getMetadataChildren(double ratingKey) throws Exception { return getMetadataChildren(ratingKey, Optional.empty()); } - + /** * Get Items Children * @@ -3601,170 +1016,18 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetMetadataChildrenResponse getMetadataChildren( - double ratingKey, - Optional includeElements) throws Exception { + public GetMetadataChildrenResponse getMetadataChildren(double ratingKey, Optional includeElements) throws Exception { GetMetadataChildrenRequest request = GetMetadataChildrenRequest .builder() .ratingKey(ratingKey) .includeElements(includeElements) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetMetadataChildrenRequest.class, - _baseUrl, - "/library/metadata/{ratingKey}/children", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetMetadataChildrenRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getMetadataChildren", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getMetadataChildren", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getMetadataChildren", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getMetadataChildren", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetMetadataChildrenResponse.Builder _resBuilder = - GetMetadataChildrenResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetMetadataChildrenResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMetadataChildrenResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMetadataChildrenBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMetadataChildrenUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetMetadataChildren.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Top Watched Content * @@ -3773,7 +1036,7 @@ public class Library implements * @return The call builder */ public GetTopWatchedContentRequestBuilder getTopWatchedContent() { - return new GetTopWatchedContentRequestBuilder(this); + return new GetTopWatchedContentRequestBuilder(sdkConfiguration); } /** @@ -3791,11 +1054,10 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetTopWatchedContentResponse getTopWatchedContent( - GetTopWatchedContentQueryParamType type) throws Exception { + public GetTopWatchedContentResponse getTopWatchedContent(GetTopWatchedContentQueryParamType type) throws Exception { return getTopWatchedContent(type, Optional.empty()); } - + /** * Get Top Watched Content * @@ -3813,164 +1075,16 @@ public class Library implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetTopWatchedContentResponse getTopWatchedContent( - GetTopWatchedContentQueryParamType type, - Optional includeGuids) throws Exception { + public GetTopWatchedContentResponse getTopWatchedContent(GetTopWatchedContentQueryParamType type, Optional includeGuids) throws Exception { GetTopWatchedContentRequest request = GetTopWatchedContentRequest .builder() .type(type) .includeGuids(includeGuids) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/library/all/top"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetTopWatchedContentRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTopWatchedContent", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTopWatchedContent", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTopWatchedContent", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTopWatchedContent", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetTopWatchedContentResponse.Builder _resBuilder = - GetTopWatchedContentResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetTopWatchedContentResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTopWatchedContentResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTopWatchedContentBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTopWatchedContentUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetTopWatchedContent.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Log.java b/src/main/java/dev/plexapi/sdk/Log.java index 1bf76d80..169429c1 100644 --- a/src/main/java/dev/plexapi/sdk/Log.java +++ b/src/main/java/dev/plexapi/sdk/Log.java @@ -3,14 +3,9 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.EnablePaperTrailBadRequest; -import dev.plexapi.sdk.models.errors.EnablePaperTrailUnauthorized; -import dev.plexapi.sdk.models.errors.LogLineBadRequest; -import dev.plexapi.sdk.models.errors.LogLineUnauthorized; -import dev.plexapi.sdk.models.errors.LogMultiLineBadRequest; -import dev.plexapi.sdk.models.errors.LogMultiLineUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + import dev.plexapi.sdk.models.operations.EnablePaperTrailRequestBuilder; import dev.plexapi.sdk.models.operations.EnablePaperTrailResponse; import dev.plexapi.sdk.models.operations.Level; @@ -19,38 +14,32 @@ import dev.plexapi.sdk.models.operations.LogLineRequestBuilder; import dev.plexapi.sdk.models.operations.LogLineResponse; import dev.plexapi.sdk.models.operations.LogMultiLineRequestBuilder; import dev.plexapi.sdk.models.operations.LogMultiLineResponse; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.SerializedBody; -import dev.plexapi.sdk.utils.Utils.JsonShape; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.EnablePaperTrail; +import dev.plexapi.sdk.operations.LogLine; +import dev.plexapi.sdk.operations.LogMultiLine; import java.lang.Exception; -import java.lang.Object; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; -import java.util.Optional; /** * Submit logs to the Log Handler for Plex Media Server */ -public class Log implements - MethodCallLogLine, - MethodCallLogMultiLine, - MethodCallEnablePaperTrail { - +public class Log { private final SDKConfiguration sdkConfiguration; + private final AsyncLog asyncSDK; Log(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncLog(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncLog async() { + return asyncSDK; + } /** * Logging a single line message. @@ -60,7 +49,7 @@ public class Log implements * @return The call builder */ public LogLineRequestBuilder logLine() { - return new LogLineRequestBuilder(this); + return new LogLineRequestBuilder(sdkConfiguration); } /** @@ -81,8 +70,7 @@ public class Log implements * @throws Exception if the API call fails */ public LogLineResponse logLine( - Level level, - String message, + Level level, String message, String source) throws Exception { LogLineRequest request = LogLineRequest @@ -91,148 +79,11 @@ public class Log implements .message(message) .source(source) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/log"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - LogLineRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "logLine", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "logLine", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "logLine", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "logLine", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - LogLineResponse.Builder _resBuilder = - LogLineResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - LogLineResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - LogLineBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - LogLineUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new LogLine.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Logging a multi-line message * @@ -261,7 +112,7 @@ public class Log implements * @return The call builder */ public LogMultiLineRequestBuilder logMultiLine() { - return new LogMultiLineRequestBuilder(this); + return new LogMultiLineRequestBuilder(sdkConfiguration); } /** @@ -289,161 +140,16 @@ public class Log implements * *

Ensure each parameter is properly URL-encoded to avoid interpretation issues. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public LogMultiLineResponse logMultiLine( - String request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/log"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - Object _convertedRequest = Utils.convertToShape( - request, - JsonShape.DEFAULT, - new TypeReference() {}); - SerializedBody _serializedRequestBody = Utils.serializeRequestBody( - _convertedRequest, - "request", - "string", - false); - if (_serializedRequestBody == null) { - throw new Exception("Request body is required"); - } - _req.setBody(Optional.ofNullable(_serializedRequestBody)); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "logMultiLine", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "logMultiLine", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "logMultiLine", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "logMultiLine", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - LogMultiLineResponse.Builder _resBuilder = - LogMultiLineResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - LogMultiLineResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - LogMultiLineBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - LogMultiLineUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public LogMultiLineResponse logMultiLine(String request) throws Exception { + RequestOperation operation + = new LogMultiLine.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Enabling Papertrail * @@ -452,7 +158,7 @@ public class Log implements * @return The call builder */ public EnablePaperTrailRequestBuilder enablePaperTrail() { - return new EnablePaperTrailRequestBuilder(this); + return new EnablePaperTrailRequestBuilder(sdkConfiguration); } /** @@ -464,138 +170,9 @@ public class Log implements * @throws Exception if the API call fails */ public EnablePaperTrailResponse enablePaperTrailDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/log/networked"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "enablePaperTrail", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "enablePaperTrail", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "enablePaperTrail", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "enablePaperTrail", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - EnablePaperTrailResponse.Builder _resBuilder = - EnablePaperTrailResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - EnablePaperTrailResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - EnablePaperTrailBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - EnablePaperTrailUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "403", "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new EnablePaperTrail.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/Media.java b/src/main/java/dev/plexapi/sdk/Media.java index 0337b9e4..e376a214 100644 --- a/src/main/java/dev/plexapi/sdk/Media.java +++ b/src/main/java/dev/plexapi/sdk/Media.java @@ -3,18 +3,8 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetBannerImageBadRequest; -import dev.plexapi.sdk.models.errors.GetBannerImageUnauthorized; -import dev.plexapi.sdk.models.errors.GetThumbImageBadRequest; -import dev.plexapi.sdk.models.errors.GetThumbImageUnauthorized; -import dev.plexapi.sdk.models.errors.MarkPlayedBadRequest; -import dev.plexapi.sdk.models.errors.MarkPlayedUnauthorized; -import dev.plexapi.sdk.models.errors.MarkUnplayedBadRequest; -import dev.plexapi.sdk.models.errors.MarkUnplayedUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; -import dev.plexapi.sdk.models.errors.UpdatePlayProgressBadRequest; -import dev.plexapi.sdk.models.errors.UpdatePlayProgressUnauthorized; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetBannerImageRequest; import dev.plexapi.sdk.models.operations.GetBannerImageRequestBuilder; import dev.plexapi.sdk.models.operations.GetBannerImageResponse; @@ -27,40 +17,37 @@ import dev.plexapi.sdk.models.operations.MarkPlayedResponse; import dev.plexapi.sdk.models.operations.MarkUnplayedRequest; import dev.plexapi.sdk.models.operations.MarkUnplayedRequestBuilder; import dev.plexapi.sdk.models.operations.MarkUnplayedResponse; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest; import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequestBuilder; import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetBannerImage; +import dev.plexapi.sdk.operations.GetThumbImage; +import dev.plexapi.sdk.operations.MarkPlayed; +import dev.plexapi.sdk.operations.MarkUnplayed; +import dev.plexapi.sdk.operations.UpdatePlayProgress; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; -import java.util.Optional; /** * API Calls interacting with Plex Media Server Media */ -public class Media implements - MethodCallMarkPlayed, - MethodCallMarkUnplayed, - MethodCallUpdatePlayProgress, - MethodCallGetBannerImage, - MethodCallGetThumbImage { - +public class Media { private final SDKConfiguration sdkConfiguration; + private final AsyncMedia asyncSDK; Media(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncMedia(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncMedia async() { + return asyncSDK; + } /** * Mark Media Played @@ -70,7 +57,7 @@ public class Media implements * @return The call builder */ public MarkPlayedRequestBuilder markPlayed() { - return new MarkPlayedRequestBuilder(this); + return new MarkPlayedRequestBuilder(sdkConfiguration); } /** @@ -82,155 +69,17 @@ public class Media implements * @return The response from the API call * @throws Exception if the API call fails */ - public MarkPlayedResponse markPlayed( - double key) throws Exception { + public MarkPlayedResponse markPlayed(double key) throws Exception { MarkPlayedRequest request = MarkPlayedRequest .builder() .key(key) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/:/scrobble"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - MarkPlayedRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "markPlayed", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "markPlayed", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "markPlayed", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "markPlayed", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - MarkPlayedResponse.Builder _resBuilder = - MarkPlayedResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - MarkPlayedResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - MarkPlayedBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - MarkPlayedUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new MarkPlayed.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Mark Media Unplayed * @@ -239,7 +88,7 @@ public class Media implements * @return The call builder */ public MarkUnplayedRequestBuilder markUnplayed() { - return new MarkUnplayedRequestBuilder(this); + return new MarkUnplayedRequestBuilder(sdkConfiguration); } /** @@ -251,155 +100,17 @@ public class Media implements * @return The response from the API call * @throws Exception if the API call fails */ - public MarkUnplayedResponse markUnplayed( - double key) throws Exception { + public MarkUnplayedResponse markUnplayed(double key) throws Exception { MarkUnplayedRequest request = MarkUnplayedRequest .builder() .key(key) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/:/unscrobble"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - MarkUnplayedRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "markUnplayed", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "markUnplayed", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "markUnplayed", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "markUnplayed", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - MarkUnplayedResponse.Builder _resBuilder = - MarkUnplayedResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - MarkUnplayedResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - MarkUnplayedBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - MarkUnplayedUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new MarkUnplayed.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Update Media Play Progress * @@ -408,7 +119,7 @@ public class Media implements * @return The call builder */ public UpdatePlayProgressRequestBuilder updatePlayProgress() { - return new UpdatePlayProgressRequestBuilder(this); + return new UpdatePlayProgressRequestBuilder(sdkConfiguration); } /** @@ -423,8 +134,7 @@ public class Media implements * @throws Exception if the API call fails */ public UpdatePlayProgressResponse updatePlayProgress( - String key, - double time, + String key, double time, String state) throws Exception { UpdatePlayProgressRequest request = UpdatePlayProgressRequest @@ -433,148 +143,11 @@ public class Media implements .time(time) .state(state) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/:/progress"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - UpdatePlayProgressRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatePlayProgress", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatePlayProgress", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatePlayProgress", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatePlayProgress", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - UpdatePlayProgressResponse.Builder _resBuilder = - UpdatePlayProgressResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - UpdatePlayProgressResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - UpdatePlayProgressBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - UpdatePlayProgressUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new UpdatePlayProgress.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Banner Image * @@ -583,7 +156,7 @@ public class Media implements * @return The call builder */ public GetBannerImageRequestBuilder getBannerImage() { - return new GetBannerImageRequestBuilder(this); + return new GetBannerImageRequestBuilder(sdkConfiguration); } /** @@ -591,167 +164,16 @@ public class Media implements * *

Gets the banner image of the media item * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetBannerImageResponse getBannerImage( - GetBannerImageRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetBannerImageRequest.class, - _baseUrl, - "/library/metadata/{ratingKey}/banner", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "image/jpeg") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetBannerImageRequest.class, - request, - null)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-banner-image", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-banner-image", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-banner-image", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-banner-image", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetBannerImageResponse.Builder _resBuilder = - GetBannerImageResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200") && Utils.contentTypeMatches(_contentType, "image/jpeg")) { - _resBuilder.responseStream(_httpRes.body()); - } - - GetBannerImageResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - _res.withHeaders(_httpRes.headers().map()); - if (Utils.contentTypeMatches(_contentType, "image/jpeg")) { - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetBannerImageBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetBannerImageUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetBannerImageResponse getBannerImage(GetBannerImageRequest request) throws Exception { + RequestOperation operation + = new GetBannerImage.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Thumb Image * @@ -760,7 +182,7 @@ public class Media implements * @return The call builder */ public GetThumbImageRequestBuilder getThumbImage() { - return new GetThumbImageRequestBuilder(this); + return new GetThumbImageRequestBuilder(sdkConfiguration); } /** @@ -768,163 +190,14 @@ public class Media implements * *

Gets the thumbnail image of the media item * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetThumbImageResponse getThumbImage( - GetThumbImageRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetThumbImageRequest.class, - _baseUrl, - "/library/metadata/{ratingKey}/thumb", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "image/jpeg") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetThumbImageRequest.class, - request, - null)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-thumb-image", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-thumb-image", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-thumb-image", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-thumb-image", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetThumbImageResponse.Builder _resBuilder = - GetThumbImageResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200") && Utils.contentTypeMatches(_contentType, "image/jpeg")) { - _resBuilder.responseStream(_httpRes.body()); - } - - GetThumbImageResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - _res.withHeaders(_httpRes.headers().map()); - if (Utils.contentTypeMatches(_contentType, "image/jpeg")) { - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetThumbImageBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetThumbImageUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetThumbImageResponse getThumbImage(GetThumbImageRequest request) throws Exception { + RequestOperation operation + = new GetThumbImage.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Playlists.java b/src/main/java/dev/plexapi/sdk/Playlists.java index a8a3776f..eca4fdc0 100644 --- a/src/main/java/dev/plexapi/sdk/Playlists.java +++ b/src/main/java/dev/plexapi/sdk/Playlists.java @@ -3,37 +3,17 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.AddPlaylistContentsBadRequest; -import dev.plexapi.sdk.models.errors.AddPlaylistContentsUnauthorized; -import dev.plexapi.sdk.models.errors.ClearPlaylistContentsBadRequest; -import dev.plexapi.sdk.models.errors.ClearPlaylistContentsUnauthorized; -import dev.plexapi.sdk.models.errors.CreatePlaylistBadRequest; -import dev.plexapi.sdk.models.errors.CreatePlaylistUnauthorized; -import dev.plexapi.sdk.models.errors.DeletePlaylistBadRequest; -import dev.plexapi.sdk.models.errors.DeletePlaylistUnauthorized; -import dev.plexapi.sdk.models.errors.GetPlaylistBadRequest; -import dev.plexapi.sdk.models.errors.GetPlaylistContentsBadRequest; -import dev.plexapi.sdk.models.errors.GetPlaylistContentsUnauthorized; -import dev.plexapi.sdk.models.errors.GetPlaylistUnauthorized; -import dev.plexapi.sdk.models.errors.GetPlaylistsBadRequest; -import dev.plexapi.sdk.models.errors.GetPlaylistsUnauthorized; -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.errors.UploadPlaylistBadRequest; -import dev.plexapi.sdk.models.errors.UploadPlaylistUnauthorized; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.AddPlaylistContentsRequest; import dev.plexapi.sdk.models.operations.AddPlaylistContentsRequestBuilder; import dev.plexapi.sdk.models.operations.AddPlaylistContentsResponse; -import dev.plexapi.sdk.models.operations.AddPlaylistContentsResponseBody; import dev.plexapi.sdk.models.operations.ClearPlaylistContentsRequest; import dev.plexapi.sdk.models.operations.ClearPlaylistContentsRequestBuilder; import dev.plexapi.sdk.models.operations.ClearPlaylistContentsResponse; import dev.plexapi.sdk.models.operations.CreatePlaylistRequest; import dev.plexapi.sdk.models.operations.CreatePlaylistRequestBuilder; import dev.plexapi.sdk.models.operations.CreatePlaylistResponse; -import dev.plexapi.sdk.models.operations.CreatePlaylistResponseBody; import dev.plexapi.sdk.models.operations.DeletePlaylistRequest; import dev.plexapi.sdk.models.operations.DeletePlaylistRequestBuilder; import dev.plexapi.sdk.models.operations.DeletePlaylistResponse; @@ -41,38 +21,33 @@ import dev.plexapi.sdk.models.operations.GetPlaylistContentsQueryParamType; import dev.plexapi.sdk.models.operations.GetPlaylistContentsRequest; import dev.plexapi.sdk.models.operations.GetPlaylistContentsRequestBuilder; import dev.plexapi.sdk.models.operations.GetPlaylistContentsResponse; -import dev.plexapi.sdk.models.operations.GetPlaylistContentsResponseBody; import dev.plexapi.sdk.models.operations.GetPlaylistRequest; import dev.plexapi.sdk.models.operations.GetPlaylistRequestBuilder; import dev.plexapi.sdk.models.operations.GetPlaylistResponse; -import dev.plexapi.sdk.models.operations.GetPlaylistResponseBody; import dev.plexapi.sdk.models.operations.GetPlaylistsRequest; import dev.plexapi.sdk.models.operations.GetPlaylistsRequestBuilder; import dev.plexapi.sdk.models.operations.GetPlaylistsResponse; -import dev.plexapi.sdk.models.operations.GetPlaylistsResponseBody; import dev.plexapi.sdk.models.operations.PlaylistType; import dev.plexapi.sdk.models.operations.QueryParamForce; import dev.plexapi.sdk.models.operations.QueryParamSmart; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.UpdatePlaylistRequest; import dev.plexapi.sdk.models.operations.UpdatePlaylistRequestBuilder; import dev.plexapi.sdk.models.operations.UpdatePlaylistResponse; import dev.plexapi.sdk.models.operations.UploadPlaylistRequest; import dev.plexapi.sdk.models.operations.UploadPlaylistRequestBuilder; import dev.plexapi.sdk.models.operations.UploadPlaylistResponse; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.AddPlaylistContents; +import dev.plexapi.sdk.operations.ClearPlaylistContents; +import dev.plexapi.sdk.operations.CreatePlaylist; +import dev.plexapi.sdk.operations.DeletePlaylist; +import dev.plexapi.sdk.operations.GetPlaylist; +import dev.plexapi.sdk.operations.GetPlaylistContents; +import dev.plexapi.sdk.operations.GetPlaylists; +import dev.plexapi.sdk.operations.UpdatePlaylist; +import dev.plexapi.sdk.operations.UploadPlaylist; import java.lang.Double; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; import java.util.Optional; /** @@ -81,23 +56,23 @@ import java.util.Optional; * Retrieving a playlist, or its items, will trigger a refresh of its metadata. * This may cause the duration and number of items to change. */ -public class Playlists implements - MethodCallCreatePlaylist, - MethodCallGetPlaylists, - MethodCallGetPlaylist, - MethodCallDeletePlaylist, - MethodCallUpdatePlaylist, - MethodCallGetPlaylistContents, - MethodCallClearPlaylistContents, - MethodCallAddPlaylistContents, - MethodCallUploadPlaylist { - +public class Playlists { private final SDKConfiguration sdkConfiguration; + private final AsyncPlaylists asyncSDK; Playlists(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncPlaylists(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncPlaylists async() { + return asyncSDK; + } /** * Create a Playlist @@ -109,7 +84,7 @@ public class Playlists implements * @return The call builder */ public CreatePlaylistRequestBuilder createPlaylist() { - return new CreatePlaylistRequestBuilder(this); + return new CreatePlaylistRequestBuilder(sdkConfiguration); } /** @@ -119,164 +94,16 @@ public class Playlists implements * - `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`). * - `playQueueID` - To create a playlist from an existing play queue. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public CreatePlaylistResponse createPlaylist( - CreatePlaylistRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/playlists"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - CreatePlaylistRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "createPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "createPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "createPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CreatePlaylistResponse.Builder _resBuilder = - CreatePlaylistResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CreatePlaylistResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CreatePlaylistResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CreatePlaylistBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CreatePlaylistUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public CreatePlaylistResponse createPlaylist(CreatePlaylistRequest request) throws Exception { + RequestOperation operation + = new CreatePlaylist.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get All Playlists * @@ -285,7 +112,7 @@ public class Playlists implements * @return The call builder */ public GetPlaylistsRequestBuilder getPlaylists() { - return new GetPlaylistsRequestBuilder(this); + return new GetPlaylistsRequestBuilder(sdkConfiguration); } /** @@ -299,7 +126,7 @@ public class Playlists implements public GetPlaylistsResponse getPlaylistsDirect() throws Exception { return getPlaylists(Optional.empty(), Optional.empty()); } - + /** * Get All Playlists * @@ -310,168 +137,18 @@ public class Playlists implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetPlaylistsResponse getPlaylists( - Optional playlistType, - Optional smart) throws Exception { + public GetPlaylistsResponse getPlaylists(Optional playlistType, Optional smart) throws Exception { GetPlaylistsRequest request = GetPlaylistsRequest .builder() .playlistType(playlistType) .smart(smart) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/playlists"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetPlaylistsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylists", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylists", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylists", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylists", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetPlaylistsResponse.Builder _resBuilder = - GetPlaylistsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetPlaylistsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetPlaylists.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Retrieve Playlist * @@ -481,7 +158,7 @@ public class Playlists implements * @return The call builder */ public GetPlaylistRequestBuilder getPlaylist() { - return new GetPlaylistRequestBuilder(this); + return new GetPlaylistRequestBuilder(sdkConfiguration); } /** @@ -494,163 +171,17 @@ public class Playlists implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetPlaylistResponse getPlaylist( - double playlistID) throws Exception { + public GetPlaylistResponse getPlaylist(double playlistID) throws Exception { GetPlaylistRequest request = GetPlaylistRequest .builder() .playlistID(playlistID) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetPlaylistRequest.class, - _baseUrl, - "/playlists/{playlistID}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetPlaylistResponse.Builder _resBuilder = - GetPlaylistResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetPlaylistResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetPlaylist.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Deletes a Playlist * @@ -659,7 +190,7 @@ public class Playlists implements * @return The call builder */ public DeletePlaylistRequestBuilder deletePlaylist() { - return new DeletePlaylistRequestBuilder(this); + return new DeletePlaylistRequestBuilder(sdkConfiguration); } /** @@ -671,152 +202,17 @@ public class Playlists implements * @return The response from the API call * @throws Exception if the API call fails */ - public DeletePlaylistResponse deletePlaylist( - double playlistID) throws Exception { + public DeletePlaylistResponse deletePlaylist(double playlistID) throws Exception { DeletePlaylistRequest request = DeletePlaylistRequest .builder() .playlistID(playlistID) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - DeletePlaylistRequest.class, - _baseUrl, - "/playlists/{playlistID}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "DELETE"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletePlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletePlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletePlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "deletePlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - DeletePlaylistResponse.Builder _resBuilder = - DeletePlaylistResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - DeletePlaylistResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "204")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - DeletePlaylistBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - DeletePlaylistUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new DeletePlaylist.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Update a Playlist * @@ -825,7 +221,7 @@ public class Playlists implements * @return The call builder */ public UpdatePlaylistRequestBuilder updatePlaylist() { - return new UpdatePlaylistRequestBuilder(this); + return new UpdatePlaylistRequestBuilder(sdkConfiguration); } /** @@ -837,11 +233,10 @@ public class Playlists implements * @return The response from the API call * @throws Exception if the API call fails */ - public UpdatePlaylistResponse updatePlaylist( - double playlistID) throws Exception { + public UpdatePlaylistResponse updatePlaylist(double playlistID) throws Exception { return updatePlaylist(playlistID, Optional.empty(), Optional.empty()); } - + /** * Update a Playlist * @@ -854,8 +249,7 @@ public class Playlists implements * @throws Exception if the API call fails */ public UpdatePlaylistResponse updatePlaylist( - double playlistID, - Optional title, + double playlistID, Optional title, Optional summary) throws Exception { UpdatePlaylistRequest request = UpdatePlaylistRequest @@ -864,150 +258,11 @@ public class Playlists implements .title(title) .summary(summary) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - UpdatePlaylistRequest.class, - _baseUrl, - "/playlists/{playlistID}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "PUT"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - UpdatePlaylistRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatePlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatePlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatePlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "updatePlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - UpdatePlaylistResponse.Builder _resBuilder = - UpdatePlaylistResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - UpdatePlaylistResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - UpdatePlaylistBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - UpdatePlaylistUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new UpdatePlaylist.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Retrieve Playlist Contents * @@ -1019,7 +274,7 @@ public class Playlists implements * @return The call builder */ public GetPlaylistContentsRequestBuilder getPlaylistContents() { - return new GetPlaylistContentsRequestBuilder(this); + return new GetPlaylistContentsRequestBuilder(sdkConfiguration); } /** @@ -1041,170 +296,18 @@ public class Playlists implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetPlaylistContentsResponse getPlaylistContents( - double playlistID, - GetPlaylistContentsQueryParamType type) throws Exception { + public GetPlaylistContentsResponse getPlaylistContents(double playlistID, GetPlaylistContentsQueryParamType type) throws Exception { GetPlaylistContentsRequest request = GetPlaylistContentsRequest .builder() .playlistID(playlistID) .type(type) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - GetPlaylistContentsRequest.class, - _baseUrl, - "/playlists/{playlistID}/items", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetPlaylistContentsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetPlaylistContentsResponse.Builder _resBuilder = - GetPlaylistContentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetPlaylistContentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistContentsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistContentsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPlaylistContentsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetPlaylistContents.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Delete Playlist Contents * @@ -1213,7 +316,7 @@ public class Playlists implements * @return The call builder */ public ClearPlaylistContentsRequestBuilder clearPlaylistContents() { - return new ClearPlaylistContentsRequestBuilder(this); + return new ClearPlaylistContentsRequestBuilder(sdkConfiguration); } /** @@ -1225,152 +328,17 @@ public class Playlists implements * @return The response from the API call * @throws Exception if the API call fails */ - public ClearPlaylistContentsResponse clearPlaylistContents( - double playlistID) throws Exception { + public ClearPlaylistContentsResponse clearPlaylistContents(double playlistID) throws Exception { ClearPlaylistContentsRequest request = ClearPlaylistContentsRequest .builder() .playlistID(playlistID) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - ClearPlaylistContentsRequest.class, - _baseUrl, - "/playlists/{playlistID}/items", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "DELETE"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "clearPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "clearPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "clearPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "clearPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ClearPlaylistContentsResponse.Builder _resBuilder = - ClearPlaylistContentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ClearPlaylistContentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ClearPlaylistContentsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ClearPlaylistContentsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ClearPlaylistContents.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Adding to a Playlist * @@ -1380,7 +348,7 @@ public class Playlists implements * @return The call builder */ public AddPlaylistContentsRequestBuilder addPlaylistContents() { - return new AddPlaylistContentsRequestBuilder(this); + return new AddPlaylistContentsRequestBuilder(sdkConfiguration); } /** @@ -1394,12 +362,10 @@ public class Playlists implements * @return The response from the API call * @throws Exception if the API call fails */ - public AddPlaylistContentsResponse addPlaylistContents( - double playlistID, - String uri) throws Exception { + public AddPlaylistContentsResponse addPlaylistContents(double playlistID, String uri) throws Exception { return addPlaylistContents(playlistID, uri, Optional.empty()); } - + /** * Adding to a Playlist * @@ -1413,8 +379,7 @@ public class Playlists implements * @throws Exception if the API call fails */ public AddPlaylistContentsResponse addPlaylistContents( - double playlistID, - String uri, + double playlistID, String uri, Optional playQueueID) throws Exception { AddPlaylistContentsRequest request = AddPlaylistContentsRequest @@ -1423,161 +388,11 @@ public class Playlists implements .uri(uri) .playQueueID(playQueueID) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - AddPlaylistContentsRequest.class, - _baseUrl, - "/playlists/{playlistID}/items", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "PUT"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - AddPlaylistContentsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "addPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "addPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "addPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "addPlaylistContents", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - AddPlaylistContentsResponse.Builder _resBuilder = - AddPlaylistContentsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - AddPlaylistContentsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - AddPlaylistContentsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - AddPlaylistContentsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - AddPlaylistContentsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new AddPlaylistContents.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Upload Playlist * @@ -1586,7 +401,7 @@ public class Playlists implements * @return The call builder */ public UploadPlaylistRequestBuilder uploadPlaylist() { - return new UploadPlaylistRequestBuilder(this); + return new UploadPlaylistRequestBuilder(sdkConfiguration); } /** @@ -1611,8 +426,7 @@ public class Playlists implements * @throws Exception if the API call fails */ public UploadPlaylistResponse uploadPlaylist( - String path, - QueryParamForce force, + String path, QueryParamForce force, long sectionID) throws Exception { UploadPlaylistRequest request = UploadPlaylistRequest @@ -1621,144 +435,9 @@ public class Playlists implements .force(force) .sectionID(sectionID) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/playlists/upload"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - UploadPlaylistRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "uploadPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "uploadPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "uploadPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "uploadPlaylist", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - UploadPlaylistResponse.Builder _resBuilder = - UploadPlaylistResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - UploadPlaylistResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - UploadPlaylistBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - UploadPlaylistUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new UploadPlaylist.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Plex.java b/src/main/java/dev/plexapi/sdk/Plex.java index eb39c3cc..ce9b4319 100644 --- a/src/main/java/dev/plexapi/sdk/Plex.java +++ b/src/main/java/dev/plexapi/sdk/Plex.java @@ -3,38 +3,21 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetCompanionsDataBadRequest; -import dev.plexapi.sdk.models.errors.GetCompanionsDataUnauthorized; -import dev.plexapi.sdk.models.errors.GetGeoDataBadRequest; -import dev.plexapi.sdk.models.errors.GetGeoDataUnauthorized; -import dev.plexapi.sdk.models.errors.GetHomeDataBadRequest; -import dev.plexapi.sdk.models.errors.GetHomeDataUnauthorized; -import dev.plexapi.sdk.models.errors.GetPinBadRequest; -import dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest; -import dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized; -import dev.plexapi.sdk.models.errors.GetTokenByPinIdBadRequest; -import dev.plexapi.sdk.models.errors.GetTokenByPinIdResponseBody; -import dev.plexapi.sdk.models.errors.GetUserFriendsBadRequest; -import dev.plexapi.sdk.models.errors.GetUserFriendsUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; -import dev.plexapi.sdk.models.operations.Friend; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetCompanionsDataRequestBuilder; import dev.plexapi.sdk.models.operations.GetCompanionsDataResponse; -import dev.plexapi.sdk.models.operations.GetGeoDataGeoData; import dev.plexapi.sdk.models.operations.GetGeoDataRequestBuilder; import dev.plexapi.sdk.models.operations.GetGeoDataResponse; import dev.plexapi.sdk.models.operations.GetHomeDataRequestBuilder; import dev.plexapi.sdk.models.operations.GetHomeDataResponse; -import dev.plexapi.sdk.models.operations.GetHomeDataResponseBody; -import dev.plexapi.sdk.models.operations.GetPinAuthPinContainer; import dev.plexapi.sdk.models.operations.GetPinRequest; import dev.plexapi.sdk.models.operations.GetPinRequestBuilder; import dev.plexapi.sdk.models.operations.GetPinResponse; import dev.plexapi.sdk.models.operations.GetServerResourcesRequest; import dev.plexapi.sdk.models.operations.GetServerResourcesRequestBuilder; import dev.plexapi.sdk.models.operations.GetServerResourcesResponse; -import dev.plexapi.sdk.models.operations.GetTokenByPinIdAuthPinContainer; import dev.plexapi.sdk.models.operations.GetTokenByPinIdRequest; import dev.plexapi.sdk.models.operations.GetTokenByPinIdRequestBuilder; import dev.plexapi.sdk.models.operations.GetTokenByPinIdResponse; @@ -43,84 +26,37 @@ import dev.plexapi.sdk.models.operations.GetUserFriendsResponse; 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.operations.PlexDevice; -import dev.plexapi.sdk.models.operations.ResponseBody; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetCompanionsData; +import dev.plexapi.sdk.operations.GetGeoData; +import dev.plexapi.sdk.operations.GetHomeData; +import dev.plexapi.sdk.operations.GetPin; +import dev.plexapi.sdk.operations.GetServerResources; +import dev.plexapi.sdk.operations.GetTokenByPinId; +import dev.plexapi.sdk.operations.GetUserFriends; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.HashMap; -import java.util.List; import java.util.Optional; /** * API Calls that perform operations directly against https://Plex.tv */ -public class Plex implements - MethodCallGetCompanionsData, - MethodCallGetUserFriends, - MethodCallGetGeoData, - MethodCallGetHomeData, - MethodCallGetServerResources, - MethodCallGetPin, - MethodCallGetTokenByPinId { - - /** - * GET_COMPANIONS_DATA_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_COMPANIONS_DATA_SERVERS = { - "https://plex.tv/api/v2", - }; - - /** - * GET_USER_FRIENDS_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_USER_FRIENDS_SERVERS = { - "https://plex.tv/api/v2", - }; - - /** - * GET_GEO_DATA_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_GEO_DATA_SERVERS = { - "https://plex.tv/api/v2", - }; - - /** - * GET_SERVER_RESOURCES_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_SERVER_RESOURCES_SERVERS = { - "https://plex.tv/api/v2", - }; - - /** - * GET_PIN_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_PIN_SERVERS = { - "https://plex.tv/api/v2", - }; - - /** - * GET_TOKEN_BY_PIN_ID_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_TOKEN_BY_PIN_ID_SERVERS = { - "https://plex.tv/api/v2", - }; - +public class Plex { private final SDKConfiguration sdkConfiguration; + private final AsyncPlex asyncSDK; Plex(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncPlex(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncPlex async() { + return asyncSDK; + } /** * Get Companions Data @@ -130,7 +66,7 @@ public class Plex implements * @return The call builder */ public GetCompanionsDataRequestBuilder getCompanionsData() { - return new GetCompanionsDataRequestBuilder(this); + return new GetCompanionsDataRequestBuilder(sdkConfiguration); } /** @@ -144,7 +80,7 @@ public class Plex implements public GetCompanionsDataResponse getCompanionsDataDirect() throws Exception { return getCompanionsData(Optional.empty()); } - + /** * Get Companions Data * @@ -154,159 +90,12 @@ public class Plex implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetCompanionsDataResponse getCompanionsData( - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_COMPANIONS_DATA_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - _baseUrl, - "/companions"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getCompanionsData", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getCompanionsData", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getCompanionsData", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getCompanionsData", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetCompanionsDataResponse.Builder _resBuilder = - GetCompanionsDataResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetCompanionsDataResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - List _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference>() {}); - _res.withResponseBodies(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetCompanionsDataBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetCompanionsDataUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetCompanionsDataResponse getCompanionsData(Optional serverURL) throws Exception { + RequestlessOperation operation + = new GetCompanionsData.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest()); } - - /** * Get list of friends of the user logged in * @@ -315,7 +104,7 @@ public class Plex implements * @return The call builder */ public GetUserFriendsRequestBuilder getUserFriends() { - return new GetUserFriendsRequestBuilder(this); + return new GetUserFriendsRequestBuilder(sdkConfiguration); } /** @@ -329,7 +118,7 @@ public class Plex implements public GetUserFriendsResponse getUserFriendsDirect() throws Exception { return getUserFriends(Optional.empty()); } - + /** * Get list of friends of the user logged in * @@ -339,159 +128,12 @@ public class Plex implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetUserFriendsResponse getUserFriends( - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_USER_FRIENDS_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - _baseUrl, - "/friends"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getUserFriends", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getUserFriends", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getUserFriends", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getUserFriends", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetUserFriendsResponse.Builder _resBuilder = - GetUserFriendsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetUserFriendsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - List _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference>() {}); - _res.withFriends(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetUserFriendsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetUserFriendsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetUserFriendsResponse getUserFriends(Optional serverURL) throws Exception { + RequestlessOperation operation + = new GetUserFriends.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Geo Data * @@ -500,7 +142,7 @@ public class Plex implements * @return The call builder */ public GetGeoDataRequestBuilder getGeoData() { - return new GetGeoDataRequestBuilder(this); + return new GetGeoDataRequestBuilder(sdkConfiguration); } /** @@ -514,7 +156,7 @@ public class Plex implements public GetGeoDataResponse getGeoDataDirect() throws Exception { return getGeoData(Optional.empty()); } - + /** * Get Geo Data * @@ -524,156 +166,12 @@ public class Plex implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetGeoDataResponse getGeoData( - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_GEO_DATA_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - _baseUrl, - "/geoip"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - Optional _hookSecuritySource = Optional.empty(); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getGeoData", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getGeoData", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getGeoData", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getGeoData", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetGeoDataResponse.Builder _resBuilder = - GetGeoDataResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetGeoDataResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGeoDataGeoData _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withGeoData(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGeoDataBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetGeoDataUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetGeoDataResponse getGeoData(Optional serverURL) throws Exception { + RequestlessOperation operation + = new GetGeoData.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Plex Home Data * @@ -682,7 +180,7 @@ public class Plex implements * @return The call builder */ public GetHomeDataRequestBuilder getHomeData() { - return new GetHomeDataRequestBuilder(this); + return new GetHomeDataRequestBuilder(sdkConfiguration); } /** @@ -694,153 +192,11 @@ public class Plex implements * @throws Exception if the API call fails */ public GetHomeDataResponse getHomeDataDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/home"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getHomeData", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getHomeData", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getHomeData", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getHomeData", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetHomeDataResponse.Builder _resBuilder = - GetHomeDataResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetHomeDataResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetHomeDataResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetHomeDataBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetHomeDataUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetHomeData.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Server Resources * @@ -849,7 +205,7 @@ public class Plex implements * @return The call builder */ public GetServerResourcesRequestBuilder getServerResources() { - return new GetServerResourcesRequestBuilder(this); + return new GetServerResourcesRequestBuilder(sdkConfiguration); } /** @@ -861,11 +217,11 @@ public class Plex implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetServerResourcesResponse getServerResources( - String clientID) throws Exception { - return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), clientID, Optional.empty()); + public GetServerResourcesResponse getServerResources(String clientID) throws Exception { + return getServerResources(Optional.empty(), Optional.empty(), Optional.empty(), + clientID, Optional.empty()); } - + /** * Get Server Resources * @@ -882,10 +238,8 @@ public class Plex implements * @throws Exception if the API call fails */ public GetServerResourcesResponse getServerResources( - Optional includeHttps, - Optional includeRelay, - Optional includeIPv6, - String clientID, + Optional includeHttps, Optional includeRelay, + Optional includeIPv6, String clientID, Optional serverURL) throws Exception { GetServerResourcesRequest request = GetServerResourcesRequest @@ -895,164 +249,11 @@ public class Plex implements .includeIPv6(includeIPv6) .clientID(clientID) .build(); - - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_SERVER_RESOURCES_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - _baseUrl, - "/resources"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetServerResourcesRequest.class, - request, - null)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-server-resources", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-server-resources", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-server-resources", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-server-resources", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetServerResourcesResponse.Builder _resBuilder = - GetServerResourcesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetServerResourcesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - List _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference>() {}); - _res.withPlexDevices(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerResourcesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerResourcesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetServerResources.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get a Pin * @@ -1061,7 +262,7 @@ public class Plex implements * @return The call builder */ public GetPinRequestBuilder getPin() { - return new GetPinRequestBuilder(this); + return new GetPinRequestBuilder(sdkConfiguration); } /** @@ -1069,166 +270,30 @@ public class Plex implements * *

Retrieve a Pin ID from Plex.tv to use for authentication flows * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetPinResponse getPin( - GetPinRequest request) throws Exception { + public GetPinResponse getPin(GetPinRequest request) throws Exception { return getPin(request, Optional.empty()); } - + /** * Get a Pin * *

Retrieve a Pin ID from Plex.tv to use for authentication flows * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all 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 GetPinResponse getPin( - GetPinRequest request, - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_PIN_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - _baseUrl, - "/pins"); - - HTTPRequest _req = new HTTPRequest(_url, "POST"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetPinRequest.class, - request, - null)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - Optional _hookSecuritySource = Optional.empty(); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPin", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPin", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getPin", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetPinResponse.Builder _resBuilder = - GetPinResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetPinResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "201")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPinAuthPinContainer _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAuthPinContainer(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetPinBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetPinResponse getPin(GetPinRequest request, Optional serverURL) throws Exception { + RequestOperation operation + = new GetPin.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Access Token by PinId * @@ -1237,7 +302,7 @@ public class Plex implements * @return The call builder */ public GetTokenByPinIdRequestBuilder getTokenByPinId() { - return new GetTokenByPinIdRequestBuilder(this); + return new GetTokenByPinIdRequestBuilder(sdkConfiguration); } /** @@ -1245,175 +310,28 @@ public class Plex implements * *

Retrieve an Access Token from Plex.tv after the Pin has been authenticated * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetTokenByPinIdResponse getTokenByPinId( - GetTokenByPinIdRequest request) throws Exception { + public GetTokenByPinIdResponse getTokenByPinId(GetTokenByPinIdRequest request) throws Exception { return getTokenByPinId(request, Optional.empty()); } - + /** * Get Access Token by PinId * *

Retrieve an Access Token from Plex.tv after the Pin has been authenticated * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all 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 GetTokenByPinIdResponse getTokenByPinId( - GetTokenByPinIdRequest request, - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_TOKEN_BY_PIN_ID_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - GetTokenByPinIdRequest.class, - _baseUrl, - "/pins/{pinID}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - Optional _hookSecuritySource = Optional.empty(); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTokenByPinId", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "404", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTokenByPinId", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTokenByPinId", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTokenByPinId", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetTokenByPinIdResponse.Builder _resBuilder = - GetTokenByPinIdResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetTokenByPinIdResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTokenByPinIdAuthPinContainer _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withAuthPinContainer(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTokenByPinIdBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "404")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTokenByPinIdResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetTokenByPinIdResponse getTokenByPinId(GetTokenByPinIdRequest request, Optional serverURL) throws Exception { + RequestOperation operation + = new GetTokenByPinId.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/PlexAPI.java b/src/main/java/dev/plexapi/sdk/PlexAPI.java index 15072e7b..0e10ff2b 100644 --- a/src/main/java/dev/plexapi/sdk/PlexAPI.java +++ b/src/main/java/dev/plexapi/sdk/PlexAPI.java @@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import dev.plexapi.sdk.utils.HTTPClient; import dev.plexapi.sdk.utils.Hook.SdkInitData; 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; @@ -145,6 +146,7 @@ public class PlexAPI { */ private final Updater updater; + private final Users users; /** @@ -269,11 +271,13 @@ public class PlexAPI { return updater; } + public Users users() { return users; } - private SDKConfiguration sdkConfiguration; + private final SDKConfiguration sdkConfiguration; + private final AsyncPlexAPI asyncSDK; /** * The Builder class allows the configuration of a new instance of the SDK. @@ -368,6 +372,23 @@ public class PlexAPI { this.sdkConfiguration.setRetryConfig(Optional.of(retryConfig)); return this; } + + /** + * Enables debug logging for HTTP requests and responses, including JSON body content. + *

+ * Convenience method that calls {@link HTTPClient#enableDebugLogging(boolean)}. + * {@link SpeakeasyHTTPClient} honors this setting. If you are using a custom HTTP client, + * it is up to the custom client to honor this setting. + *

+ * + * @param enabled Whether to enable debug logging. + * @return The builder instance. + */ + public Builder enableHTTPDebugLogging(boolean enabled) { + this.sdkConfiguration.client().enableDebugLogging(enabled); + return this; + } + /** * ServerProtocol * @@ -504,9 +525,22 @@ public class PlexAPI { this.sessions = new Sessions(sdkConfiguration); this.updater = new Updater(sdkConfiguration); this.users = new Users(sdkConfiguration); - - SdkInitData data = this.sdkConfiguration.hooks().sdkInit(new SdkInitData(this.sdkConfiguration.resolvedServerUrl(), this.sdkConfiguration.client())); + SdkInitData data = this.sdkConfiguration.hooks().sdkInit( + new SdkInitData( + this.sdkConfiguration.resolvedServerUrl(), + this.sdkConfiguration.client())); this.sdkConfiguration.setServerUrl(data.baseUrl()); this.sdkConfiguration.setClient(data.client()); + this.asyncSDK = new AsyncPlexAPI(this, sdkConfiguration); } + + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncPlexAPI async() { + return asyncSDK; + } + } diff --git a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java index 8dda11ff..50f27882 100644 --- a/src/main/java/dev/plexapi/sdk/SDKConfiguration.java +++ b/src/main/java/dev/plexapi/sdk/SDKConfiguration.java @@ -4,6 +4,7 @@ package dev.plexapi.sdk; import dev.plexapi.sdk.hooks.SDKHooks; +import dev.plexapi.sdk.utils.AsyncHooks; import dev.plexapi.sdk.utils.HTTPClient; import dev.plexapi.sdk.utils.Hooks; import dev.plexapi.sdk.utils.RetryConfig; @@ -16,13 +17,15 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "0.0.3"; - public static final String SDK_VERSION = "0.17.1"; - public static final String GEN_VERSION = "2.623.0"; + public static final String SDK_VERSION = "0.18.0"; + public static final String GEN_VERSION = "2.698.4"; private static final String BASE_PACKAGE = "dev.plexapi.sdk"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", @@ -113,11 +116,12 @@ public class SDKConfiguration { this._hooks = hooks; } - /** + /** * Initializes state (for example hooks). **/ public void initialize() { SDKHooks.initialize(_hooks); + SDKHooks.initialize(_asyncHooks); } @@ -130,9 +134,30 @@ public class SDKConfiguration { public Optional retryConfig() { return retryConfig; } - + public void setRetryConfig(Optional retryConfig) { Utils.checkNotNull(retryConfig, "retryConfig"); this.retryConfig = retryConfig; } + private ScheduledExecutorService retryScheduler = Executors.newSingleThreadScheduledExecutor(); + + public ScheduledExecutorService retryScheduler() { + return retryScheduler; + } + + public void setAsyncRetryScheduler(ScheduledExecutorService retryScheduler) { + Utils.checkNotNull(retryScheduler, "retryScheduler"); + this.retryScheduler = retryScheduler; + } + + private AsyncHooks _asyncHooks = new AsyncHooks(); + + public AsyncHooks asyncHooks() { + return _asyncHooks; + } + + public void setAsyncHooks(AsyncHooks asyncHooks) { + Utils.checkNotNull(asyncHooks, "asyncHooks"); + this._asyncHooks = asyncHooks; + } } diff --git a/src/main/java/dev/plexapi/sdk/Search.java b/src/main/java/dev/plexapi/sdk/Search.java index b72665cc..97f7b80c 100644 --- a/src/main/java/dev/plexapi/sdk/Search.java +++ b/src/main/java/dev/plexapi/sdk/Search.java @@ -3,54 +3,45 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetSearchResultsBadRequest; -import dev.plexapi.sdk.models.errors.GetSearchResultsUnauthorized; -import dev.plexapi.sdk.models.errors.PerformSearchBadRequest; -import dev.plexapi.sdk.models.errors.PerformSearchUnauthorized; -import dev.plexapi.sdk.models.errors.PerformVoiceSearchBadRequest; -import dev.plexapi.sdk.models.errors.PerformVoiceSearchUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetSearchResultsRequest; import dev.plexapi.sdk.models.operations.GetSearchResultsRequestBuilder; import dev.plexapi.sdk.models.operations.GetSearchResultsResponse; -import dev.plexapi.sdk.models.operations.GetSearchResultsResponseBody; import dev.plexapi.sdk.models.operations.PerformSearchRequest; import dev.plexapi.sdk.models.operations.PerformSearchRequestBuilder; import dev.plexapi.sdk.models.operations.PerformSearchResponse; import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequest; import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequestBuilder; import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetSearchResults; +import dev.plexapi.sdk.operations.PerformSearch; +import dev.plexapi.sdk.operations.PerformVoiceSearch; import java.lang.Double; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; import java.util.Optional; /** * API Calls that perform search operations with Plex Media Server */ -public class Search implements - MethodCallPerformSearch, - MethodCallPerformVoiceSearch, - MethodCallGetSearchResults { - +public class Search { private final SDKConfiguration sdkConfiguration; + private final AsyncSearch asyncSDK; Search(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncSearch(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncSearch async() { + return asyncSDK; + } /** * Perform a search @@ -71,7 +62,7 @@ public class Search implements * @return The call builder */ public PerformSearchRequestBuilder performSearch() { - return new PerformSearchRequestBuilder(this); + return new PerformSearchRequestBuilder(sdkConfiguration); } /** @@ -94,11 +85,10 @@ public class Search implements * @return The response from the API call * @throws Exception if the API call fails */ - public PerformSearchResponse performSearch( - String query) throws Exception { + public PerformSearchResponse performSearch(String query) throws Exception { return performSearch(query, Optional.empty(), Optional.empty()); } - + /** * Perform a search * @@ -122,8 +112,7 @@ public class Search implements * @throws Exception if the API call fails */ public PerformSearchResponse performSearch( - String query, - Optional sectionId, + String query, Optional sectionId, Optional limit) throws Exception { PerformSearchRequest request = PerformSearchRequest @@ -132,148 +121,11 @@ public class Search implements .sectionId(sectionId) .limit(limit) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/hubs/search"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - PerformSearchRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "performSearch", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "performSearch", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "performSearch", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "performSearch", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PerformSearchResponse.Builder _resBuilder = - PerformSearchResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PerformSearchResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PerformSearchBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PerformSearchUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PerformSearch.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Perform a voice search * @@ -285,7 +137,7 @@ public class Search implements * @return The call builder */ public PerformVoiceSearchRequestBuilder performVoiceSearch() { - return new PerformVoiceSearchRequestBuilder(this); + return new PerformVoiceSearchRequestBuilder(sdkConfiguration); } /** @@ -300,11 +152,10 @@ public class Search implements * @return The response from the API call * @throws Exception if the API call fails */ - public PerformVoiceSearchResponse performVoiceSearch( - String query) throws Exception { + public PerformVoiceSearchResponse performVoiceSearch(String query) throws Exception { return performVoiceSearch(query, Optional.empty(), Optional.empty()); } - + /** * Perform a voice search * @@ -320,8 +171,7 @@ public class Search implements * @throws Exception if the API call fails */ public PerformVoiceSearchResponse performVoiceSearch( - String query, - Optional sectionId, + String query, Optional sectionId, Optional limit) throws Exception { PerformVoiceSearchRequest request = PerformVoiceSearchRequest @@ -330,148 +180,11 @@ public class Search implements .sectionId(sectionId) .limit(limit) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/hubs/search/voice"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - PerformVoiceSearchRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "performVoiceSearch", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "performVoiceSearch", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "performVoiceSearch", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "performVoiceSearch", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - PerformVoiceSearchResponse.Builder _resBuilder = - PerformVoiceSearchResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - PerformVoiceSearchResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PerformVoiceSearchBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - PerformVoiceSearchUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new PerformVoiceSearch.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Search Results * @@ -480,7 +193,7 @@ public class Search implements * @return The call builder */ public GetSearchResultsRequestBuilder getSearchResults() { - return new GetSearchResultsRequestBuilder(this); + return new GetSearchResultsRequestBuilder(sdkConfiguration); } /** @@ -492,162 +205,15 @@ public class Search implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetSearchResultsResponse getSearchResults( - String query) throws Exception { + public GetSearchResultsResponse getSearchResults(String query) throws Exception { GetSearchResultsRequest request = GetSearchResultsRequest .builder() .query(query) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/search"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetSearchResultsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSearchResults", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSearchResults", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSearchResults", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSearchResults", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetSearchResultsResponse.Builder _resBuilder = - GetSearchResultsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetSearchResultsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchResultsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchResultsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSearchResultsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetSearchResults.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Server.java b/src/main/java/dev/plexapi/sdk/Server.java index 4d12afdd..27772da6 100644 --- a/src/main/java/dev/plexapi/sdk/Server.java +++ b/src/main/java/dev/plexapi/sdk/Server.java @@ -3,88 +3,61 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetAvailableClientsBadRequest; -import dev.plexapi.sdk.models.errors.GetAvailableClientsUnauthorized; -import dev.plexapi.sdk.models.errors.GetDevicesBadRequest; -import dev.plexapi.sdk.models.errors.GetDevicesUnauthorized; -import dev.plexapi.sdk.models.errors.GetMediaProvidersBadRequest; -import dev.plexapi.sdk.models.errors.GetMediaProvidersUnauthorized; -import dev.plexapi.sdk.models.errors.GetMyPlexAccountBadRequest; -import dev.plexapi.sdk.models.errors.GetMyPlexAccountUnauthorized; -import dev.plexapi.sdk.models.errors.GetResizedPhotoBadRequest; -import dev.plexapi.sdk.models.errors.GetResizedPhotoUnauthorized; -import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; -import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; -import dev.plexapi.sdk.models.errors.GetServerIdentityRequestTimeout; -import dev.plexapi.sdk.models.errors.GetServerListBadRequest; -import dev.plexapi.sdk.models.errors.GetServerListUnauthorized; -import dev.plexapi.sdk.models.errors.GetServerPreferencesBadRequest; -import dev.plexapi.sdk.models.errors.GetServerPreferencesUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetAvailableClientsRequestBuilder; import dev.plexapi.sdk.models.operations.GetAvailableClientsResponse; -import dev.plexapi.sdk.models.operations.GetAvailableClientsResponseBody; import dev.plexapi.sdk.models.operations.GetDevicesRequestBuilder; import dev.plexapi.sdk.models.operations.GetDevicesResponse; -import dev.plexapi.sdk.models.operations.GetDevicesResponseBody; import dev.plexapi.sdk.models.operations.GetMediaProvidersRequest; import dev.plexapi.sdk.models.operations.GetMediaProvidersRequestBuilder; import dev.plexapi.sdk.models.operations.GetMediaProvidersResponse; -import dev.plexapi.sdk.models.operations.GetMediaProvidersResponseBody; import dev.plexapi.sdk.models.operations.GetMyPlexAccountRequestBuilder; import dev.plexapi.sdk.models.operations.GetMyPlexAccountResponse; -import dev.plexapi.sdk.models.operations.GetMyPlexAccountResponseBody; import dev.plexapi.sdk.models.operations.GetResizedPhotoRequest; import dev.plexapi.sdk.models.operations.GetResizedPhotoRequestBuilder; import dev.plexapi.sdk.models.operations.GetResizedPhotoResponse; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesRequestBuilder; import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; -import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponseBody; import dev.plexapi.sdk.models.operations.GetServerIdentityRequestBuilder; import dev.plexapi.sdk.models.operations.GetServerIdentityResponse; -import dev.plexapi.sdk.models.operations.GetServerIdentityResponseBody; import dev.plexapi.sdk.models.operations.GetServerListRequestBuilder; import dev.plexapi.sdk.models.operations.GetServerListResponse; -import dev.plexapi.sdk.models.operations.GetServerListResponseBody; import dev.plexapi.sdk.models.operations.GetServerPreferencesRequestBuilder; import dev.plexapi.sdk.models.operations.GetServerPreferencesResponse; -import dev.plexapi.sdk.models.operations.GetServerPreferencesResponseBody; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetAvailableClients; +import dev.plexapi.sdk.operations.GetDevices; +import dev.plexapi.sdk.operations.GetMediaProviders; +import dev.plexapi.sdk.operations.GetMyPlexAccount; +import dev.plexapi.sdk.operations.GetResizedPhoto; +import dev.plexapi.sdk.operations.GetServerCapabilities; +import dev.plexapi.sdk.operations.GetServerIdentity; +import dev.plexapi.sdk.operations.GetServerList; +import dev.plexapi.sdk.operations.GetServerPreferences; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; -import java.util.Optional; /** * Operations against the Plex Media Server System. */ -public class Server implements - MethodCallGetServerCapabilities, - MethodCallGetServerPreferences, - MethodCallGetAvailableClients, - MethodCallGetDevices, - MethodCallGetServerIdentity, - MethodCallGetMyPlexAccount, - MethodCallGetResizedPhoto, - MethodCallGetMediaProviders, - MethodCallGetServerList { - +public class Server { private final SDKConfiguration sdkConfiguration; + private final AsyncServer asyncSDK; Server(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncServer(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncServer async() { + return asyncSDK; + } /** * Get Server Capabilities @@ -94,7 +67,7 @@ public class Server implements * @return The call builder */ public GetServerCapabilitiesRequestBuilder getServerCapabilities() { - return new GetServerCapabilitiesRequestBuilder(this); + return new GetServerCapabilitiesRequestBuilder(sdkConfiguration); } /** @@ -106,153 +79,11 @@ public class Server implements * @throws Exception if the API call fails */ public GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerCapabilities", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerCapabilities", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerCapabilities", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerCapabilities", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetServerCapabilitiesResponse.Builder _resBuilder = - GetServerCapabilitiesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetServerCapabilitiesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerCapabilitiesResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerCapabilitiesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerCapabilitiesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetServerCapabilities.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Server Preferences * @@ -261,7 +92,7 @@ public class Server implements * @return The call builder */ public GetServerPreferencesRequestBuilder getServerPreferences() { - return new GetServerPreferencesRequestBuilder(this); + return new GetServerPreferencesRequestBuilder(sdkConfiguration); } /** @@ -273,153 +104,11 @@ public class Server implements * @throws Exception if the API call fails */ public GetServerPreferencesResponse getServerPreferencesDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/:/prefs"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerPreferences", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerPreferences", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerPreferences", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerPreferences", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetServerPreferencesResponse.Builder _resBuilder = - GetServerPreferencesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetServerPreferencesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerPreferencesResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerPreferencesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerPreferencesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetServerPreferences.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Available Clients * @@ -428,7 +117,7 @@ public class Server implements * @return The call builder */ public GetAvailableClientsRequestBuilder getAvailableClients() { - return new GetAvailableClientsRequestBuilder(this); + return new GetAvailableClientsRequestBuilder(sdkConfiguration); } /** @@ -440,153 +129,11 @@ public class Server implements * @throws Exception if the API call fails */ public GetAvailableClientsResponse getAvailableClientsDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/clients"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAvailableClients", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAvailableClients", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAvailableClients", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getAvailableClients", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetAvailableClientsResponse.Builder _resBuilder = - GetAvailableClientsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetAvailableClientsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetAvailableClientsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetAvailableClientsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetAvailableClientsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetAvailableClients.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Devices * @@ -595,7 +142,7 @@ public class Server implements * @return The call builder */ public GetDevicesRequestBuilder getDevices() { - return new GetDevicesRequestBuilder(this); + return new GetDevicesRequestBuilder(sdkConfiguration); } /** @@ -607,153 +154,11 @@ public class Server implements * @throws Exception if the API call fails */ public GetDevicesResponse getDevicesDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/devices"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getDevices", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getDevices", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getDevices", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getDevices", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetDevicesResponse.Builder _resBuilder = - GetDevicesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetDevicesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDevicesResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDevicesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetDevicesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetDevices.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Server Identity * @@ -762,7 +167,7 @@ public class Server implements * @return The call builder */ public GetServerIdentityRequestBuilder getServerIdentity() { - return new GetServerIdentityRequestBuilder(this); + return new GetServerIdentityRequestBuilder(sdkConfiguration); } /** @@ -774,134 +179,11 @@ public class Server implements * @throws Exception if the API call fails */ public GetServerIdentityResponse getServerIdentityDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/identity"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - Optional _hookSecuritySource = Optional.empty(); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-server-identity", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "408", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-server-identity", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-server-identity", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-server-identity", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetServerIdentityResponse.Builder _resBuilder = - GetServerIdentityResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetServerIdentityResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerIdentityResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "408")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerIdentityRequestTimeout _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetServerIdentity.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get MyPlex Account * @@ -910,7 +192,7 @@ public class Server implements * @return The call builder */ public GetMyPlexAccountRequestBuilder getMyPlexAccount() { - return new GetMyPlexAccountRequestBuilder(this); + return new GetMyPlexAccountRequestBuilder(sdkConfiguration); } /** @@ -922,153 +204,11 @@ public class Server implements * @throws Exception if the API call fails */ public GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/myplex/account"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getMyPlexAccount", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getMyPlexAccount", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getMyPlexAccount", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getMyPlexAccount", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetMyPlexAccountResponse.Builder _resBuilder = - GetMyPlexAccountResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetMyPlexAccountResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMyPlexAccountResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMyPlexAccountBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMyPlexAccountUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetMyPlexAccount.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get a Resized Photo * @@ -1077,7 +217,7 @@ public class Server implements * @return The call builder */ public GetResizedPhotoRequestBuilder getResizedPhoto() { - return new GetResizedPhotoRequestBuilder(this); + return new GetResizedPhotoRequestBuilder(sdkConfiguration); } /** @@ -1085,153 +225,16 @@ public class Server implements * *

Plex's Photo transcoder is used throughout the service to serve images at specified sizes. * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetResizedPhotoResponse getResizedPhoto( - GetResizedPhotoRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/photo/:/transcode"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetResizedPhotoRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getResizedPhoto", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getResizedPhoto", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getResizedPhoto", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getResizedPhoto", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetResizedPhotoResponse.Builder _resBuilder = - GetResizedPhotoResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetResizedPhotoResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetResizedPhotoBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetResizedPhotoUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetResizedPhotoResponse getResizedPhoto(GetResizedPhotoRequest request) throws Exception { + RequestOperation operation + = new GetResizedPhoto.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Media Providers * @@ -1240,7 +243,7 @@ public class Server implements * @return The call builder */ public GetMediaProvidersRequestBuilder getMediaProviders() { - return new GetMediaProvidersRequestBuilder(this); + return new GetMediaProvidersRequestBuilder(sdkConfiguration); } /** @@ -1252,162 +255,17 @@ public class Server implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetMediaProvidersResponse getMediaProviders( - String xPlexToken) throws Exception { + public GetMediaProvidersResponse getMediaProviders(String xPlexToken) throws Exception { GetMediaProvidersRequest request = GetMediaProvidersRequest .builder() .xPlexToken(xPlexToken) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/media/providers"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-providers", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-providers", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-providers", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-media-providers", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetMediaProvidersResponse.Builder _resBuilder = - GetMediaProvidersResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetMediaProvidersResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMediaProvidersResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMediaProvidersBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetMediaProvidersUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetMediaProviders.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Server List * @@ -1416,7 +274,7 @@ public class Server implements * @return The call builder */ public GetServerListRequestBuilder getServerList() { - return new GetServerListRequestBuilder(this); + return new GetServerListRequestBuilder(sdkConfiguration); } /** @@ -1428,149 +286,9 @@ public class Server implements * @throws Exception if the API call fails */ public GetServerListResponse getServerListDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/servers"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerList", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerList", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerList", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getServerList", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetServerListResponse.Builder _resBuilder = - GetServerListResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetServerListResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerListResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerListBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetServerListUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetServerList.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/Sessions.java b/src/main/java/dev/plexapi/sdk/Sessions.java index 9ad54a68..a536e30a 100644 --- a/src/main/java/dev/plexapi/sdk/Sessions.java +++ b/src/main/java/dev/plexapi/sdk/Sessions.java @@ -3,61 +3,49 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetSessionHistoryBadRequest; -import dev.plexapi.sdk.models.errors.GetSessionHistoryUnauthorized; -import dev.plexapi.sdk.models.errors.GetSessionsBadRequest; -import dev.plexapi.sdk.models.errors.GetSessionsUnauthorized; -import dev.plexapi.sdk.models.errors.GetTranscodeSessionsBadRequest; -import dev.plexapi.sdk.models.errors.GetTranscodeSessionsUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; -import dev.plexapi.sdk.models.errors.StopTranscodeSessionBadRequest; -import dev.plexapi.sdk.models.errors.StopTranscodeSessionUnauthorized; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetSessionHistoryRequest; import dev.plexapi.sdk.models.operations.GetSessionHistoryRequestBuilder; import dev.plexapi.sdk.models.operations.GetSessionHistoryResponse; -import dev.plexapi.sdk.models.operations.GetSessionHistoryResponseBody; import dev.plexapi.sdk.models.operations.GetSessionsRequestBuilder; import dev.plexapi.sdk.models.operations.GetSessionsResponse; -import dev.plexapi.sdk.models.operations.GetSessionsResponseBody; import dev.plexapi.sdk.models.operations.GetTranscodeSessionsRequestBuilder; import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponse; -import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponseBody; import dev.plexapi.sdk.models.operations.QueryParamFilter; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequest; import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequestBuilder; import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetSessionHistory; +import dev.plexapi.sdk.operations.GetSessions; +import dev.plexapi.sdk.operations.GetTranscodeSessions; +import dev.plexapi.sdk.operations.StopTranscodeSession; import java.lang.Exception; import java.lang.Long; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; import java.util.Optional; /** * API Calls that perform search operations with Plex Media Server Sessions */ -public class Sessions implements - MethodCallGetSessions, - MethodCallGetSessionHistory, - MethodCallGetTranscodeSessions, - MethodCallStopTranscodeSession { - +public class Sessions { private final SDKConfiguration sdkConfiguration; + private final AsyncSessions asyncSDK; Sessions(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncSessions(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncSessions async() { + return asyncSDK; + } /** * Get Active Sessions @@ -67,7 +55,7 @@ public class Sessions implements * @return The call builder */ public GetSessionsRequestBuilder getSessions() { - return new GetSessionsRequestBuilder(this); + return new GetSessionsRequestBuilder(sdkConfiguration); } /** @@ -79,153 +67,11 @@ public class Sessions implements * @throws Exception if the API call fails */ public GetSessionsResponse getSessionsDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/status/sessions"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSessions", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSessions", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSessions", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSessions", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetSessionsResponse.Builder _resBuilder = - GetSessionsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetSessionsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSessionsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSessionsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSessionsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetSessions.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Get Session History * @@ -234,7 +80,7 @@ public class Sessions implements * @return The call builder */ public GetSessionHistoryRequestBuilder getSessionHistory() { - return new GetSessionHistoryRequestBuilder(this); + return new GetSessionHistoryRequestBuilder(sdkConfiguration); } /** @@ -246,9 +92,10 @@ public class Sessions implements * @throws Exception if the API call fails */ public GetSessionHistoryResponse getSessionHistoryDirect() throws Exception { - return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + return getSessionHistory(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } - + /** * Get Session History * @@ -267,10 +114,8 @@ public class Sessions implements * @throws Exception if the API call fails */ public GetSessionHistoryResponse getSessionHistory( - Optional sort, - Optional accountId, - Optional filter, - Optional librarySectionID) throws Exception { + Optional sort, Optional accountId, + Optional filter, Optional librarySectionID) throws Exception { GetSessionHistoryRequest request = GetSessionHistoryRequest .builder() @@ -279,159 +124,11 @@ public class Sessions implements .filter(filter) .librarySectionID(librarySectionID) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/status/sessions/history/all"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetSessionHistoryRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSessionHistory", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSessionHistory", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSessionHistory", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getSessionHistory", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetSessionHistoryResponse.Builder _resBuilder = - GetSessionHistoryResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetSessionHistoryResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSessionHistoryResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSessionHistoryBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetSessionHistoryUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetSessionHistory.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Transcode Sessions * @@ -440,7 +137,7 @@ public class Sessions implements * @return The call builder */ public GetTranscodeSessionsRequestBuilder getTranscodeSessions() { - return new GetTranscodeSessionsRequestBuilder(this); + return new GetTranscodeSessionsRequestBuilder(sdkConfiguration); } /** @@ -452,153 +149,11 @@ public class Sessions implements * @throws Exception if the API call fails */ public GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/transcode/sessions"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTranscodeSessions", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTranscodeSessions", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTranscodeSessions", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTranscodeSessions", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetTranscodeSessionsResponse.Builder _resBuilder = - GetTranscodeSessionsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetTranscodeSessionsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTranscodeSessionsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTranscodeSessionsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTranscodeSessionsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetTranscodeSessions.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Stop a Transcode Session * @@ -607,7 +162,7 @@ public class Sessions implements * @return The call builder */ public StopTranscodeSessionRequestBuilder stopTranscodeSession() { - return new StopTranscodeSessionRequestBuilder(this); + return new StopTranscodeSessionRequestBuilder(sdkConfiguration); } /** @@ -619,148 +174,15 @@ public class Sessions implements * @return The response from the API call * @throws Exception if the API call fails */ - public StopTranscodeSessionResponse stopTranscodeSession( - String sessionKey) throws Exception { + public StopTranscodeSessionResponse stopTranscodeSession(String sessionKey) throws Exception { StopTranscodeSessionRequest request = StopTranscodeSessionRequest .builder() .sessionKey(sessionKey) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - StopTranscodeSessionRequest.class, - _baseUrl, - "/transcode/sessions/{sessionKey}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "DELETE"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopTranscodeSession", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopTranscodeSession", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopTranscodeSession", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "stopTranscodeSession", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - StopTranscodeSessionResponse.Builder _resBuilder = - StopTranscodeSessionResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - StopTranscodeSessionResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "204")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StopTranscodeSessionBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StopTranscodeSessionUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new StopTranscodeSession.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Statistics.java b/src/main/java/dev/plexapi/sdk/Statistics.java index 2fb23e8d..521b1d8c 100644 --- a/src/main/java/dev/plexapi/sdk/Statistics.java +++ b/src/main/java/dev/plexapi/sdk/Statistics.java @@ -3,56 +3,44 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetBandwidthStatisticsBadRequest; -import dev.plexapi.sdk.models.errors.GetBandwidthStatisticsUnauthorized; -import dev.plexapi.sdk.models.errors.GetResourcesStatisticsBadRequest; -import dev.plexapi.sdk.models.errors.GetResourcesStatisticsUnauthorized; -import dev.plexapi.sdk.models.errors.GetStatisticsBadRequest; -import dev.plexapi.sdk.models.errors.GetStatisticsUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsRequest; import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsRequestBuilder; import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponse; -import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponseBody; import dev.plexapi.sdk.models.operations.GetResourcesStatisticsRequest; import dev.plexapi.sdk.models.operations.GetResourcesStatisticsRequestBuilder; import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponse; -import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponseBody; import dev.plexapi.sdk.models.operations.GetStatisticsRequest; import dev.plexapi.sdk.models.operations.GetStatisticsRequestBuilder; import dev.plexapi.sdk.models.operations.GetStatisticsResponse; -import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetBandwidthStatistics; +import dev.plexapi.sdk.operations.GetResourcesStatistics; +import dev.plexapi.sdk.operations.GetStatistics; import java.lang.Exception; import java.lang.Long; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; import java.util.Optional; /** * API Calls that perform operations with Plex Media Server Statistics */ -public class Statistics implements - MethodCallGetStatistics, - MethodCallGetResourcesStatistics, - MethodCallGetBandwidthStatistics { - +public class Statistics { private final SDKConfiguration sdkConfiguration; + private final AsyncStatistics asyncSDK; Statistics(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncStatistics(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncStatistics async() { + return asyncSDK; + } /** * Get Media Statistics @@ -62,7 +50,7 @@ public class Statistics implements * @return The call builder */ public GetStatisticsRequestBuilder getStatistics() { - return new GetStatisticsRequestBuilder(this); + return new GetStatisticsRequestBuilder(sdkConfiguration); } /** @@ -76,7 +64,7 @@ public class Statistics implements public GetStatisticsResponse getStatisticsDirect() throws Exception { return getStatistics(Optional.empty()); } - + /** * Get Media Statistics * @@ -88,166 +76,17 @@ public class Statistics implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetStatisticsResponse getStatistics( - Optional timespan) throws Exception { + public GetStatisticsResponse getStatistics(Optional timespan) throws Exception { GetStatisticsRequest request = GetStatisticsRequest .builder() .timespan(timespan) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/statistics/media"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetStatisticsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getStatistics", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getStatistics", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getStatistics", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getStatistics", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetStatisticsResponse.Builder _resBuilder = - GetStatisticsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetStatisticsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetStatisticsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetStatisticsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetStatisticsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetStatistics.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Resources Statistics * @@ -256,7 +95,7 @@ public class Statistics implements * @return The call builder */ public GetResourcesStatisticsRequestBuilder getResourcesStatistics() { - return new GetResourcesStatisticsRequestBuilder(this); + return new GetResourcesStatisticsRequestBuilder(sdkConfiguration); } /** @@ -270,7 +109,7 @@ public class Statistics implements public GetResourcesStatisticsResponse getResourcesStatisticsDirect() throws Exception { return getResourcesStatistics(Optional.empty()); } - + /** * Get Resources Statistics * @@ -282,166 +121,17 @@ public class Statistics implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetResourcesStatisticsResponse getResourcesStatistics( - Optional timespan) throws Exception { + public GetResourcesStatisticsResponse getResourcesStatistics(Optional timespan) throws Exception { GetResourcesStatisticsRequest request = GetResourcesStatisticsRequest .builder() .timespan(timespan) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/statistics/resources"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetResourcesStatisticsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getResourcesStatistics", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getResourcesStatistics", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getResourcesStatistics", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getResourcesStatistics", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetResourcesStatisticsResponse.Builder _resBuilder = - GetResourcesStatisticsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetResourcesStatisticsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetResourcesStatisticsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetResourcesStatisticsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetResourcesStatisticsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetResourcesStatistics.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Get Bandwidth Statistics * @@ -450,7 +140,7 @@ public class Statistics implements * @return The call builder */ public GetBandwidthStatisticsRequestBuilder getBandwidthStatistics() { - return new GetBandwidthStatisticsRequestBuilder(this); + return new GetBandwidthStatisticsRequestBuilder(sdkConfiguration); } /** @@ -464,7 +154,7 @@ public class Statistics implements public GetBandwidthStatisticsResponse getBandwidthStatisticsDirect() throws Exception { return getBandwidthStatistics(Optional.empty()); } - + /** * Get Bandwidth Statistics * @@ -476,162 +166,15 @@ public class Statistics implements * @return The response from the API call * @throws Exception if the API call fails */ - public GetBandwidthStatisticsResponse getBandwidthStatistics( - Optional timespan) throws Exception { + public GetBandwidthStatisticsResponse getBandwidthStatistics(Optional timespan) throws Exception { GetBandwidthStatisticsRequest request = GetBandwidthStatisticsRequest .builder() .timespan(timespan) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/statistics/bandwidth"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetBandwidthStatisticsRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getBandwidthStatistics", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getBandwidthStatistics", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getBandwidthStatistics", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getBandwidthStatistics", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetBandwidthStatisticsResponse.Builder _resBuilder = - GetBandwidthStatisticsResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetBandwidthStatisticsResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetBandwidthStatisticsResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetBandwidthStatisticsBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetBandwidthStatisticsUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new GetBandwidthStatistics.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Updater.java b/src/main/java/dev/plexapi/sdk/Updater.java index 64acf8d6..4f7c6b0c 100644 --- a/src/main/java/dev/plexapi/sdk/Updater.java +++ b/src/main/java/dev/plexapi/sdk/Updater.java @@ -3,14 +3,9 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.ApplyUpdatesBadRequest; -import dev.plexapi.sdk.models.errors.ApplyUpdatesUnauthorized; -import dev.plexapi.sdk.models.errors.CheckForUpdatesBadRequest; -import dev.plexapi.sdk.models.errors.CheckForUpdatesUnauthorized; -import dev.plexapi.sdk.models.errors.GetUpdateStatusBadRequest; -import dev.plexapi.sdk.models.errors.GetUpdateStatusUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.ApplyUpdatesRequest; import dev.plexapi.sdk.models.operations.ApplyUpdatesRequestBuilder; import dev.plexapi.sdk.models.operations.ApplyUpdatesResponse; @@ -20,39 +15,35 @@ import dev.plexapi.sdk.models.operations.CheckForUpdatesResponse; import dev.plexapi.sdk.models.operations.Download; import dev.plexapi.sdk.models.operations.GetUpdateStatusRequestBuilder; import dev.plexapi.sdk.models.operations.GetUpdateStatusResponse; -import dev.plexapi.sdk.models.operations.GetUpdateStatusResponseBody; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.Skip; import dev.plexapi.sdk.models.operations.Tonight; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.ApplyUpdates; +import dev.plexapi.sdk.operations.CheckForUpdates; +import dev.plexapi.sdk.operations.GetUpdateStatus; import java.lang.Exception; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; import java.util.Optional; /** * This describes the API for searching and applying updates to the Plex Media Server. * Updates to the status can be observed via the Event API. */ -public class Updater implements - MethodCallGetUpdateStatus, - MethodCallCheckForUpdates, - MethodCallApplyUpdates { - +public class Updater { private final SDKConfiguration sdkConfiguration; + private final AsyncUpdater asyncSDK; Updater(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncUpdater(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncUpdater async() { + return asyncSDK; + } /** * Querying status of updates @@ -62,7 +53,7 @@ public class Updater implements * @return The call builder */ public GetUpdateStatusRequestBuilder getUpdateStatus() { - return new GetUpdateStatusRequestBuilder(this); + return new GetUpdateStatusRequestBuilder(sdkConfiguration); } /** @@ -74,153 +65,11 @@ public class Updater implements * @throws Exception if the API call fails */ public GetUpdateStatusResponse getUpdateStatusDirect() throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/updater/status"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getUpdateStatus", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getUpdateStatus", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getUpdateStatus", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getUpdateStatus", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetUpdateStatusResponse.Builder _resBuilder = - GetUpdateStatusResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetUpdateStatusResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetUpdateStatusResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetUpdateStatusBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetUpdateStatusUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestlessOperation operation + = new GetUpdateStatus.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest()); } - - /** * Checking for updates * @@ -229,7 +78,7 @@ public class Updater implements * @return The call builder */ public CheckForUpdatesRequestBuilder checkForUpdates() { - return new CheckForUpdatesRequestBuilder(this); + return new CheckForUpdatesRequestBuilder(sdkConfiguration); } /** @@ -243,7 +92,7 @@ public class Updater implements public CheckForUpdatesResponse checkForUpdatesDirect() throws Exception { return checkForUpdates(Optional.empty()); } - + /** * Checking for updates * @@ -253,155 +102,17 @@ public class Updater implements * @return The response from the API call * @throws Exception if the API call fails */ - public CheckForUpdatesResponse checkForUpdates( - Optional download) throws Exception { + public CheckForUpdatesResponse checkForUpdates(Optional download) throws Exception { CheckForUpdatesRequest request = CheckForUpdatesRequest .builder() .download(download) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/updater/check"); - - HTTPRequest _req = new HTTPRequest(_url, "PUT"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - CheckForUpdatesRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "checkForUpdates", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "checkForUpdates", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "checkForUpdates", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "checkForUpdates", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - CheckForUpdatesResponse.Builder _resBuilder = - CheckForUpdatesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - CheckForUpdatesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CheckForUpdatesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - CheckForUpdatesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new CheckForUpdates.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Apply Updates * @@ -410,7 +121,7 @@ public class Updater implements * @return The call builder */ public ApplyUpdatesRequestBuilder applyUpdates() { - return new ApplyUpdatesRequestBuilder(this); + return new ApplyUpdatesRequestBuilder(sdkConfiguration); } /** @@ -424,7 +135,7 @@ public class Updater implements public ApplyUpdatesResponse applyUpdatesDirect() throws Exception { return applyUpdates(Optional.empty(), Optional.empty()); } - + /** * Apply Updates * @@ -435,153 +146,16 @@ public class Updater implements * @return The response from the API call * @throws Exception if the API call fails */ - public ApplyUpdatesResponse applyUpdates( - Optional tonight, - Optional skip) throws Exception { + public ApplyUpdatesResponse applyUpdates(Optional tonight, Optional skip) throws Exception { ApplyUpdatesRequest request = ApplyUpdatesRequest .builder() .tonight(tonight) .skip(skip) .build(); - - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/updater/apply"); - - HTTPRequest _req = new HTTPRequest(_url, "PUT"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - ApplyUpdatesRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "applyUpdates", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "500", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "applyUpdates", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "applyUpdates", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "applyUpdates", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - ApplyUpdatesResponse.Builder _resBuilder = - ApplyUpdatesResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - ApplyUpdatesResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ApplyUpdatesBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - ApplyUpdatesUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "500", "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + RequestOperation operation + = new ApplyUpdates.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Users.java b/src/main/java/dev/plexapi/sdk/Users.java index 9dc67066..c307aa47 100644 --- a/src/main/java/dev/plexapi/sdk/Users.java +++ b/src/main/java/dev/plexapi/sdk/Users.java @@ -3,45 +3,34 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetUsersBadRequest; -import dev.plexapi.sdk.models.errors.GetUsersUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetUsersRequest; import dev.plexapi.sdk.models.operations.GetUsersRequestBuilder; import dev.plexapi.sdk.models.operations.GetUsersResponse; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetUsers; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.HashMap; -import java.util.List; import java.util.Optional; -public class Users implements - MethodCallGetUsers { - - /** - * GET_USERS_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_USERS_SERVERS = { - "https://plex.tv/api", - }; +public class Users { private final SDKConfiguration sdkConfiguration; + private final AsyncUsers asyncSDK; Users(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncUsers(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncUsers async() { + return asyncSDK; + } /** * Get list of all connected users @@ -51,7 +40,7 @@ public class Users implements * @return The call builder */ public GetUsersRequestBuilder getUsers() { - return new GetUsersRequestBuilder(this); + return new GetUsersRequestBuilder(sdkConfiguration); } /** @@ -59,169 +48,28 @@ public class Users implements * *

Get list of all users that are friends and have library access with the provided Plex authentication token * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetUsersResponse getUsers( - GetUsersRequest request) throws Exception { + public GetUsersResponse getUsers(GetUsersRequest request) throws Exception { return getUsers(request, Optional.empty()); } - + /** * Get list of all connected users * *

Get list of all users that are friends and have library access with the provided Plex authentication token * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all 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 GetUsersResponse getUsers( - GetUsersRequest request, - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_USERS_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - _baseUrl, - "/users"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/xml") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - Optional _hookSecuritySource = Optional.empty(); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-users", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-users", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-users", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-users", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetUsersResponse.Builder _resBuilder = - GetUsersResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetUsersResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/xml")) { - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetUsersBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetUsersUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetUsersResponse getUsers(GetUsersRequest request, Optional serverURL) throws Exception { + RequestOperation operation + = new GetUsers.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Video.java b/src/main/java/dev/plexapi/sdk/Video.java index 4a87e945..ebc1f0ea 100644 --- a/src/main/java/dev/plexapi/sdk/Video.java +++ b/src/main/java/dev/plexapi/sdk/Video.java @@ -3,46 +3,38 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetTimelineBadRequest; -import dev.plexapi.sdk.models.errors.GetTimelineUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; -import dev.plexapi.sdk.models.errors.StartUniversalTranscodeBadRequest; -import dev.plexapi.sdk.models.errors.StartUniversalTranscodeUnauthorized; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetTimelineRequest; import dev.plexapi.sdk.models.operations.GetTimelineRequestBuilder; import dev.plexapi.sdk.models.operations.GetTimelineResponse; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest; import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequestBuilder; import dev.plexapi.sdk.models.operations.StartUniversalTranscodeResponse; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetTimeline; +import dev.plexapi.sdk.operations.StartUniversalTranscode; import java.lang.Exception; -import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.List; -import java.util.Optional; /** * API Calls that perform operations with Plex Media Server Videos */ -public class Video implements - MethodCallGetTimeline, - MethodCallStartUniversalTranscode { - +public class Video { private final SDKConfiguration sdkConfiguration; + private final AsyncVideo asyncSDK; Video(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncVideo(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncVideo async() { + return asyncSDK; + } /** * Get the timeline for a media item @@ -52,7 +44,7 @@ public class Video implements * @return The call builder */ public GetTimelineRequestBuilder getTimeline() { - return new GetTimelineRequestBuilder(this); + return new GetTimelineRequestBuilder(sdkConfiguration); } /** @@ -60,153 +52,16 @@ public class Video implements * *

Get the timeline for a media item * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetTimelineResponse getTimeline( - GetTimelineRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/:/timeline"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetTimelineRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTimeline", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTimeline", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTimeline", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "getTimeline", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetTimelineResponse.Builder _resBuilder = - GetTimelineResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetTimelineResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTimelineBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetTimelineUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetTimelineResponse getTimeline(GetTimelineRequest request) throws Exception { + RequestOperation operation + = new GetTimeline.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } - - /** * Start Universal Transcode * @@ -215,7 +70,7 @@ public class Video implements * @return The call builder */ public StartUniversalTranscodeRequestBuilder startUniversalTranscode() { - return new StartUniversalTranscodeRequestBuilder(this); + return new StartUniversalTranscodeRequestBuilder(sdkConfiguration); } /** @@ -223,149 +78,14 @@ public class Video implements * *

Begin a Universal Transcode Session * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public StartUniversalTranscodeResponse startUniversalTranscode( - StartUniversalTranscodeRequest request) throws Exception { - String _baseUrl = Utils.templateUrl( - this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); - String _url = Utils.generateURL( - _baseUrl, - "/video/:/transcode/universal/start.mpd"); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - StartUniversalTranscodeRequest.class, - request, - null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "startUniversalTranscode", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "startUniversalTranscode", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "startUniversalTranscode", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "startUniversalTranscode", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - StartUniversalTranscodeResponse.Builder _resBuilder = - StartUniversalTranscodeResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - StartUniversalTranscodeResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - // no content - return _res; - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StartUniversalTranscodeBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - StartUniversalTranscodeUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public StartUniversalTranscodeResponse startUniversalTranscode(StartUniversalTranscodeRequest request) throws Exception { + RequestOperation operation + = new StartUniversalTranscode.Sync(sdkConfiguration); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/Watchlist.java b/src/main/java/dev/plexapi/sdk/Watchlist.java index 5321eb00..267ae6f8 100644 --- a/src/main/java/dev/plexapi/sdk/Watchlist.java +++ b/src/main/java/dev/plexapi/sdk/Watchlist.java @@ -3,52 +3,36 @@ */ package dev.plexapi.sdk; -import com.fasterxml.jackson.core.type.TypeReference; -import dev.plexapi.sdk.models.errors.GetWatchListBadRequest; -import dev.plexapi.sdk.models.errors.GetWatchListUnauthorized; -import dev.plexapi.sdk.models.errors.SDKError; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import dev.plexapi.sdk.models.operations.GetWatchListRequest; import dev.plexapi.sdk.models.operations.GetWatchListRequestBuilder; import dev.plexapi.sdk.models.operations.GetWatchListResponse; -import dev.plexapi.sdk.models.operations.GetWatchListResponseBody; -import dev.plexapi.sdk.models.operations.SDKMethodInterfaces.*; -import dev.plexapi.sdk.utils.HTTPClient; -import dev.plexapi.sdk.utils.HTTPRequest; -import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; -import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; -import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; -import dev.plexapi.sdk.utils.Utils; -import java.io.InputStream; +import dev.plexapi.sdk.operations.GetWatchList; import java.lang.Exception; import java.lang.String; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse; -import java.util.HashMap; -import java.util.List; import java.util.Optional; /** * API Calls that perform operations with Plex Media Server Watchlists */ -public class Watchlist implements - MethodCallGetWatchList { - - /** - * GET_WATCH_LIST_SERVERS contains the list of server urls available to the SDK. - */ - public static final String[] GET_WATCH_LIST_SERVERS = { - /** - * The plex metadata provider server - */ - "https://metadata.provider.plex.tv", - }; - +public class Watchlist { private final SDKConfiguration sdkConfiguration; + private final AsyncWatchlist asyncSDK; Watchlist(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncWatchlist(this, sdkConfiguration); } + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncWatchlist async() { + return asyncSDK; + } /** * Get User Watchlist @@ -58,7 +42,7 @@ public class Watchlist implements * @return The call builder */ public GetWatchListRequestBuilder getWatchList() { - return new GetWatchListRequestBuilder(this); + return new GetWatchListRequestBuilder(sdkConfiguration); } /** @@ -66,183 +50,28 @@ public class Watchlist implements * *

Get User Watchlist * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws Exception if the API call fails */ - public GetWatchListResponse getWatchList( - GetWatchListRequest request) throws Exception { + public GetWatchListResponse getWatchList(GetWatchListRequest request) throws Exception { return getWatchList(request, Optional.empty()); } - + /** * Get User Watchlist * *

Get User Watchlist * - * @param request The request object containing all of the parameters for the API call. + * @param request The request object containing all 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 GetWatchListResponse getWatchList( - GetWatchListRequest request, - Optional serverURL) throws Exception { - final String _baseUrl; - if (serverURL.isPresent() && !serverURL.get().isBlank()) { - _baseUrl = serverURL.get(); - } else { - _baseUrl = Utils.templateUrl(GET_WATCH_LIST_SERVERS[0], new HashMap()); - } - String _url = Utils.generateURL( - GetWatchListRequest.class, - _baseUrl, - "/library/sections/watchlist/{filter}", - request, null); - - HTTPRequest _req = new HTTPRequest(_url, "GET"); - _req.addHeader("Accept", "application/json") - .addHeader("user-agent", - SDKConfiguration.USER_AGENT); - - _req.addQueryParams(Utils.getQueryParams( - GetWatchListRequest.class, - request, - null)); - _req.addHeaders(Utils.getHeadersFromMetadata(request, null)); - - Optional _hookSecuritySource = Optional.of(this.sdkConfiguration.securitySource()); - Utils.configureSecurity(_req, - this.sdkConfiguration.securitySource().getSecurity()); - HTTPClient _client = this.sdkConfiguration.client(); - HttpRequest _r = - sdkConfiguration.hooks() - .beforeRequest( - new BeforeRequestContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-watch-list", - Optional.of(List.of()), - _hookSecuritySource), - _req.build()); - HttpResponse _httpRes; - try { - _httpRes = _client.send(_r); - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400", "401", "4XX", "5XX")) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-watch-list", - Optional.of(List.of()), - _hookSecuritySource), - Optional.of(_httpRes), - Optional.empty()); - } else { - _httpRes = sdkConfiguration.hooks() - .afterSuccess( - new AfterSuccessContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-watch-list", - Optional.of(List.of()), - _hookSecuritySource), - _httpRes); - } - } catch (Exception _e) { - _httpRes = sdkConfiguration.hooks() - .afterError( - new AfterErrorContextImpl( - this.sdkConfiguration, - _baseUrl, - "get-watch-list", - Optional.of(List.of()), - _hookSecuritySource), - Optional.empty(), - Optional.of(_e)); - } - String _contentType = _httpRes - .headers() - .firstValue("Content-Type") - .orElse("application/octet-stream"); - GetWatchListResponse.Builder _resBuilder = - GetWatchListResponse - .builder() - .contentType(_contentType) - .statusCode(_httpRes.statusCode()) - .rawResponse(_httpRes); - - GetWatchListResponse _res = _resBuilder.build(); - - if (Utils.statusCodeMatches(_httpRes.statusCode(), "200")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetWatchListResponseBody _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _res.withObject(Optional.ofNullable(_out)); - return _res; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "400")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetWatchListBadRequest _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "401")) { - if (Utils.contentTypeMatches(_contentType, "application/json")) { - GetWatchListUnauthorized _out = Utils.mapper().readValue( - Utils.toUtf8AndClose(_httpRes.body()), - new TypeReference() {}); - _out.withRawResponse(Optional.ofNullable(_httpRes)); - - throw _out; - } else { - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected content-type received: " + _contentType, - Utils.extractByteArrayFromBody(_httpRes)); - } - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "4XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - if (Utils.statusCodeMatches(_httpRes.statusCode(), "5XX")) { - // no content - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "API error occurred", - Utils.extractByteArrayFromBody(_httpRes)); - } - throw new SDKError( - _httpRes, - _httpRes.statusCode(), - "Unexpected status code received: " + _httpRes.statusCode(), - Utils.extractByteArrayFromBody(_httpRes)); + public GetWatchListResponse getWatchList(GetWatchListRequest request, Optional serverURL) throws Exception { + RequestOperation operation + = new GetWatchList.Sync(sdkConfiguration, serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/hooks/SDKHooks.java b/src/main/java/dev/plexapi/sdk/hooks/SDKHooks.java index 90f2175e..51917605 100644 --- a/src/main/java/dev/plexapi/sdk/hooks/SDKHooks.java +++ b/src/main/java/dev/plexapi/sdk/hooks/SDKHooks.java @@ -1,11 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - package dev.plexapi.sdk.hooks; // -// This file is written once by speakeasy code generation and +// This file is written once by speakeasy code generation and // thereafter will not be overwritten by speakeasy updates. As a // consequence any customization of this class will be preserved. // @@ -16,11 +12,31 @@ public final class SDKHooks { // prevent instantiation } - public static final void initialize(dev.plexapi.sdk.utils.Hooks hooks) { - // register hooks here - + public static void initialize(dev.plexapi.sdk.utils.Hooks hooks) { + // register synchronous hooks here + // hooks.registerBeforeRequest(...); + // hooks.registerAfterSuccess(...); + // hooks.registerAfterError(...); + // for more information see // https://www.speakeasy.com/docs/additional-features/sdk-hooks } - + + public static void initialize(dev.plexapi.sdk.utils.AsyncHooks asyncHooks) { + // register async hooks here + // asyncHooks.registerBeforeRequest(...); + // asyncHooks.registerAfterSuccess(...); + // asyncHooks.registerAfterError(...); + + // NOTE: If you have existing synchronous hooks, you can adapt them using HookAdapters: + // asyncHooks.registerAfterError(dev.plexapi.sdk.utils.HookAdapters.adapt(mySyncHook)); + + // PERFORMANCE TIP: For better performance, implement async hooks directly using + // non-blocking I/O (NIO) APIs instead of adapting synchronous hooks, as adapters + // offload execution to the ForkJoinPool which can introduce overhead. + + // for more information see + // https://www.speakeasy.com/docs/additional-features/sdk-hooks + } + } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsBadRequest.java index a48774cd..e1952547 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { public AddPlaylistContentsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public AddPlaylistContentsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { return this; } + public AddPlaylistContentsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { } AddPlaylistContentsBadRequest other = (AddPlaylistContentsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class AddPlaylistContentsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public AddPlaylistContentsBadRequest build() { + return new AddPlaylistContentsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsErrors.java index a9651d67..a7197914 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsErrors.java @@ -12,19 +12,21 @@ 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 AddPlaylistContentsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class AddPlaylistContentsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public AddPlaylistContentsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class AddPlaylistContentsErrors { return this; } + public AddPlaylistContentsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class AddPlaylistContentsErrors { return this; } + public AddPlaylistContentsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class AddPlaylistContentsErrors { return this; } + public AddPlaylistContentsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class AddPlaylistContentsErrors { } AddPlaylistContentsErrors other = (AddPlaylistContentsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class AddPlaylistContentsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class AddPlaylistContentsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class AddPlaylistContentsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class AddPlaylistContentsErrors { this.status = status; return this; } - + public AddPlaylistContentsErrors build() { + return new AddPlaylistContentsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsPlaylistsErrors.java index 89bb3246..ea88f896 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 AddPlaylistContentsPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class AddPlaylistContentsPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public AddPlaylistContentsPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class AddPlaylistContentsPlaylistsErrors { return this; } + public AddPlaylistContentsPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class AddPlaylistContentsPlaylistsErrors { return this; } + public AddPlaylistContentsPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class AddPlaylistContentsPlaylistsErrors { return this; } + public AddPlaylistContentsPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class AddPlaylistContentsPlaylistsErrors { } AddPlaylistContentsPlaylistsErrors other = (AddPlaylistContentsPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class AddPlaylistContentsPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class AddPlaylistContentsPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class AddPlaylistContentsPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class AddPlaylistContentsPlaylistsErrors { this.status = status; return this; } - + public AddPlaylistContentsPlaylistsErrors build() { + return new AddPlaylistContentsPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsUnauthorized.java index beb51fee..7332e436 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/AddPlaylistContentsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { public AddPlaylistContentsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public AddPlaylistContentsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { return this; } + public AddPlaylistContentsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { } AddPlaylistContentsUnauthorized other = (AddPlaylistContentsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class AddPlaylistContentsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public AddPlaylistContentsUnauthorized build() { + return new AddPlaylistContentsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesBadRequest.java index 2ecf84c7..60585026 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class ApplyUpdatesBadRequest extends RuntimeException { public ApplyUpdatesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class ApplyUpdatesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ApplyUpdatesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class ApplyUpdatesBadRequest extends RuntimeException { return this; } + public ApplyUpdatesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class ApplyUpdatesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class ApplyUpdatesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class ApplyUpdatesBadRequest extends RuntimeException { } ApplyUpdatesBadRequest other = (ApplyUpdatesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class ApplyUpdatesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class ApplyUpdatesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class ApplyUpdatesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public ApplyUpdatesBadRequest build() { + return new ApplyUpdatesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesErrors.java index cd5f004b..2e324b32 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesErrors.java @@ -12,19 +12,21 @@ 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 ApplyUpdatesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class ApplyUpdatesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ApplyUpdatesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class ApplyUpdatesErrors { return this; } + public ApplyUpdatesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class ApplyUpdatesErrors { return this; } + public ApplyUpdatesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class ApplyUpdatesErrors { return this; } + public ApplyUpdatesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class ApplyUpdatesErrors { } ApplyUpdatesErrors other = (ApplyUpdatesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class ApplyUpdatesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class ApplyUpdatesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class ApplyUpdatesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class ApplyUpdatesErrors { this.status = status; return this; } - + public ApplyUpdatesErrors build() { + return new ApplyUpdatesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesUnauthorized.java index 0047b40f..9b8584d4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { public ApplyUpdatesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ApplyUpdatesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { return this; } + public ApplyUpdatesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { } ApplyUpdatesUnauthorized other = (ApplyUpdatesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class ApplyUpdatesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public ApplyUpdatesUnauthorized build() { + return new ApplyUpdatesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesUpdaterErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesUpdaterErrors.java index 15c32b40..0ab7d992 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesUpdaterErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/ApplyUpdatesUpdaterErrors.java @@ -12,19 +12,21 @@ 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 ApplyUpdatesUpdaterErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class ApplyUpdatesUpdaterErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ApplyUpdatesUpdaterErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class ApplyUpdatesUpdaterErrors { return this; } + public ApplyUpdatesUpdaterErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class ApplyUpdatesUpdaterErrors { return this; } + public ApplyUpdatesUpdaterErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class ApplyUpdatesUpdaterErrors { return this; } + public ApplyUpdatesUpdaterErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class ApplyUpdatesUpdaterErrors { } ApplyUpdatesUpdaterErrors other = (ApplyUpdatesUpdaterErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class ApplyUpdatesUpdaterErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class ApplyUpdatesUpdaterErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class ApplyUpdatesUpdaterErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class ApplyUpdatesUpdaterErrors { this.status = status; return this; } - + public ApplyUpdatesUpdaterErrors build() { + return new ApplyUpdatesUpdaterErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesActivitiesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesActivitiesErrors.java index e8ff8a73..36767f3d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesActivitiesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesActivitiesErrors.java @@ -12,19 +12,21 @@ 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 CancelServerActivitiesActivitiesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class CancelServerActivitiesActivitiesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CancelServerActivitiesActivitiesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class CancelServerActivitiesActivitiesErrors { return this; } + public CancelServerActivitiesActivitiesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class CancelServerActivitiesActivitiesErrors { return this; } + public CancelServerActivitiesActivitiesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class CancelServerActivitiesActivitiesErrors { return this; } + public CancelServerActivitiesActivitiesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class CancelServerActivitiesActivitiesErrors { } CancelServerActivitiesActivitiesErrors other = (CancelServerActivitiesActivitiesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class CancelServerActivitiesActivitiesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class CancelServerActivitiesActivitiesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class CancelServerActivitiesActivitiesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class CancelServerActivitiesActivitiesErrors { this.status = status; return this; } - + public CancelServerActivitiesActivitiesErrors build() { + return new CancelServerActivitiesActivitiesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesBadRequest.java index f5f5f0f1..93840642 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { public CancelServerActivitiesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CancelServerActivitiesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { return this; } + public CancelServerActivitiesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { } CancelServerActivitiesBadRequest other = (CancelServerActivitiesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class CancelServerActivitiesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public CancelServerActivitiesBadRequest build() { + return new CancelServerActivitiesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesErrors.java index 21f4520d..1488b30f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesErrors.java @@ -12,19 +12,21 @@ 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 CancelServerActivitiesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class CancelServerActivitiesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CancelServerActivitiesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class CancelServerActivitiesErrors { return this; } + public CancelServerActivitiesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class CancelServerActivitiesErrors { return this; } + public CancelServerActivitiesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class CancelServerActivitiesErrors { return this; } + public CancelServerActivitiesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class CancelServerActivitiesErrors { } CancelServerActivitiesErrors other = (CancelServerActivitiesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class CancelServerActivitiesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class CancelServerActivitiesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class CancelServerActivitiesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class CancelServerActivitiesErrors { this.status = status; return this; } - + public CancelServerActivitiesErrors build() { + return new CancelServerActivitiesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesUnauthorized.java index b4f41e55..a2e94573 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CancelServerActivitiesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { public CancelServerActivitiesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CancelServerActivitiesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { return this; } + public CancelServerActivitiesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { } CancelServerActivitiesUnauthorized other = (CancelServerActivitiesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class CancelServerActivitiesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public CancelServerActivitiesUnauthorized build() { + return new CancelServerActivitiesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesBadRequest.java index 669deb00..c29b63eb 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class CheckForUpdatesBadRequest extends RuntimeException { public CheckForUpdatesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class CheckForUpdatesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CheckForUpdatesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class CheckForUpdatesBadRequest extends RuntimeException { return this; } + public CheckForUpdatesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class CheckForUpdatesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class CheckForUpdatesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class CheckForUpdatesBadRequest extends RuntimeException { } CheckForUpdatesBadRequest other = (CheckForUpdatesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class CheckForUpdatesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class CheckForUpdatesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class CheckForUpdatesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public CheckForUpdatesBadRequest build() { + return new CheckForUpdatesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesErrors.java index ea6803a1..c94ddc75 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesErrors.java @@ -12,19 +12,21 @@ 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 CheckForUpdatesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class CheckForUpdatesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CheckForUpdatesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class CheckForUpdatesErrors { return this; } + public CheckForUpdatesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class CheckForUpdatesErrors { return this; } + public CheckForUpdatesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class CheckForUpdatesErrors { return this; } + public CheckForUpdatesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class CheckForUpdatesErrors { } CheckForUpdatesErrors other = (CheckForUpdatesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class CheckForUpdatesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class CheckForUpdatesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class CheckForUpdatesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class CheckForUpdatesErrors { this.status = status; return this; } - + public CheckForUpdatesErrors build() { + return new CheckForUpdatesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesUnauthorized.java index 13be8a90..a7d8cd3b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { public CheckForUpdatesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CheckForUpdatesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { return this; } + public CheckForUpdatesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { } CheckForUpdatesUnauthorized other = (CheckForUpdatesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class CheckForUpdatesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public CheckForUpdatesUnauthorized build() { + return new CheckForUpdatesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesUpdaterErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesUpdaterErrors.java index 00d87206..57008969 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesUpdaterErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CheckForUpdatesUpdaterErrors.java @@ -12,19 +12,21 @@ 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 CheckForUpdatesUpdaterErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class CheckForUpdatesUpdaterErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CheckForUpdatesUpdaterErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class CheckForUpdatesUpdaterErrors { return this; } + public CheckForUpdatesUpdaterErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class CheckForUpdatesUpdaterErrors { return this; } + public CheckForUpdatesUpdaterErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class CheckForUpdatesUpdaterErrors { return this; } + public CheckForUpdatesUpdaterErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class CheckForUpdatesUpdaterErrors { } CheckForUpdatesUpdaterErrors other = (CheckForUpdatesUpdaterErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class CheckForUpdatesUpdaterErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class CheckForUpdatesUpdaterErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class CheckForUpdatesUpdaterErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class CheckForUpdatesUpdaterErrors { this.status = status; return this; } - + public CheckForUpdatesUpdaterErrors build() { + return new CheckForUpdatesUpdaterErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsBadRequest.java index b7892e4a..7277f2be 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { public ClearPlaylistContentsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ClearPlaylistContentsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { return this; } + public ClearPlaylistContentsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { } ClearPlaylistContentsBadRequest other = (ClearPlaylistContentsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class ClearPlaylistContentsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public ClearPlaylistContentsBadRequest build() { + return new ClearPlaylistContentsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsErrors.java index 4f46bc65..d50ad808 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsErrors.java @@ -12,19 +12,21 @@ 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 ClearPlaylistContentsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class ClearPlaylistContentsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ClearPlaylistContentsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class ClearPlaylistContentsErrors { return this; } + public ClearPlaylistContentsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class ClearPlaylistContentsErrors { return this; } + public ClearPlaylistContentsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class ClearPlaylistContentsErrors { return this; } + public ClearPlaylistContentsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class ClearPlaylistContentsErrors { } ClearPlaylistContentsErrors other = (ClearPlaylistContentsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class ClearPlaylistContentsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class ClearPlaylistContentsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class ClearPlaylistContentsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class ClearPlaylistContentsErrors { this.status = status; return this; } - + public ClearPlaylistContentsErrors build() { + return new ClearPlaylistContentsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsPlaylistsErrors.java index a636502c..c1abdc94 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 ClearPlaylistContentsPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class ClearPlaylistContentsPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ClearPlaylistContentsPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class ClearPlaylistContentsPlaylistsErrors { return this; } + public ClearPlaylistContentsPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class ClearPlaylistContentsPlaylistsErrors { return this; } + public ClearPlaylistContentsPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class ClearPlaylistContentsPlaylistsErrors { return this; } + public ClearPlaylistContentsPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class ClearPlaylistContentsPlaylistsErrors { } ClearPlaylistContentsPlaylistsErrors other = (ClearPlaylistContentsPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class ClearPlaylistContentsPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class ClearPlaylistContentsPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class ClearPlaylistContentsPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class ClearPlaylistContentsPlaylistsErrors { this.status = status; return this; } - + public ClearPlaylistContentsPlaylistsErrors build() { + return new ClearPlaylistContentsPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsUnauthorized.java index e149ad12..423debe9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/ClearPlaylistContentsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { public ClearPlaylistContentsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ClearPlaylistContentsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { return this; } + public ClearPlaylistContentsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { } ClearPlaylistContentsUnauthorized other = (ClearPlaylistContentsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class ClearPlaylistContentsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public ClearPlaylistContentsUnauthorized build() { + return new ClearPlaylistContentsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistBadRequest.java index 9b596642..4f8a7c99 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class CreatePlaylistBadRequest extends RuntimeException { public CreatePlaylistBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class CreatePlaylistBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CreatePlaylistBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class CreatePlaylistBadRequest extends RuntimeException { return this; } + public CreatePlaylistBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class CreatePlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class CreatePlaylistBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class CreatePlaylistBadRequest extends RuntimeException { } CreatePlaylistBadRequest other = (CreatePlaylistBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class CreatePlaylistBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class CreatePlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class CreatePlaylistBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public CreatePlaylistBadRequest build() { + return new CreatePlaylistBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistErrors.java index eaa22b94..98dbebf1 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistErrors.java @@ -12,19 +12,21 @@ 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 CreatePlaylistErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class CreatePlaylistErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CreatePlaylistErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class CreatePlaylistErrors { return this; } + public CreatePlaylistErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class CreatePlaylistErrors { return this; } + public CreatePlaylistErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class CreatePlaylistErrors { return this; } + public CreatePlaylistErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class CreatePlaylistErrors { } CreatePlaylistErrors other = (CreatePlaylistErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class CreatePlaylistErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class CreatePlaylistErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class CreatePlaylistErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class CreatePlaylistErrors { this.status = status; return this; } - + public CreatePlaylistErrors build() { + return new CreatePlaylistErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistPlaylistsErrors.java index 3ad6eac3..30cecbab 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 CreatePlaylistPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class CreatePlaylistPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CreatePlaylistPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class CreatePlaylistPlaylistsErrors { return this; } + public CreatePlaylistPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class CreatePlaylistPlaylistsErrors { return this; } + public CreatePlaylistPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class CreatePlaylistPlaylistsErrors { return this; } + public CreatePlaylistPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class CreatePlaylistPlaylistsErrors { } CreatePlaylistPlaylistsErrors other = (CreatePlaylistPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class CreatePlaylistPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class CreatePlaylistPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class CreatePlaylistPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class CreatePlaylistPlaylistsErrors { this.status = status; return this; } - + public CreatePlaylistPlaylistsErrors build() { + return new CreatePlaylistPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistUnauthorized.java index c2993131..2b3500d0 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/CreatePlaylistUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class CreatePlaylistUnauthorized extends RuntimeException { public CreatePlaylistUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class CreatePlaylistUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CreatePlaylistUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class CreatePlaylistUnauthorized extends RuntimeException { return this; } + public CreatePlaylistUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class CreatePlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class CreatePlaylistUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class CreatePlaylistUnauthorized extends RuntimeException { } CreatePlaylistUnauthorized other = (CreatePlaylistUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class CreatePlaylistUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class CreatePlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class CreatePlaylistUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public CreatePlaylistUnauthorized build() { + return new CreatePlaylistUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryBadRequest.java index 9ba0112d..7b6761d9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class DeleteLibraryBadRequest extends RuntimeException { public DeleteLibraryBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class DeleteLibraryBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public DeleteLibraryBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class DeleteLibraryBadRequest extends RuntimeException { return this; } + public DeleteLibraryBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class DeleteLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class DeleteLibraryBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class DeleteLibraryBadRequest extends RuntimeException { } DeleteLibraryBadRequest other = (DeleteLibraryBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class DeleteLibraryBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class DeleteLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class DeleteLibraryBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public DeleteLibraryBadRequest build() { + return new DeleteLibraryBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryErrors.java index fdaf6a74..b24fce2e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryErrors.java @@ -12,19 +12,21 @@ 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 DeleteLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class DeleteLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public DeleteLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class DeleteLibraryErrors { return this; } + public DeleteLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class DeleteLibraryErrors { return this; } + public DeleteLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class DeleteLibraryErrors { return this; } + public DeleteLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class DeleteLibraryErrors { } DeleteLibraryErrors other = (DeleteLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class DeleteLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class DeleteLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class DeleteLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class DeleteLibraryErrors { this.status = status; return this; } - + public DeleteLibraryErrors build() { + return new DeleteLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryLibraryErrors.java index 1ed3d348..4f955b16 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryLibraryErrors.java @@ -12,19 +12,21 @@ 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 DeleteLibraryLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class DeleteLibraryLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public DeleteLibraryLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class DeleteLibraryLibraryErrors { return this; } + public DeleteLibraryLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class DeleteLibraryLibraryErrors { return this; } + public DeleteLibraryLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class DeleteLibraryLibraryErrors { return this; } + public DeleteLibraryLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class DeleteLibraryLibraryErrors { } DeleteLibraryLibraryErrors other = (DeleteLibraryLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class DeleteLibraryLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class DeleteLibraryLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class DeleteLibraryLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class DeleteLibraryLibraryErrors { this.status = status; return this; } - + public DeleteLibraryLibraryErrors build() { + return new DeleteLibraryLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryUnauthorized.java index d38f106b..798d97e4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/DeleteLibraryUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class DeleteLibraryUnauthorized extends RuntimeException { public DeleteLibraryUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class DeleteLibraryUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public DeleteLibraryUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class DeleteLibraryUnauthorized extends RuntimeException { return this; } + public DeleteLibraryUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class DeleteLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class DeleteLibraryUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class DeleteLibraryUnauthorized extends RuntimeException { } DeleteLibraryUnauthorized other = (DeleteLibraryUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class DeleteLibraryUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class DeleteLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class DeleteLibraryUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public DeleteLibraryUnauthorized build() { + return new DeleteLibraryUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistBadRequest.java index 474d8bab..2eeb94f4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class DeletePlaylistBadRequest extends RuntimeException { public DeletePlaylistBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class DeletePlaylistBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public DeletePlaylistBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class DeletePlaylistBadRequest extends RuntimeException { return this; } + public DeletePlaylistBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class DeletePlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class DeletePlaylistBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class DeletePlaylistBadRequest extends RuntimeException { } DeletePlaylistBadRequest other = (DeletePlaylistBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class DeletePlaylistBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class DeletePlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class DeletePlaylistBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public DeletePlaylistBadRequest build() { + return new DeletePlaylistBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistErrors.java index afe945e4..dae50a3a 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistErrors.java @@ -12,19 +12,21 @@ 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 DeletePlaylistErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class DeletePlaylistErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public DeletePlaylistErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class DeletePlaylistErrors { return this; } + public DeletePlaylistErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class DeletePlaylistErrors { return this; } + public DeletePlaylistErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class DeletePlaylistErrors { return this; } + public DeletePlaylistErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class DeletePlaylistErrors { } DeletePlaylistErrors other = (DeletePlaylistErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class DeletePlaylistErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class DeletePlaylistErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class DeletePlaylistErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class DeletePlaylistErrors { this.status = status; return this; } - + public DeletePlaylistErrors build() { + return new DeletePlaylistErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistPlaylistsErrors.java index b96ff87a..5e67df77 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 DeletePlaylistPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class DeletePlaylistPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public DeletePlaylistPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class DeletePlaylistPlaylistsErrors { return this; } + public DeletePlaylistPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class DeletePlaylistPlaylistsErrors { return this; } + public DeletePlaylistPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class DeletePlaylistPlaylistsErrors { return this; } + public DeletePlaylistPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class DeletePlaylistPlaylistsErrors { } DeletePlaylistPlaylistsErrors other = (DeletePlaylistPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class DeletePlaylistPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class DeletePlaylistPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class DeletePlaylistPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class DeletePlaylistPlaylistsErrors { this.status = status; return this; } - + public DeletePlaylistPlaylistsErrors build() { + return new DeletePlaylistPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistUnauthorized.java index 4d099624..f2185eef 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/DeletePlaylistUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class DeletePlaylistUnauthorized extends RuntimeException { public DeletePlaylistUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class DeletePlaylistUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public DeletePlaylistUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class DeletePlaylistUnauthorized extends RuntimeException { return this; } + public DeletePlaylistUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class DeletePlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class DeletePlaylistUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class DeletePlaylistUnauthorized extends RuntimeException { } DeletePlaylistUnauthorized other = (DeletePlaylistUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class DeletePlaylistUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class DeletePlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class DeletePlaylistUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public DeletePlaylistUnauthorized build() { + return new DeletePlaylistUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailBadRequest.java index 17d05982..44acc000 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class EnablePaperTrailBadRequest extends RuntimeException { public EnablePaperTrailBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class EnablePaperTrailBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public EnablePaperTrailBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class EnablePaperTrailBadRequest extends RuntimeException { return this; } + public EnablePaperTrailBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class EnablePaperTrailBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class EnablePaperTrailBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class EnablePaperTrailBadRequest extends RuntimeException { } EnablePaperTrailBadRequest other = (EnablePaperTrailBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class EnablePaperTrailBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class EnablePaperTrailBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class EnablePaperTrailBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public EnablePaperTrailBadRequest build() { + return new EnablePaperTrailBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailErrors.java index a1e1ccad..e17cadf9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailErrors.java @@ -12,19 +12,21 @@ 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 EnablePaperTrailErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class EnablePaperTrailErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public EnablePaperTrailErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class EnablePaperTrailErrors { return this; } + public EnablePaperTrailErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class EnablePaperTrailErrors { return this; } + public EnablePaperTrailErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class EnablePaperTrailErrors { return this; } + public EnablePaperTrailErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class EnablePaperTrailErrors { } EnablePaperTrailErrors other = (EnablePaperTrailErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class EnablePaperTrailErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class EnablePaperTrailErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class EnablePaperTrailErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class EnablePaperTrailErrors { this.status = status; return this; } - + public EnablePaperTrailErrors build() { + return new EnablePaperTrailErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailLogErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailLogErrors.java index 63281e87..687383f4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailLogErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailLogErrors.java @@ -12,19 +12,21 @@ 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 EnablePaperTrailLogErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class EnablePaperTrailLogErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public EnablePaperTrailLogErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class EnablePaperTrailLogErrors { return this; } + public EnablePaperTrailLogErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class EnablePaperTrailLogErrors { return this; } + public EnablePaperTrailLogErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class EnablePaperTrailLogErrors { return this; } + public EnablePaperTrailLogErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class EnablePaperTrailLogErrors { } EnablePaperTrailLogErrors other = (EnablePaperTrailLogErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class EnablePaperTrailLogErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class EnablePaperTrailLogErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class EnablePaperTrailLogErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class EnablePaperTrailLogErrors { this.status = status; return this; } - + public EnablePaperTrailLogErrors build() { + return new EnablePaperTrailLogErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailUnauthorized.java index 188c37b7..2e12fc70 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/EnablePaperTrailUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { public EnablePaperTrailUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public EnablePaperTrailUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { return this; } + public EnablePaperTrailUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { } EnablePaperTrailUnauthorized other = (EnablePaperTrailUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class EnablePaperTrailUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public EnablePaperTrailUnauthorized build() { + return new EnablePaperTrailUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/Errors.java b/src/main/java/dev/plexapi/sdk/models/errors/Errors.java index 8a4c72fe..b29dd1e6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/Errors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/Errors.java @@ -12,19 +12,21 @@ 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 Errors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class Errors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Errors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class Errors { return this; } + public Errors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class Errors { return this; } + public Errors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class Errors { return this; } + public Errors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class Errors { } Errors other = (Errors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class Errors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class Errors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class Errors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class Errors { this.status = status; return this; } - + public Errors build() { + return new Errors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryBadRequest.java index 1e896859..99110603 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetActorsLibraryBadRequest extends RuntimeException { public GetActorsLibraryBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetActorsLibraryBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetActorsLibraryBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetActorsLibraryBadRequest extends RuntimeException { return this; } + public GetActorsLibraryBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetActorsLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetActorsLibraryBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetActorsLibraryBadRequest extends RuntimeException { } GetActorsLibraryBadRequest other = (GetActorsLibraryBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetActorsLibraryBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetActorsLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetActorsLibraryBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetActorsLibraryBadRequest build() { + return new GetActorsLibraryBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryErrors.java index 3eb3d965..cdb3bc19 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetActorsLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetActorsLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetActorsLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetActorsLibraryErrors { return this; } + public GetActorsLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetActorsLibraryErrors { return this; } + public GetActorsLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetActorsLibraryErrors { return this; } + public GetActorsLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetActorsLibraryErrors { } GetActorsLibraryErrors other = (GetActorsLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetActorsLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetActorsLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetActorsLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetActorsLibraryErrors { this.status = status; return this; } - + public GetActorsLibraryErrors build() { + return new GetActorsLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryLibraryErrors.java index 698435cb..70d6e20f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetActorsLibraryLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetActorsLibraryLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetActorsLibraryLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetActorsLibraryLibraryErrors { return this; } + public GetActorsLibraryLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetActorsLibraryLibraryErrors { return this; } + public GetActorsLibraryLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetActorsLibraryLibraryErrors { return this; } + public GetActorsLibraryLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetActorsLibraryLibraryErrors { } GetActorsLibraryLibraryErrors other = (GetActorsLibraryLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetActorsLibraryLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetActorsLibraryLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetActorsLibraryLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetActorsLibraryLibraryErrors { this.status = status; return this; } - + public GetActorsLibraryLibraryErrors build() { + return new GetActorsLibraryLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryUnauthorized.java index 2fee4ad9..e4e27a7f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetActorsLibraryUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { public GetActorsLibraryUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetActorsLibraryUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { return this; } + public GetActorsLibraryUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { } GetActorsLibraryUnauthorized other = (GetActorsLibraryUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetActorsLibraryUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetActorsLibraryUnauthorized build() { + return new GetActorsLibraryUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesBadRequest.java index 8f430556..3e4832b8 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetAllLibrariesBadRequest extends RuntimeException { public GetAllLibrariesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetAllLibrariesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetAllLibrariesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetAllLibrariesBadRequest extends RuntimeException { return this; } + public GetAllLibrariesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetAllLibrariesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetAllLibrariesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetAllLibrariesBadRequest extends RuntimeException { } GetAllLibrariesBadRequest other = (GetAllLibrariesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetAllLibrariesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetAllLibrariesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetAllLibrariesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetAllLibrariesBadRequest build() { + return new GetAllLibrariesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesErrors.java index bf6caad6..a012e902 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesErrors.java @@ -12,19 +12,21 @@ 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 GetAllLibrariesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetAllLibrariesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetAllLibrariesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetAllLibrariesErrors { return this; } + public GetAllLibrariesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetAllLibrariesErrors { return this; } + public GetAllLibrariesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetAllLibrariesErrors { return this; } + public GetAllLibrariesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetAllLibrariesErrors { } GetAllLibrariesErrors other = (GetAllLibrariesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetAllLibrariesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetAllLibrariesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetAllLibrariesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetAllLibrariesErrors { this.status = status; return this; } - + public GetAllLibrariesErrors build() { + return new GetAllLibrariesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesLibraryErrors.java index 3a6b4f31..892c76b9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetAllLibrariesLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetAllLibrariesLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetAllLibrariesLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetAllLibrariesLibraryErrors { return this; } + public GetAllLibrariesLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetAllLibrariesLibraryErrors { return this; } + public GetAllLibrariesLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetAllLibrariesLibraryErrors { return this; } + public GetAllLibrariesLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetAllLibrariesLibraryErrors { } GetAllLibrariesLibraryErrors other = (GetAllLibrariesLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetAllLibrariesLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetAllLibrariesLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetAllLibrariesLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetAllLibrariesLibraryErrors { this.status = status; return this; } - + public GetAllLibrariesLibraryErrors build() { + return new GetAllLibrariesLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesUnauthorized.java index 25ce2bf8..0669636c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetAllLibrariesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { public GetAllLibrariesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetAllLibrariesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { return this; } + public GetAllLibrariesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { } GetAllLibrariesUnauthorized other = (GetAllLibrariesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetAllLibrariesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetAllLibrariesUnauthorized build() { + return new GetAllLibrariesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsBadRequest.java index 5fe1ecde..9a4aff5b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetAvailableClientsBadRequest extends RuntimeException { public GetAvailableClientsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetAvailableClientsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetAvailableClientsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetAvailableClientsBadRequest extends RuntimeException { return this; } + public GetAvailableClientsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetAvailableClientsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetAvailableClientsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetAvailableClientsBadRequest extends RuntimeException { } GetAvailableClientsBadRequest other = (GetAvailableClientsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetAvailableClientsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetAvailableClientsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetAvailableClientsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetAvailableClientsBadRequest build() { + return new GetAvailableClientsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsErrors.java index 13b8e8d8..972f521b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsErrors.java @@ -12,19 +12,21 @@ 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 GetAvailableClientsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetAvailableClientsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetAvailableClientsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetAvailableClientsErrors { return this; } + public GetAvailableClientsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetAvailableClientsErrors { return this; } + public GetAvailableClientsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetAvailableClientsErrors { return this; } + public GetAvailableClientsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetAvailableClientsErrors { } GetAvailableClientsErrors other = (GetAvailableClientsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetAvailableClientsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetAvailableClientsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetAvailableClientsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetAvailableClientsErrors { this.status = status; return this; } - + public GetAvailableClientsErrors build() { + return new GetAvailableClientsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsServerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsServerErrors.java index c0de8906..a2bd023e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsServerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsServerErrors.java @@ -12,19 +12,21 @@ 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 GetAvailableClientsServerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetAvailableClientsServerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetAvailableClientsServerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetAvailableClientsServerErrors { return this; } + public GetAvailableClientsServerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetAvailableClientsServerErrors { return this; } + public GetAvailableClientsServerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetAvailableClientsServerErrors { return this; } + public GetAvailableClientsServerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetAvailableClientsServerErrors { } GetAvailableClientsServerErrors other = (GetAvailableClientsServerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetAvailableClientsServerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetAvailableClientsServerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetAvailableClientsServerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetAvailableClientsServerErrors { this.status = status; return this; } - + public GetAvailableClientsServerErrors build() { + return new GetAvailableClientsServerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsUnauthorized.java index 04af94b8..8107956c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetAvailableClientsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { public GetAvailableClientsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetAvailableClientsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { return this; } + public GetAvailableClientsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { } GetAvailableClientsUnauthorized other = (GetAvailableClientsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetAvailableClientsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetAvailableClientsUnauthorized build() { + return new GetAvailableClientsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsBadRequest.java index eb33c792..98a80ba0 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { public GetBandwidthStatisticsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetBandwidthStatisticsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { return this; } + public GetBandwidthStatisticsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { } GetBandwidthStatisticsBadRequest other = (GetBandwidthStatisticsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetBandwidthStatisticsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetBandwidthStatisticsBadRequest build() { + return new GetBandwidthStatisticsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsErrors.java index 10c50bf8..cf0e1a21 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsErrors.java @@ -12,19 +12,21 @@ 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 GetBandwidthStatisticsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetBandwidthStatisticsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetBandwidthStatisticsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetBandwidthStatisticsErrors { return this; } + public GetBandwidthStatisticsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetBandwidthStatisticsErrors { return this; } + public GetBandwidthStatisticsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetBandwidthStatisticsErrors { return this; } + public GetBandwidthStatisticsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetBandwidthStatisticsErrors { } GetBandwidthStatisticsErrors other = (GetBandwidthStatisticsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetBandwidthStatisticsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetBandwidthStatisticsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetBandwidthStatisticsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetBandwidthStatisticsErrors { this.status = status; return this; } - + public GetBandwidthStatisticsErrors build() { + return new GetBandwidthStatisticsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsStatisticsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsStatisticsErrors.java index 1d7d94a2..b6103c9d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsStatisticsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsStatisticsErrors.java @@ -12,19 +12,21 @@ 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 GetBandwidthStatisticsStatisticsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetBandwidthStatisticsStatisticsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetBandwidthStatisticsStatisticsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetBandwidthStatisticsStatisticsErrors { return this; } + public GetBandwidthStatisticsStatisticsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetBandwidthStatisticsStatisticsErrors { return this; } + public GetBandwidthStatisticsStatisticsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetBandwidthStatisticsStatisticsErrors { return this; } + public GetBandwidthStatisticsStatisticsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetBandwidthStatisticsStatisticsErrors { } GetBandwidthStatisticsStatisticsErrors other = (GetBandwidthStatisticsStatisticsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetBandwidthStatisticsStatisticsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetBandwidthStatisticsStatisticsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetBandwidthStatisticsStatisticsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetBandwidthStatisticsStatisticsErrors { this.status = status; return this; } - + public GetBandwidthStatisticsStatisticsErrors build() { + return new GetBandwidthStatisticsStatisticsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsUnauthorized.java index 62704ecf..dd9944a0 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetBandwidthStatisticsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { public GetBandwidthStatisticsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetBandwidthStatisticsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { return this; } + public GetBandwidthStatisticsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { } GetBandwidthStatisticsUnauthorized other = (GetBandwidthStatisticsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetBandwidthStatisticsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetBandwidthStatisticsUnauthorized build() { + return new GetBandwidthStatisticsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageBadRequest.java index f22ae009..8ac925cf 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetBannerImageBadRequest extends RuntimeException { public GetBannerImageBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetBannerImageBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetBannerImageBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetBannerImageBadRequest extends RuntimeException { return this; } + public GetBannerImageBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetBannerImageBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetBannerImageBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetBannerImageBadRequest extends RuntimeException { } GetBannerImageBadRequest other = (GetBannerImageBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetBannerImageBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetBannerImageBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetBannerImageBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetBannerImageBadRequest build() { + return new GetBannerImageBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageErrors.java index 476d3b3d..a37e99fa 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageErrors.java @@ -12,19 +12,21 @@ 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 GetBannerImageErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetBannerImageErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetBannerImageErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetBannerImageErrors { return this; } + public GetBannerImageErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetBannerImageErrors { return this; } + public GetBannerImageErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetBannerImageErrors { return this; } + public GetBannerImageErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetBannerImageErrors { } GetBannerImageErrors other = (GetBannerImageErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetBannerImageErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetBannerImageErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetBannerImageErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetBannerImageErrors { this.status = status; return this; } - + public GetBannerImageErrors build() { + return new GetBannerImageErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageMediaErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageMediaErrors.java index 9f4ca25e..554e42db 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageMediaErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageMediaErrors.java @@ -12,19 +12,21 @@ 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 GetBannerImageMediaErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetBannerImageMediaErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetBannerImageMediaErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetBannerImageMediaErrors { return this; } + public GetBannerImageMediaErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetBannerImageMediaErrors { return this; } + public GetBannerImageMediaErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetBannerImageMediaErrors { return this; } + public GetBannerImageMediaErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetBannerImageMediaErrors { } GetBannerImageMediaErrors other = (GetBannerImageMediaErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetBannerImageMediaErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetBannerImageMediaErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetBannerImageMediaErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetBannerImageMediaErrors { this.status = status; return this; } - + public GetBannerImageMediaErrors build() { + return new GetBannerImageMediaErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageUnauthorized.java index 8a0c760f..a77bacbb 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetBannerImageUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetBannerImageUnauthorized extends RuntimeException { public GetBannerImageUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetBannerImageUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetBannerImageUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetBannerImageUnauthorized extends RuntimeException { return this; } + public GetBannerImageUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetBannerImageUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetBannerImageUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetBannerImageUnauthorized extends RuntimeException { } GetBannerImageUnauthorized other = (GetBannerImageUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetBannerImageUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetBannerImageUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetBannerImageUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetBannerImageUnauthorized build() { + return new GetBannerImageUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksBadRequest.java index c9e333de..d5221f8b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetButlerTasksBadRequest extends RuntimeException { public GetButlerTasksBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetButlerTasksBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetButlerTasksBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetButlerTasksBadRequest extends RuntimeException { return this; } + public GetButlerTasksBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetButlerTasksBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetButlerTasksBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetButlerTasksBadRequest extends RuntimeException { } GetButlerTasksBadRequest other = (GetButlerTasksBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetButlerTasksBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetButlerTasksBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetButlerTasksBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetButlerTasksBadRequest build() { + return new GetButlerTasksBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksButlerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksButlerErrors.java index f54d5a66..7dd7af78 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksButlerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksButlerErrors.java @@ -12,19 +12,21 @@ 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 GetButlerTasksButlerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetButlerTasksButlerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetButlerTasksButlerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetButlerTasksButlerErrors { return this; } + public GetButlerTasksButlerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetButlerTasksButlerErrors { return this; } + public GetButlerTasksButlerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetButlerTasksButlerErrors { return this; } + public GetButlerTasksButlerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetButlerTasksButlerErrors { } GetButlerTasksButlerErrors other = (GetButlerTasksButlerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetButlerTasksButlerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetButlerTasksButlerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetButlerTasksButlerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetButlerTasksButlerErrors { this.status = status; return this; } - + public GetButlerTasksButlerErrors build() { + return new GetButlerTasksButlerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksErrors.java index 7441fe98..2fcb9d2d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksErrors.java @@ -12,19 +12,21 @@ 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 GetButlerTasksErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetButlerTasksErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetButlerTasksErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetButlerTasksErrors { return this; } + public GetButlerTasksErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetButlerTasksErrors { return this; } + public GetButlerTasksErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetButlerTasksErrors { return this; } + public GetButlerTasksErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetButlerTasksErrors { } GetButlerTasksErrors other = (GetButlerTasksErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetButlerTasksErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetButlerTasksErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetButlerTasksErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetButlerTasksErrors { this.status = status; return this; } - + public GetButlerTasksErrors build() { + return new GetButlerTasksErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksUnauthorized.java index 7bce7a41..654f4ea3 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetButlerTasksUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetButlerTasksUnauthorized extends RuntimeException { public GetButlerTasksUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetButlerTasksUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetButlerTasksUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetButlerTasksUnauthorized extends RuntimeException { return this; } + public GetButlerTasksUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetButlerTasksUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetButlerTasksUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetButlerTasksUnauthorized extends RuntimeException { } GetButlerTasksUnauthorized other = (GetButlerTasksUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetButlerTasksUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetButlerTasksUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetButlerTasksUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetButlerTasksUnauthorized build() { + return new GetButlerTasksUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataBadRequest.java index abf69e18..107ee7de 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetCompanionsDataBadRequest extends RuntimeException { public GetCompanionsDataBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetCompanionsDataBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetCompanionsDataBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetCompanionsDataBadRequest extends RuntimeException { return this; } + public GetCompanionsDataBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetCompanionsDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetCompanionsDataBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetCompanionsDataBadRequest extends RuntimeException { } GetCompanionsDataBadRequest other = (GetCompanionsDataBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetCompanionsDataBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetCompanionsDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetCompanionsDataBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetCompanionsDataBadRequest build() { + return new GetCompanionsDataBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataErrors.java index 3f80242e..dca6ceb2 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataErrors.java @@ -12,19 +12,21 @@ 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 GetCompanionsDataErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetCompanionsDataErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetCompanionsDataErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetCompanionsDataErrors { return this; } + public GetCompanionsDataErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetCompanionsDataErrors { return this; } + public GetCompanionsDataErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetCompanionsDataErrors { return this; } + public GetCompanionsDataErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetCompanionsDataErrors { } GetCompanionsDataErrors other = (GetCompanionsDataErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetCompanionsDataErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetCompanionsDataErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetCompanionsDataErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetCompanionsDataErrors { this.status = status; return this; } - + public GetCompanionsDataErrors build() { + return new GetCompanionsDataErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataPlexErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataPlexErrors.java index 6142d326..60e31290 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataPlexErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataPlexErrors.java @@ -12,19 +12,21 @@ 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 GetCompanionsDataPlexErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetCompanionsDataPlexErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetCompanionsDataPlexErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetCompanionsDataPlexErrors { return this; } + public GetCompanionsDataPlexErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetCompanionsDataPlexErrors { return this; } + public GetCompanionsDataPlexErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetCompanionsDataPlexErrors { return this; } + public GetCompanionsDataPlexErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetCompanionsDataPlexErrors { } GetCompanionsDataPlexErrors other = (GetCompanionsDataPlexErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetCompanionsDataPlexErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetCompanionsDataPlexErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetCompanionsDataPlexErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetCompanionsDataPlexErrors { this.status = status; return this; } - + public GetCompanionsDataPlexErrors build() { + return new GetCompanionsDataPlexErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataUnauthorized.java index 34710dfe..1afd04ba 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetCompanionsDataUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { public GetCompanionsDataUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetCompanionsDataUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { return this; } + public GetCompanionsDataUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { } GetCompanionsDataUnauthorized other = (GetCompanionsDataUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetCompanionsDataUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetCompanionsDataUnauthorized build() { + return new GetCompanionsDataUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryBadRequest.java index 588c77ae..f78062d9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { public GetCountriesLibraryBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetCountriesLibraryBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { return this; } + public GetCountriesLibraryBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { } GetCountriesLibraryBadRequest other = (GetCountriesLibraryBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetCountriesLibraryBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetCountriesLibraryBadRequest build() { + return new GetCountriesLibraryBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryErrors.java index 14e3b507..4736952a 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetCountriesLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetCountriesLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetCountriesLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetCountriesLibraryErrors { return this; } + public GetCountriesLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetCountriesLibraryErrors { return this; } + public GetCountriesLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetCountriesLibraryErrors { return this; } + public GetCountriesLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetCountriesLibraryErrors { } GetCountriesLibraryErrors other = (GetCountriesLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetCountriesLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetCountriesLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetCountriesLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetCountriesLibraryErrors { this.status = status; return this; } - + public GetCountriesLibraryErrors build() { + return new GetCountriesLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryLibraryErrors.java index 6e736610..97fde4de 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetCountriesLibraryLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetCountriesLibraryLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetCountriesLibraryLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetCountriesLibraryLibraryErrors { return this; } + public GetCountriesLibraryLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetCountriesLibraryLibraryErrors { return this; } + public GetCountriesLibraryLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetCountriesLibraryLibraryErrors { return this; } + public GetCountriesLibraryLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetCountriesLibraryLibraryErrors { } GetCountriesLibraryLibraryErrors other = (GetCountriesLibraryLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetCountriesLibraryLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetCountriesLibraryLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetCountriesLibraryLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetCountriesLibraryLibraryErrors { this.status = status; return this; } - + public GetCountriesLibraryLibraryErrors build() { + return new GetCountriesLibraryLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryUnauthorized.java index c151ddc7..13608436 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetCountriesLibraryUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { public GetCountriesLibraryUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetCountriesLibraryUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { return this; } + public GetCountriesLibraryUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { } GetCountriesLibraryUnauthorized other = (GetCountriesLibraryUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetCountriesLibraryUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetCountriesLibraryUnauthorized build() { + return new GetCountriesLibraryUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesBadRequest.java index 43268554..a9e2b4c0 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetDevicesBadRequest extends RuntimeException { public GetDevicesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetDevicesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetDevicesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetDevicesBadRequest extends RuntimeException { return this; } + public GetDevicesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetDevicesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetDevicesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetDevicesBadRequest extends RuntimeException { } GetDevicesBadRequest other = (GetDevicesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetDevicesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetDevicesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetDevicesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetDevicesBadRequest build() { + return new GetDevicesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesErrors.java index 3e561a14..0e0026f4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesErrors.java @@ -12,19 +12,21 @@ 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 GetDevicesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetDevicesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetDevicesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetDevicesErrors { return this; } + public GetDevicesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetDevicesErrors { return this; } + public GetDevicesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetDevicesErrors { return this; } + public GetDevicesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetDevicesErrors { } GetDevicesErrors other = (GetDevicesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetDevicesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetDevicesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetDevicesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetDevicesErrors { this.status = status; return this; } - + public GetDevicesErrors build() { + return new GetDevicesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesServerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesServerErrors.java index 7390a949..249007d7 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesServerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesServerErrors.java @@ -12,19 +12,21 @@ 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 GetDevicesServerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetDevicesServerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetDevicesServerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetDevicesServerErrors { return this; } + public GetDevicesServerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetDevicesServerErrors { return this; } + public GetDevicesServerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetDevicesServerErrors { return this; } + public GetDevicesServerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetDevicesServerErrors { } GetDevicesServerErrors other = (GetDevicesServerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetDevicesServerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetDevicesServerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetDevicesServerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetDevicesServerErrors { this.status = status; return this; } - + public GetDevicesServerErrors build() { + return new GetDevicesServerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesUnauthorized.java index 5f789180..4daa5800 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetDevicesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetDevicesUnauthorized extends RuntimeException { public GetDevicesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetDevicesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetDevicesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetDevicesUnauthorized extends RuntimeException { return this; } + public GetDevicesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetDevicesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetDevicesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetDevicesUnauthorized extends RuntimeException { } GetDevicesUnauthorized other = (GetDevicesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetDevicesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetDevicesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetDevicesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetDevicesUnauthorized build() { + return new GetDevicesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashBadRequest.java index 4c150b4b..95d71399 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetFileHashBadRequest extends RuntimeException { public GetFileHashBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetFileHashBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetFileHashBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetFileHashBadRequest extends RuntimeException { return this; } + public GetFileHashBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetFileHashBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetFileHashBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetFileHashBadRequest extends RuntimeException { } GetFileHashBadRequest other = (GetFileHashBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetFileHashBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetFileHashBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetFileHashBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetFileHashBadRequest build() { + return new GetFileHashBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashErrors.java index 47787a08..26a3b1eb 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashErrors.java @@ -12,19 +12,21 @@ 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 GetFileHashErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetFileHashErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetFileHashErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetFileHashErrors { return this; } + public GetFileHashErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetFileHashErrors { return this; } + public GetFileHashErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetFileHashErrors { return this; } + public GetFileHashErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetFileHashErrors { } GetFileHashErrors other = (GetFileHashErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetFileHashErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetFileHashErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetFileHashErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetFileHashErrors { this.status = status; return this; } - + public GetFileHashErrors build() { + return new GetFileHashErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashLibraryErrors.java index 317a384c..1f7c69a8 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetFileHashLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetFileHashLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetFileHashLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetFileHashLibraryErrors { return this; } + public GetFileHashLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetFileHashLibraryErrors { return this; } + public GetFileHashLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetFileHashLibraryErrors { return this; } + public GetFileHashLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetFileHashLibraryErrors { } GetFileHashLibraryErrors other = (GetFileHashLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetFileHashLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetFileHashLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetFileHashLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetFileHashLibraryErrors { this.status = status; return this; } - + public GetFileHashLibraryErrors build() { + return new GetFileHashLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashUnauthorized.java index 23cd42d4..c7bea188 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetFileHashUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetFileHashUnauthorized extends RuntimeException { public GetFileHashUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetFileHashUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetFileHashUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetFileHashUnauthorized extends RuntimeException { return this; } + public GetFileHashUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetFileHashUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetFileHashUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetFileHashUnauthorized extends RuntimeException { } GetFileHashUnauthorized other = (GetFileHashUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetFileHashUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetFileHashUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetFileHashUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetFileHashUnauthorized build() { + return new GetFileHashUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryBadRequest.java index 1e33e5f8..1188c5ed 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetGenresLibraryBadRequest extends RuntimeException { public GetGenresLibraryBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetGenresLibraryBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGenresLibraryBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetGenresLibraryBadRequest extends RuntimeException { return this; } + public GetGenresLibraryBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetGenresLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetGenresLibraryBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetGenresLibraryBadRequest extends RuntimeException { } GetGenresLibraryBadRequest other = (GetGenresLibraryBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetGenresLibraryBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetGenresLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetGenresLibraryBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetGenresLibraryBadRequest build() { + return new GetGenresLibraryBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryErrors.java index 604c35eb..6cf660c5 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetGenresLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetGenresLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGenresLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetGenresLibraryErrors { return this; } + public GetGenresLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetGenresLibraryErrors { return this; } + public GetGenresLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetGenresLibraryErrors { return this; } + public GetGenresLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetGenresLibraryErrors { } GetGenresLibraryErrors other = (GetGenresLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetGenresLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetGenresLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetGenresLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetGenresLibraryErrors { this.status = status; return this; } - + public GetGenresLibraryErrors build() { + return new GetGenresLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryLibraryErrors.java index b1e032a9..e2442825 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetGenresLibraryLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetGenresLibraryLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGenresLibraryLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetGenresLibraryLibraryErrors { return this; } + public GetGenresLibraryLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetGenresLibraryLibraryErrors { return this; } + public GetGenresLibraryLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetGenresLibraryLibraryErrors { return this; } + public GetGenresLibraryLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetGenresLibraryLibraryErrors { } GetGenresLibraryLibraryErrors other = (GetGenresLibraryLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetGenresLibraryLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetGenresLibraryLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetGenresLibraryLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetGenresLibraryLibraryErrors { this.status = status; return this; } - + public GetGenresLibraryLibraryErrors build() { + return new GetGenresLibraryLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryUnauthorized.java index acbb52f6..73642ab3 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGenresLibraryUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { public GetGenresLibraryUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGenresLibraryUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { return this; } + public GetGenresLibraryUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { } GetGenresLibraryUnauthorized other = (GetGenresLibraryUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetGenresLibraryUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetGenresLibraryUnauthorized build() { + return new GetGenresLibraryUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataBadRequest.java index c2e9f5a5..f72e7be3 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetGeoDataBadRequest extends RuntimeException { public GetGeoDataBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetGeoDataBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGeoDataBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetGeoDataBadRequest extends RuntimeException { return this; } + public GetGeoDataBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetGeoDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetGeoDataBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetGeoDataBadRequest extends RuntimeException { } GetGeoDataBadRequest other = (GetGeoDataBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetGeoDataBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetGeoDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetGeoDataBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetGeoDataBadRequest build() { + return new GetGeoDataBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataErrors.java index 6058e401..186fbdfb 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataErrors.java @@ -12,19 +12,21 @@ 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 GetGeoDataErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetGeoDataErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGeoDataErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetGeoDataErrors { return this; } + public GetGeoDataErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetGeoDataErrors { return this; } + public GetGeoDataErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetGeoDataErrors { return this; } + public GetGeoDataErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetGeoDataErrors { } GetGeoDataErrors other = (GetGeoDataErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetGeoDataErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetGeoDataErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetGeoDataErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetGeoDataErrors { this.status = status; return this; } - + public GetGeoDataErrors build() { + return new GetGeoDataErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataPlexErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataPlexErrors.java index 9458cf5a..163c8604 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataPlexErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataPlexErrors.java @@ -12,19 +12,21 @@ 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 GetGeoDataPlexErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetGeoDataPlexErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGeoDataPlexErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetGeoDataPlexErrors { return this; } + public GetGeoDataPlexErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetGeoDataPlexErrors { return this; } + public GetGeoDataPlexErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetGeoDataPlexErrors { return this; } + public GetGeoDataPlexErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetGeoDataPlexErrors { } GetGeoDataPlexErrors other = (GetGeoDataPlexErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetGeoDataPlexErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetGeoDataPlexErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetGeoDataPlexErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetGeoDataPlexErrors { this.status = status; return this; } - + public GetGeoDataPlexErrors build() { + return new GetGeoDataPlexErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataUnauthorized.java index d0a5d69e..3b9ca963 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGeoDataUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetGeoDataUnauthorized extends RuntimeException { public GetGeoDataUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetGeoDataUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGeoDataUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetGeoDataUnauthorized extends RuntimeException { return this; } + public GetGeoDataUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetGeoDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetGeoDataUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetGeoDataUnauthorized extends RuntimeException { } GetGeoDataUnauthorized other = (GetGeoDataUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetGeoDataUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetGeoDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetGeoDataUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetGeoDataUnauthorized build() { + return new GetGeoDataUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsBadRequest.java index f55f9b46..e8b65bb4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetGlobalHubsBadRequest extends RuntimeException { public GetGlobalHubsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetGlobalHubsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGlobalHubsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetGlobalHubsBadRequest extends RuntimeException { return this; } + public GetGlobalHubsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetGlobalHubsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetGlobalHubsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetGlobalHubsBadRequest extends RuntimeException { } GetGlobalHubsBadRequest other = (GetGlobalHubsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetGlobalHubsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetGlobalHubsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetGlobalHubsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetGlobalHubsBadRequest build() { + return new GetGlobalHubsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsErrors.java index b4adce97..9bd59975 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsErrors.java @@ -12,19 +12,21 @@ 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 GetGlobalHubsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetGlobalHubsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGlobalHubsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetGlobalHubsErrors { return this; } + public GetGlobalHubsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetGlobalHubsErrors { return this; } + public GetGlobalHubsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetGlobalHubsErrors { return this; } + public GetGlobalHubsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetGlobalHubsErrors { } GetGlobalHubsErrors other = (GetGlobalHubsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetGlobalHubsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetGlobalHubsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetGlobalHubsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetGlobalHubsErrors { this.status = status; return this; } - + public GetGlobalHubsErrors build() { + return new GetGlobalHubsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsHubsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsHubsErrors.java index 969a6ed1..1867b9a9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsHubsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsHubsErrors.java @@ -12,19 +12,21 @@ 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 GetGlobalHubsHubsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetGlobalHubsHubsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGlobalHubsHubsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetGlobalHubsHubsErrors { return this; } + public GetGlobalHubsHubsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetGlobalHubsHubsErrors { return this; } + public GetGlobalHubsHubsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetGlobalHubsHubsErrors { return this; } + public GetGlobalHubsHubsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetGlobalHubsHubsErrors { } GetGlobalHubsHubsErrors other = (GetGlobalHubsHubsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetGlobalHubsHubsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetGlobalHubsHubsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetGlobalHubsHubsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetGlobalHubsHubsErrors { this.status = status; return this; } - + public GetGlobalHubsHubsErrors build() { + return new GetGlobalHubsHubsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsUnauthorized.java index bf21ff52..001658c6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetGlobalHubsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { public GetGlobalHubsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGlobalHubsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { return this; } + public GetGlobalHubsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { } GetGlobalHubsUnauthorized other = (GetGlobalHubsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetGlobalHubsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetGlobalHubsUnauthorized build() { + return new GetGlobalHubsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataBadRequest.java index 17283cd9..3a1a9ada 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetHomeDataBadRequest extends RuntimeException { public GetHomeDataBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetHomeDataBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetHomeDataBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetHomeDataBadRequest extends RuntimeException { return this; } + public GetHomeDataBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetHomeDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetHomeDataBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetHomeDataBadRequest extends RuntimeException { } GetHomeDataBadRequest other = (GetHomeDataBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetHomeDataBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetHomeDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetHomeDataBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetHomeDataBadRequest build() { + return new GetHomeDataBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataErrors.java index 6aec492b..139db6c6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataErrors.java @@ -12,19 +12,21 @@ 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 GetHomeDataErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetHomeDataErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetHomeDataErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetHomeDataErrors { return this; } + public GetHomeDataErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetHomeDataErrors { return this; } + public GetHomeDataErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetHomeDataErrors { return this; } + public GetHomeDataErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetHomeDataErrors { } GetHomeDataErrors other = (GetHomeDataErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetHomeDataErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetHomeDataErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetHomeDataErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetHomeDataErrors { this.status = status; return this; } - + public GetHomeDataErrors build() { + return new GetHomeDataErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataPlexErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataPlexErrors.java index 6fd6c933..d71420a9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataPlexErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataPlexErrors.java @@ -12,19 +12,21 @@ 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 GetHomeDataPlexErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetHomeDataPlexErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetHomeDataPlexErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetHomeDataPlexErrors { return this; } + public GetHomeDataPlexErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetHomeDataPlexErrors { return this; } + public GetHomeDataPlexErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetHomeDataPlexErrors { return this; } + public GetHomeDataPlexErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetHomeDataPlexErrors { } GetHomeDataPlexErrors other = (GetHomeDataPlexErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetHomeDataPlexErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetHomeDataPlexErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetHomeDataPlexErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetHomeDataPlexErrors { this.status = status; return this; } - + public GetHomeDataPlexErrors build() { + return new GetHomeDataPlexErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataUnauthorized.java index f55d01db..b7398a93 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetHomeDataUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetHomeDataUnauthorized extends RuntimeException { public GetHomeDataUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetHomeDataUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetHomeDataUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetHomeDataUnauthorized extends RuntimeException { return this; } + public GetHomeDataUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetHomeDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetHomeDataUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetHomeDataUnauthorized extends RuntimeException { } GetHomeDataUnauthorized other = (GetHomeDataUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetHomeDataUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetHomeDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetHomeDataUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetHomeDataUnauthorized build() { + return new GetHomeDataUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsBadRequest.java index 6796b1b8..9c6d41cb 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { public GetLibraryDetailsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { return this; } + public GetLibraryDetailsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { } GetLibraryDetailsBadRequest other = (GetLibraryDetailsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetLibraryDetailsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetLibraryDetailsBadRequest build() { + return new GetLibraryDetailsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsErrors.java index ae468e8c..4d280522 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsErrors.java @@ -12,19 +12,21 @@ 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 GetLibraryDetailsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetLibraryDetailsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetLibraryDetailsErrors { return this; } + public GetLibraryDetailsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetLibraryDetailsErrors { return this; } + public GetLibraryDetailsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetLibraryDetailsErrors { return this; } + public GetLibraryDetailsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetLibraryDetailsErrors { } GetLibraryDetailsErrors other = (GetLibraryDetailsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetLibraryDetailsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetLibraryDetailsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetLibraryDetailsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetLibraryDetailsErrors { this.status = status; return this; } - + public GetLibraryDetailsErrors build() { + return new GetLibraryDetailsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsLibraryErrors.java index e8024969..ff3bf906 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetLibraryDetailsLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetLibraryDetailsLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetLibraryDetailsLibraryErrors { return this; } + public GetLibraryDetailsLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetLibraryDetailsLibraryErrors { return this; } + public GetLibraryDetailsLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetLibraryDetailsLibraryErrors { return this; } + public GetLibraryDetailsLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetLibraryDetailsLibraryErrors { } GetLibraryDetailsLibraryErrors other = (GetLibraryDetailsLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetLibraryDetailsLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetLibraryDetailsLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetLibraryDetailsLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetLibraryDetailsLibraryErrors { this.status = status; return this; } - + public GetLibraryDetailsLibraryErrors build() { + return new GetLibraryDetailsLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsUnauthorized.java index a27bd747..ab23b0f3 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryDetailsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { public GetLibraryDetailsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { return this; } + public GetLibraryDetailsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { } GetLibraryDetailsUnauthorized other = (GetLibraryDetailsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetLibraryDetailsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetLibraryDetailsUnauthorized build() { + return new GetLibraryDetailsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsBadRequest.java index d3dcbe43..e66640e5 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetLibraryHubsBadRequest extends RuntimeException { public GetLibraryHubsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetLibraryHubsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetLibraryHubsBadRequest extends RuntimeException { return this; } + public GetLibraryHubsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetLibraryHubsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetLibraryHubsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetLibraryHubsBadRequest extends RuntimeException { } GetLibraryHubsBadRequest other = (GetLibraryHubsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetLibraryHubsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetLibraryHubsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetLibraryHubsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetLibraryHubsBadRequest build() { + return new GetLibraryHubsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsErrors.java index fe1231c6..83758e9a 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsErrors.java @@ -12,19 +12,21 @@ 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 GetLibraryHubsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetLibraryHubsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetLibraryHubsErrors { return this; } + public GetLibraryHubsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetLibraryHubsErrors { return this; } + public GetLibraryHubsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetLibraryHubsErrors { return this; } + public GetLibraryHubsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetLibraryHubsErrors { } GetLibraryHubsErrors other = (GetLibraryHubsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetLibraryHubsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetLibraryHubsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetLibraryHubsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetLibraryHubsErrors { this.status = status; return this; } - + public GetLibraryHubsErrors build() { + return new GetLibraryHubsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsHubsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsHubsErrors.java index eeffc85a..92057dbd 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsHubsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsHubsErrors.java @@ -12,19 +12,21 @@ 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 GetLibraryHubsHubsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetLibraryHubsHubsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsHubsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetLibraryHubsHubsErrors { return this; } + public GetLibraryHubsHubsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetLibraryHubsHubsErrors { return this; } + public GetLibraryHubsHubsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetLibraryHubsHubsErrors { return this; } + public GetLibraryHubsHubsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetLibraryHubsHubsErrors { } GetLibraryHubsHubsErrors other = (GetLibraryHubsHubsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetLibraryHubsHubsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetLibraryHubsHubsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetLibraryHubsHubsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetLibraryHubsHubsErrors { this.status = status; return this; } - + public GetLibraryHubsHubsErrors build() { + return new GetLibraryHubsHubsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsUnauthorized.java index 98e556d3..de77455f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryHubsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { public GetLibraryHubsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { return this; } + public GetLibraryHubsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { } GetLibraryHubsUnauthorized other = (GetLibraryHubsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetLibraryHubsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetLibraryHubsUnauthorized build() { + return new GetLibraryHubsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsBadRequest.java index 674753fe..54d356f7 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetLibraryItemsBadRequest extends RuntimeException { public GetLibraryItemsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetLibraryItemsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetLibraryItemsBadRequest extends RuntimeException { return this; } + public GetLibraryItemsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetLibraryItemsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetLibraryItemsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetLibraryItemsBadRequest extends RuntimeException { } GetLibraryItemsBadRequest other = (GetLibraryItemsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetLibraryItemsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetLibraryItemsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetLibraryItemsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetLibraryItemsBadRequest build() { + return new GetLibraryItemsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsErrors.java index 01bef94a..beaad6fd 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsErrors.java @@ -12,19 +12,21 @@ 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 GetLibraryItemsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetLibraryItemsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetLibraryItemsErrors { return this; } + public GetLibraryItemsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetLibraryItemsErrors { return this; } + public GetLibraryItemsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetLibraryItemsErrors { return this; } + public GetLibraryItemsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetLibraryItemsErrors { } GetLibraryItemsErrors other = (GetLibraryItemsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetLibraryItemsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetLibraryItemsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetLibraryItemsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetLibraryItemsErrors { this.status = status; return this; } - + public GetLibraryItemsErrors build() { + return new GetLibraryItemsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsLibraryErrors.java index 5774f7d7..07e0659a 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetLibraryItemsLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetLibraryItemsLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetLibraryItemsLibraryErrors { return this; } + public GetLibraryItemsLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetLibraryItemsLibraryErrors { return this; } + public GetLibraryItemsLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetLibraryItemsLibraryErrors { return this; } + public GetLibraryItemsLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetLibraryItemsLibraryErrors { } GetLibraryItemsLibraryErrors other = (GetLibraryItemsLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetLibraryItemsLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetLibraryItemsLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetLibraryItemsLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetLibraryItemsLibraryErrors { this.status = status; return this; } - + public GetLibraryItemsLibraryErrors build() { + return new GetLibraryItemsLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsUnauthorized.java index b30c3410..292951d1 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibraryItemsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { public GetLibraryItemsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { return this; } + public GetLibraryItemsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { } GetLibraryItemsUnauthorized other = (GetLibraryItemsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetLibraryItemsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetLibraryItemsUnauthorized build() { + return new GetLibraryItemsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllBadRequest.java index f292cbfb..d518135e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { public GetLibrarySectionsAllBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { return this; } + public GetLibrarySectionsAllBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { } GetLibrarySectionsAllBadRequest other = (GetLibrarySectionsAllBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetLibrarySectionsAllBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetLibrarySectionsAllBadRequest build() { + return new GetLibrarySectionsAllBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllErrors.java index f18d37a3..f8200e4b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllErrors.java @@ -12,19 +12,21 @@ 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 GetLibrarySectionsAllErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetLibrarySectionsAllErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetLibrarySectionsAllErrors { return this; } + public GetLibrarySectionsAllErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetLibrarySectionsAllErrors { return this; } + public GetLibrarySectionsAllErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetLibrarySectionsAllErrors { return this; } + public GetLibrarySectionsAllErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetLibrarySectionsAllErrors { } GetLibrarySectionsAllErrors other = (GetLibrarySectionsAllErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetLibrarySectionsAllErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetLibrarySectionsAllErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetLibrarySectionsAllErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetLibrarySectionsAllErrors { this.status = status; return this; } - + public GetLibrarySectionsAllErrors build() { + return new GetLibrarySectionsAllErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllLibraryErrors.java index 1b786ebd..e7a346d2 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetLibrarySectionsAllLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetLibrarySectionsAllLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetLibrarySectionsAllLibraryErrors { return this; } + public GetLibrarySectionsAllLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetLibrarySectionsAllLibraryErrors { return this; } + public GetLibrarySectionsAllLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetLibrarySectionsAllLibraryErrors { return this; } + public GetLibrarySectionsAllLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetLibrarySectionsAllLibraryErrors { } GetLibrarySectionsAllLibraryErrors other = (GetLibrarySectionsAllLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetLibrarySectionsAllLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetLibrarySectionsAllLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetLibrarySectionsAllLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetLibrarySectionsAllLibraryErrors { this.status = status; return this; } - + public GetLibrarySectionsAllLibraryErrors build() { + return new GetLibrarySectionsAllLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllUnauthorized.java index 78cc129d..f8cddeb4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetLibrarySectionsAllUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { public GetLibrarySectionsAllUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { return this; } + public GetLibrarySectionsAllUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { } GetLibrarySectionsAllUnauthorized other = (GetLibrarySectionsAllUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetLibrarySectionsAllUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetLibrarySectionsAllUnauthorized build() { + return new GetLibrarySectionsAllUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataBadRequest.java index f2c71e9d..9c237f88 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { public GetMediaMetaDataBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { return this; } + public GetMediaMetaDataBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { } GetMediaMetaDataBadRequest other = (GetMediaMetaDataBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetMediaMetaDataBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetMediaMetaDataBadRequest build() { + return new GetMediaMetaDataBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataErrors.java index 5820be86..475af7a8 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataErrors.java @@ -12,19 +12,21 @@ 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 GetMediaMetaDataErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetMediaMetaDataErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetMediaMetaDataErrors { return this; } + public GetMediaMetaDataErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetMediaMetaDataErrors { return this; } + public GetMediaMetaDataErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetMediaMetaDataErrors { return this; } + public GetMediaMetaDataErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetMediaMetaDataErrors { } GetMediaMetaDataErrors other = (GetMediaMetaDataErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetMediaMetaDataErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetMediaMetaDataErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetMediaMetaDataErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetMediaMetaDataErrors { this.status = status; return this; } - + public GetMediaMetaDataErrors build() { + return new GetMediaMetaDataErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataLibraryErrors.java index df92d909..ffdb53b6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetMediaMetaDataLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetMediaMetaDataLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetMediaMetaDataLibraryErrors { return this; } + public GetMediaMetaDataLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetMediaMetaDataLibraryErrors { return this; } + public GetMediaMetaDataLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetMediaMetaDataLibraryErrors { return this; } + public GetMediaMetaDataLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetMediaMetaDataLibraryErrors { } GetMediaMetaDataLibraryErrors other = (GetMediaMetaDataLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetMediaMetaDataLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetMediaMetaDataLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetMediaMetaDataLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetMediaMetaDataLibraryErrors { this.status = status; return this; } - + public GetMediaMetaDataLibraryErrors build() { + return new GetMediaMetaDataLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataUnauthorized.java index 305b452c..1d2efd2e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaMetaDataUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { public GetMediaMetaDataUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { return this; } + public GetMediaMetaDataUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { } GetMediaMetaDataUnauthorized other = (GetMediaMetaDataUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetMediaMetaDataUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetMediaMetaDataUnauthorized build() { + return new GetMediaMetaDataUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersBadRequest.java index 08c8055a..c06acd7f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetMediaProvidersBadRequest extends RuntimeException { public GetMediaProvidersBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetMediaProvidersBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaProvidersBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetMediaProvidersBadRequest extends RuntimeException { return this; } + public GetMediaProvidersBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetMediaProvidersBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetMediaProvidersBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetMediaProvidersBadRequest extends RuntimeException { } GetMediaProvidersBadRequest other = (GetMediaProvidersBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetMediaProvidersBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetMediaProvidersBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetMediaProvidersBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetMediaProvidersBadRequest build() { + return new GetMediaProvidersBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersErrors.java index 030e5221..2403422b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersErrors.java @@ -12,19 +12,21 @@ 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 GetMediaProvidersErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetMediaProvidersErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaProvidersErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetMediaProvidersErrors { return this; } + public GetMediaProvidersErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetMediaProvidersErrors { return this; } + public GetMediaProvidersErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetMediaProvidersErrors { return this; } + public GetMediaProvidersErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetMediaProvidersErrors { } GetMediaProvidersErrors other = (GetMediaProvidersErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetMediaProvidersErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetMediaProvidersErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetMediaProvidersErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetMediaProvidersErrors { this.status = status; return this; } - + public GetMediaProvidersErrors build() { + return new GetMediaProvidersErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersServerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersServerErrors.java index 43b19e45..d0c9f0d1 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersServerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersServerErrors.java @@ -12,19 +12,21 @@ 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 GetMediaProvidersServerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetMediaProvidersServerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaProvidersServerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetMediaProvidersServerErrors { return this; } + public GetMediaProvidersServerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetMediaProvidersServerErrors { return this; } + public GetMediaProvidersServerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetMediaProvidersServerErrors { return this; } + public GetMediaProvidersServerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetMediaProvidersServerErrors { } GetMediaProvidersServerErrors other = (GetMediaProvidersServerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetMediaProvidersServerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetMediaProvidersServerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetMediaProvidersServerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetMediaProvidersServerErrors { this.status = status; return this; } - + public GetMediaProvidersServerErrors build() { + return new GetMediaProvidersServerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersUnauthorized.java index b84ea734..1e0d4fad 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMediaProvidersUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { public GetMediaProvidersUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaProvidersUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { return this; } + public GetMediaProvidersUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { } GetMediaProvidersUnauthorized other = (GetMediaProvidersUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetMediaProvidersUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetMediaProvidersUnauthorized build() { + return new GetMediaProvidersUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenBadRequest.java index eb196d76..8f368f29 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { public GetMetadataChildrenBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMetadataChildrenBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { return this; } + public GetMetadataChildrenBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { } GetMetadataChildrenBadRequest other = (GetMetadataChildrenBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetMetadataChildrenBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetMetadataChildrenBadRequest build() { + return new GetMetadataChildrenBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenErrors.java index 99b0982d..71467a87 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenErrors.java @@ -12,19 +12,21 @@ 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 GetMetadataChildrenErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetMetadataChildrenErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMetadataChildrenErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetMetadataChildrenErrors { return this; } + public GetMetadataChildrenErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetMetadataChildrenErrors { return this; } + public GetMetadataChildrenErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetMetadataChildrenErrors { return this; } + public GetMetadataChildrenErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetMetadataChildrenErrors { } GetMetadataChildrenErrors other = (GetMetadataChildrenErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetMetadataChildrenErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetMetadataChildrenErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetMetadataChildrenErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetMetadataChildrenErrors { this.status = status; return this; } - + public GetMetadataChildrenErrors build() { + return new GetMetadataChildrenErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenLibraryErrors.java index 59913188..689dec6f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetMetadataChildrenLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetMetadataChildrenLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMetadataChildrenLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetMetadataChildrenLibraryErrors { return this; } + public GetMetadataChildrenLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetMetadataChildrenLibraryErrors { return this; } + public GetMetadataChildrenLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetMetadataChildrenLibraryErrors { return this; } + public GetMetadataChildrenLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetMetadataChildrenLibraryErrors { } GetMetadataChildrenLibraryErrors other = (GetMetadataChildrenLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetMetadataChildrenLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetMetadataChildrenLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetMetadataChildrenLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetMetadataChildrenLibraryErrors { this.status = status; return this; } - + public GetMetadataChildrenLibraryErrors build() { + return new GetMetadataChildrenLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenUnauthorized.java index 6510e2b2..2d7872a2 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMetadataChildrenUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { public GetMetadataChildrenUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMetadataChildrenUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { return this; } + public GetMetadataChildrenUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { } GetMetadataChildrenUnauthorized other = (GetMetadataChildrenUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetMetadataChildrenUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetMetadataChildrenUnauthorized build() { + return new GetMetadataChildrenUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountBadRequest.java index fd8753bc..9a072610 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { public GetMyPlexAccountBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMyPlexAccountBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { return this; } + public GetMyPlexAccountBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { } GetMyPlexAccountBadRequest other = (GetMyPlexAccountBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetMyPlexAccountBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetMyPlexAccountBadRequest build() { + return new GetMyPlexAccountBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountErrors.java index eba277aa..e3f16e27 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountErrors.java @@ -12,19 +12,21 @@ 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 GetMyPlexAccountErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetMyPlexAccountErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMyPlexAccountErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetMyPlexAccountErrors { return this; } + public GetMyPlexAccountErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetMyPlexAccountErrors { return this; } + public GetMyPlexAccountErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetMyPlexAccountErrors { return this; } + public GetMyPlexAccountErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetMyPlexAccountErrors { } GetMyPlexAccountErrors other = (GetMyPlexAccountErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetMyPlexAccountErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetMyPlexAccountErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetMyPlexAccountErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetMyPlexAccountErrors { this.status = status; return this; } - + public GetMyPlexAccountErrors build() { + return new GetMyPlexAccountErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountServerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountServerErrors.java index ad7f5bba..f8339893 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountServerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountServerErrors.java @@ -12,19 +12,21 @@ 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 GetMyPlexAccountServerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetMyPlexAccountServerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMyPlexAccountServerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetMyPlexAccountServerErrors { return this; } + public GetMyPlexAccountServerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetMyPlexAccountServerErrors { return this; } + public GetMyPlexAccountServerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetMyPlexAccountServerErrors { return this; } + public GetMyPlexAccountServerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetMyPlexAccountServerErrors { } GetMyPlexAccountServerErrors other = (GetMyPlexAccountServerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetMyPlexAccountServerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetMyPlexAccountServerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetMyPlexAccountServerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetMyPlexAccountServerErrors { this.status = status; return this; } - + public GetMyPlexAccountServerErrors build() { + return new GetMyPlexAccountServerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountUnauthorized.java index b04eb1b2..022e1b25 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetMyPlexAccountUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { public GetMyPlexAccountUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMyPlexAccountUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { return this; } + public GetMyPlexAccountUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { } GetMyPlexAccountUnauthorized other = (GetMyPlexAccountUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetMyPlexAccountUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetMyPlexAccountUnauthorized build() { + return new GetMyPlexAccountUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPinBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPinBadRequest.java index 3077bc5f..881b1288 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPinBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPinBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetPinBadRequest extends RuntimeException { public GetPinBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetPinBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPinBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetPinBadRequest extends RuntimeException { return this; } + public GetPinBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetPinBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetPinBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetPinBadRequest extends RuntimeException { } GetPinBadRequest other = (GetPinBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetPinBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetPinBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetPinBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetPinBadRequest build() { + return new GetPinBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPinErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPinErrors.java index b2b2ace7..85312bb6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPinErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPinErrors.java @@ -12,19 +12,21 @@ 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 GetPinErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetPinErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPinErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetPinErrors { return this; } + public GetPinErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetPinErrors { return this; } + public GetPinErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetPinErrors { return this; } + public GetPinErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetPinErrors { } GetPinErrors other = (GetPinErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetPinErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetPinErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetPinErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetPinErrors { this.status = status; return this; } - + public GetPinErrors build() { + return new GetPinErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistBadRequest.java index 7103686f..fcdd4d90 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetPlaylistBadRequest extends RuntimeException { public GetPlaylistBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetPlaylistBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetPlaylistBadRequest extends RuntimeException { return this; } + public GetPlaylistBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetPlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetPlaylistBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetPlaylistBadRequest extends RuntimeException { } GetPlaylistBadRequest other = (GetPlaylistBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetPlaylistBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetPlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetPlaylistBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetPlaylistBadRequest build() { + return new GetPlaylistBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsBadRequest.java index 84e62b11..1d0533ed 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { public GetPlaylistContentsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { return this; } + public GetPlaylistContentsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { } GetPlaylistContentsBadRequest other = (GetPlaylistContentsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetPlaylistContentsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetPlaylistContentsBadRequest build() { + return new GetPlaylistContentsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsErrors.java index 7efff5e3..3849914d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsErrors.java @@ -12,19 +12,21 @@ 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 GetPlaylistContentsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetPlaylistContentsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetPlaylistContentsErrors { return this; } + public GetPlaylistContentsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetPlaylistContentsErrors { return this; } + public GetPlaylistContentsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetPlaylistContentsErrors { return this; } + public GetPlaylistContentsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetPlaylistContentsErrors { } GetPlaylistContentsErrors other = (GetPlaylistContentsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetPlaylistContentsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetPlaylistContentsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetPlaylistContentsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetPlaylistContentsErrors { this.status = status; return this; } - + public GetPlaylistContentsErrors build() { + return new GetPlaylistContentsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsPlaylistsErrors.java index ee256071..de620c1d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 GetPlaylistContentsPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetPlaylistContentsPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetPlaylistContentsPlaylistsErrors { return this; } + public GetPlaylistContentsPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetPlaylistContentsPlaylistsErrors { return this; } + public GetPlaylistContentsPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetPlaylistContentsPlaylistsErrors { return this; } + public GetPlaylistContentsPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetPlaylistContentsPlaylistsErrors { } GetPlaylistContentsPlaylistsErrors other = (GetPlaylistContentsPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetPlaylistContentsPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetPlaylistContentsPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetPlaylistContentsPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetPlaylistContentsPlaylistsErrors { this.status = status; return this; } - + public GetPlaylistContentsPlaylistsErrors build() { + return new GetPlaylistContentsPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsUnauthorized.java index af65a98e..b9d74994 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistContentsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { public GetPlaylistContentsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { return this; } + public GetPlaylistContentsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { } GetPlaylistContentsUnauthorized other = (GetPlaylistContentsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetPlaylistContentsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetPlaylistContentsUnauthorized build() { + return new GetPlaylistContentsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistErrors.java index 20d11144..15c31f52 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistErrors.java @@ -12,19 +12,21 @@ 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 GetPlaylistErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetPlaylistErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetPlaylistErrors { return this; } + public GetPlaylistErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetPlaylistErrors { return this; } + public GetPlaylistErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetPlaylistErrors { return this; } + public GetPlaylistErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetPlaylistErrors { } GetPlaylistErrors other = (GetPlaylistErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetPlaylistErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetPlaylistErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetPlaylistErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetPlaylistErrors { this.status = status; return this; } - + public GetPlaylistErrors build() { + return new GetPlaylistErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistPlaylistsErrors.java index 1336ccc1..6bd32339 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 GetPlaylistPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetPlaylistPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetPlaylistPlaylistsErrors { return this; } + public GetPlaylistPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetPlaylistPlaylistsErrors { return this; } + public GetPlaylistPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetPlaylistPlaylistsErrors { return this; } + public GetPlaylistPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetPlaylistPlaylistsErrors { } GetPlaylistPlaylistsErrors other = (GetPlaylistPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetPlaylistPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetPlaylistPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetPlaylistPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetPlaylistPlaylistsErrors { this.status = status; return this; } - + public GetPlaylistPlaylistsErrors build() { + return new GetPlaylistPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistUnauthorized.java index 77d790a0..3dac1f56 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetPlaylistUnauthorized extends RuntimeException { public GetPlaylistUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetPlaylistUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetPlaylistUnauthorized extends RuntimeException { return this; } + public GetPlaylistUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetPlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetPlaylistUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetPlaylistUnauthorized extends RuntimeException { } GetPlaylistUnauthorized other = (GetPlaylistUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetPlaylistUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetPlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetPlaylistUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetPlaylistUnauthorized build() { + return new GetPlaylistUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsBadRequest.java index e05969d2..b1ea6922 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetPlaylistsBadRequest extends RuntimeException { public GetPlaylistsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetPlaylistsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetPlaylistsBadRequest extends RuntimeException { return this; } + public GetPlaylistsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetPlaylistsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetPlaylistsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetPlaylistsBadRequest extends RuntimeException { } GetPlaylistsBadRequest other = (GetPlaylistsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetPlaylistsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetPlaylistsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetPlaylistsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetPlaylistsBadRequest build() { + return new GetPlaylistsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsErrors.java index 07aaae5a..b0f94304 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 GetPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetPlaylistsErrors { return this; } + public GetPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetPlaylistsErrors { return this; } + public GetPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetPlaylistsErrors { return this; } + public GetPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetPlaylistsErrors { } GetPlaylistsErrors other = (GetPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetPlaylistsErrors { this.status = status; return this; } - + public GetPlaylistsErrors build() { + return new GetPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsPlaylistsErrors.java index 23b0031c..6c78c3aa 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 GetPlaylistsPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetPlaylistsPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistsPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetPlaylistsPlaylistsErrors { return this; } + public GetPlaylistsPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetPlaylistsPlaylistsErrors { return this; } + public GetPlaylistsPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetPlaylistsPlaylistsErrors { return this; } + public GetPlaylistsPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetPlaylistsPlaylistsErrors { } GetPlaylistsPlaylistsErrors other = (GetPlaylistsPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetPlaylistsPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetPlaylistsPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetPlaylistsPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetPlaylistsPlaylistsErrors { this.status = status; return this; } - + public GetPlaylistsPlaylistsErrors build() { + return new GetPlaylistsPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsUnauthorized.java index bfbc5545..9b1c4ac5 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetPlaylistsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetPlaylistsUnauthorized extends RuntimeException { public GetPlaylistsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetPlaylistsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetPlaylistsUnauthorized extends RuntimeException { return this; } + public GetPlaylistsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetPlaylistsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetPlaylistsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetPlaylistsUnauthorized extends RuntimeException { } GetPlaylistsUnauthorized other = (GetPlaylistsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetPlaylistsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetPlaylistsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetPlaylistsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetPlaylistsUnauthorized build() { + return new GetPlaylistsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryBadRequest.java index fd549f7b..2ef41523 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { public GetRecentlyAddedLibraryBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { return this; } + public GetRecentlyAddedLibraryBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { } GetRecentlyAddedLibraryBadRequest other = (GetRecentlyAddedLibraryBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetRecentlyAddedLibraryBadRequest build() { + return new GetRecentlyAddedLibraryBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryErrors.java index d8fb3dd3..adad9f31 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetRecentlyAddedLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetRecentlyAddedLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetRecentlyAddedLibraryErrors { return this; } + public GetRecentlyAddedLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetRecentlyAddedLibraryErrors { return this; } + public GetRecentlyAddedLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetRecentlyAddedLibraryErrors { return this; } + public GetRecentlyAddedLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetRecentlyAddedLibraryErrors { } GetRecentlyAddedLibraryErrors other = (GetRecentlyAddedLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetRecentlyAddedLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetRecentlyAddedLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetRecentlyAddedLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetRecentlyAddedLibraryErrors { this.status = status; return this; } - + public GetRecentlyAddedLibraryErrors build() { + return new GetRecentlyAddedLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryLibraryErrors.java index 6987a113..5831fab4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetRecentlyAddedLibraryLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetRecentlyAddedLibraryLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetRecentlyAddedLibraryLibraryErrors { return this; } + public GetRecentlyAddedLibraryLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetRecentlyAddedLibraryLibraryErrors { return this; } + public GetRecentlyAddedLibraryLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetRecentlyAddedLibraryLibraryErrors { return this; } + public GetRecentlyAddedLibraryLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetRecentlyAddedLibraryLibraryErrors { } GetRecentlyAddedLibraryLibraryErrors other = (GetRecentlyAddedLibraryLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetRecentlyAddedLibraryLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetRecentlyAddedLibraryLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetRecentlyAddedLibraryLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetRecentlyAddedLibraryLibraryErrors { this.status = status; return this; } - + public GetRecentlyAddedLibraryLibraryErrors build() { + return new GetRecentlyAddedLibraryLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryUnauthorized.java index b9afb685..a4d953c3 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetRecentlyAddedLibraryUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { public GetRecentlyAddedLibraryUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { return this; } + public GetRecentlyAddedLibraryUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { } GetRecentlyAddedLibraryUnauthorized other = (GetRecentlyAddedLibraryUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetRecentlyAddedLibraryUnauthorized build() { + return new GetRecentlyAddedLibraryUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataBadRequest.java index b1513948..eaf8bab7 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { public GetRefreshLibraryMetadataBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRefreshLibraryMetadataBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { return this; } + public GetRefreshLibraryMetadataBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { } GetRefreshLibraryMetadataBadRequest other = (GetRefreshLibraryMetadataBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetRefreshLibraryMetadataBadRequest build() { + return new GetRefreshLibraryMetadataBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataErrors.java index cc1b8f92..16ef71f9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataErrors.java @@ -12,19 +12,21 @@ 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 GetRefreshLibraryMetadataErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetRefreshLibraryMetadataErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRefreshLibraryMetadataErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetRefreshLibraryMetadataErrors { return this; } + public GetRefreshLibraryMetadataErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetRefreshLibraryMetadataErrors { return this; } + public GetRefreshLibraryMetadataErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetRefreshLibraryMetadataErrors { return this; } + public GetRefreshLibraryMetadataErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetRefreshLibraryMetadataErrors { } GetRefreshLibraryMetadataErrors other = (GetRefreshLibraryMetadataErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetRefreshLibraryMetadataErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetRefreshLibraryMetadataErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetRefreshLibraryMetadataErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetRefreshLibraryMetadataErrors { this.status = status; return this; } - + public GetRefreshLibraryMetadataErrors build() { + return new GetRefreshLibraryMetadataErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataLibraryErrors.java index 07130d66..ae6c116c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetRefreshLibraryMetadataLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetRefreshLibraryMetadataLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRefreshLibraryMetadataLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetRefreshLibraryMetadataLibraryErrors { return this; } + public GetRefreshLibraryMetadataLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetRefreshLibraryMetadataLibraryErrors { return this; } + public GetRefreshLibraryMetadataLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetRefreshLibraryMetadataLibraryErrors { return this; } + public GetRefreshLibraryMetadataLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetRefreshLibraryMetadataLibraryErrors { } GetRefreshLibraryMetadataLibraryErrors other = (GetRefreshLibraryMetadataLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetRefreshLibraryMetadataLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetRefreshLibraryMetadataLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetRefreshLibraryMetadataLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetRefreshLibraryMetadataLibraryErrors { this.status = status; return this; } - + public GetRefreshLibraryMetadataLibraryErrors build() { + return new GetRefreshLibraryMetadataLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataUnauthorized.java index 559876ff..ec61e392 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetRefreshLibraryMetadataUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { public GetRefreshLibraryMetadataUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRefreshLibraryMetadataUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { return this; } + public GetRefreshLibraryMetadataUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { } GetRefreshLibraryMetadataUnauthorized other = (GetRefreshLibraryMetadataUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetRefreshLibraryMetadataUnauthorized build() { + return new GetRefreshLibraryMetadataUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoBadRequest.java index f0fbbbca..fc059915 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetResizedPhotoBadRequest extends RuntimeException { public GetResizedPhotoBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetResizedPhotoBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResizedPhotoBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetResizedPhotoBadRequest extends RuntimeException { return this; } + public GetResizedPhotoBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetResizedPhotoBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetResizedPhotoBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetResizedPhotoBadRequest extends RuntimeException { } GetResizedPhotoBadRequest other = (GetResizedPhotoBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetResizedPhotoBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetResizedPhotoBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetResizedPhotoBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetResizedPhotoBadRequest build() { + return new GetResizedPhotoBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoErrors.java index fe685a91..2c1246d7 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoErrors.java @@ -12,19 +12,21 @@ 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 GetResizedPhotoErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetResizedPhotoErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResizedPhotoErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetResizedPhotoErrors { return this; } + public GetResizedPhotoErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetResizedPhotoErrors { return this; } + public GetResizedPhotoErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetResizedPhotoErrors { return this; } + public GetResizedPhotoErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetResizedPhotoErrors { } GetResizedPhotoErrors other = (GetResizedPhotoErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetResizedPhotoErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetResizedPhotoErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetResizedPhotoErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetResizedPhotoErrors { this.status = status; return this; } - + public GetResizedPhotoErrors build() { + return new GetResizedPhotoErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoServerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoServerErrors.java index 41c7a169..7dc2c244 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoServerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoServerErrors.java @@ -12,19 +12,21 @@ 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 GetResizedPhotoServerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetResizedPhotoServerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResizedPhotoServerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetResizedPhotoServerErrors { return this; } + public GetResizedPhotoServerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetResizedPhotoServerErrors { return this; } + public GetResizedPhotoServerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetResizedPhotoServerErrors { return this; } + public GetResizedPhotoServerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetResizedPhotoServerErrors { } GetResizedPhotoServerErrors other = (GetResizedPhotoServerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetResizedPhotoServerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetResizedPhotoServerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetResizedPhotoServerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetResizedPhotoServerErrors { this.status = status; return this; } - + public GetResizedPhotoServerErrors build() { + return new GetResizedPhotoServerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoUnauthorized.java index c8f780c9..6f8f6bc3 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetResizedPhotoUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { public GetResizedPhotoUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResizedPhotoUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { return this; } + public GetResizedPhotoUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { } GetResizedPhotoUnauthorized other = (GetResizedPhotoUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetResizedPhotoUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetResizedPhotoUnauthorized build() { + return new GetResizedPhotoUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsBadRequest.java index 4c6fd2a1..fa87e0ab 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { public GetResourcesStatisticsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResourcesStatisticsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { return this; } + public GetResourcesStatisticsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { } GetResourcesStatisticsBadRequest other = (GetResourcesStatisticsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetResourcesStatisticsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetResourcesStatisticsBadRequest build() { + return new GetResourcesStatisticsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsErrors.java index 0aad0e79..941be1c3 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsErrors.java @@ -12,19 +12,21 @@ 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 GetResourcesStatisticsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetResourcesStatisticsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResourcesStatisticsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetResourcesStatisticsErrors { return this; } + public GetResourcesStatisticsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetResourcesStatisticsErrors { return this; } + public GetResourcesStatisticsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetResourcesStatisticsErrors { return this; } + public GetResourcesStatisticsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetResourcesStatisticsErrors { } GetResourcesStatisticsErrors other = (GetResourcesStatisticsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetResourcesStatisticsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetResourcesStatisticsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetResourcesStatisticsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetResourcesStatisticsErrors { this.status = status; return this; } - + public GetResourcesStatisticsErrors build() { + return new GetResourcesStatisticsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsStatisticsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsStatisticsErrors.java index 58c16aee..9030f33c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsStatisticsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsStatisticsErrors.java @@ -12,19 +12,21 @@ 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 GetResourcesStatisticsStatisticsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetResourcesStatisticsStatisticsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResourcesStatisticsStatisticsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetResourcesStatisticsStatisticsErrors { return this; } + public GetResourcesStatisticsStatisticsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetResourcesStatisticsStatisticsErrors { return this; } + public GetResourcesStatisticsStatisticsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetResourcesStatisticsStatisticsErrors { return this; } + public GetResourcesStatisticsStatisticsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetResourcesStatisticsStatisticsErrors { } GetResourcesStatisticsStatisticsErrors other = (GetResourcesStatisticsStatisticsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetResourcesStatisticsStatisticsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetResourcesStatisticsStatisticsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetResourcesStatisticsStatisticsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetResourcesStatisticsStatisticsErrors { this.status = status; return this; } - + public GetResourcesStatisticsStatisticsErrors build() { + return new GetResourcesStatisticsStatisticsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsUnauthorized.java index b9f8abef..72c19e1c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetResourcesStatisticsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { public GetResourcesStatisticsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResourcesStatisticsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { return this; } + public GetResourcesStatisticsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { } GetResourcesStatisticsUnauthorized other = (GetResourcesStatisticsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetResourcesStatisticsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetResourcesStatisticsUnauthorized build() { + return new GetResourcesStatisticsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesBadRequest.java index 638f5689..9fd5c302 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { public GetSearchAllLibrariesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchAllLibrariesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { return this; } + public GetSearchAllLibrariesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { } GetSearchAllLibrariesBadRequest other = (GetSearchAllLibrariesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSearchAllLibrariesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSearchAllLibrariesBadRequest build() { + return new GetSearchAllLibrariesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesErrors.java index 615b5650..40565674 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesErrors.java @@ -12,19 +12,21 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetSearchAllLibrariesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSearchAllLibrariesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchAllLibrariesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSearchAllLibrariesErrors { return this; } + public GetSearchAllLibrariesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSearchAllLibrariesErrors { return this; } + public GetSearchAllLibrariesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSearchAllLibrariesErrors { return this; } + public GetSearchAllLibrariesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSearchAllLibrariesErrors { } GetSearchAllLibrariesErrors other = (GetSearchAllLibrariesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSearchAllLibrariesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSearchAllLibrariesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSearchAllLibrariesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSearchAllLibrariesErrors { this.status = status; return this; } - + public GetSearchAllLibrariesErrors build() { + return new GetSearchAllLibrariesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesLibraryErrors.java index b408a079..157d249e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesLibraryErrors.java @@ -12,19 +12,21 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetSearchAllLibrariesLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSearchAllLibrariesLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchAllLibrariesLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSearchAllLibrariesLibraryErrors { return this; } + public GetSearchAllLibrariesLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSearchAllLibrariesLibraryErrors { return this; } + public GetSearchAllLibrariesLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSearchAllLibrariesLibraryErrors { return this; } + public GetSearchAllLibrariesLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSearchAllLibrariesLibraryErrors { } GetSearchAllLibrariesLibraryErrors other = (GetSearchAllLibrariesLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSearchAllLibrariesLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSearchAllLibrariesLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSearchAllLibrariesLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSearchAllLibrariesLibraryErrors { this.status = status; return this; } - + public GetSearchAllLibrariesLibraryErrors build() { + return new GetSearchAllLibrariesLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesUnauthorized.java index 4fbff7f5..7323129d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchAllLibrariesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { public GetSearchAllLibrariesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchAllLibrariesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { return this; } + public GetSearchAllLibrariesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { } GetSearchAllLibrariesUnauthorized other = (GetSearchAllLibrariesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSearchAllLibrariesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSearchAllLibrariesUnauthorized build() { + return new GetSearchAllLibrariesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryBadRequest.java index ee3b0325..20307f94 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSearchLibraryBadRequest extends RuntimeException { public GetSearchLibraryBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSearchLibraryBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchLibraryBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSearchLibraryBadRequest extends RuntimeException { return this; } + public GetSearchLibraryBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSearchLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSearchLibraryBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSearchLibraryBadRequest extends RuntimeException { } GetSearchLibraryBadRequest other = (GetSearchLibraryBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSearchLibraryBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSearchLibraryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSearchLibraryBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSearchLibraryBadRequest build() { + return new GetSearchLibraryBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryErrors.java index 941a6bd1..b65848d6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetSearchLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSearchLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSearchLibraryErrors { return this; } + public GetSearchLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSearchLibraryErrors { return this; } + public GetSearchLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSearchLibraryErrors { return this; } + public GetSearchLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSearchLibraryErrors { } GetSearchLibraryErrors other = (GetSearchLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSearchLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSearchLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSearchLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSearchLibraryErrors { this.status = status; return this; } - + public GetSearchLibraryErrors build() { + return new GetSearchLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryLibraryErrors.java index 018c2ae6..1fc270c1 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetSearchLibraryLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSearchLibraryLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchLibraryLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSearchLibraryLibraryErrors { return this; } + public GetSearchLibraryLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSearchLibraryLibraryErrors { return this; } + public GetSearchLibraryLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSearchLibraryLibraryErrors { return this; } + public GetSearchLibraryLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSearchLibraryLibraryErrors { } GetSearchLibraryLibraryErrors other = (GetSearchLibraryLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSearchLibraryLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSearchLibraryLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSearchLibraryLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSearchLibraryLibraryErrors { this.status = status; return this; } - + public GetSearchLibraryLibraryErrors build() { + return new GetSearchLibraryLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryUnauthorized.java index bb581770..71cf841d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchLibraryUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { public GetSearchLibraryUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchLibraryUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { return this; } + public GetSearchLibraryUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { } GetSearchLibraryUnauthorized other = (GetSearchLibraryUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSearchLibraryUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSearchLibraryUnauthorized build() { + return new GetSearchLibraryUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsBadRequest.java index 3a3d04f5..2cd19d1a 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSearchResultsBadRequest extends RuntimeException { public GetSearchResultsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSearchResultsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSearchResultsBadRequest extends RuntimeException { return this; } + public GetSearchResultsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSearchResultsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSearchResultsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSearchResultsBadRequest extends RuntimeException { } GetSearchResultsBadRequest other = (GetSearchResultsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSearchResultsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSearchResultsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSearchResultsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSearchResultsBadRequest build() { + return new GetSearchResultsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsErrors.java index 4b2f57b7..35c30ac7 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsErrors.java @@ -12,19 +12,21 @@ 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 GetSearchResultsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSearchResultsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSearchResultsErrors { return this; } + public GetSearchResultsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSearchResultsErrors { return this; } + public GetSearchResultsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSearchResultsErrors { return this; } + public GetSearchResultsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSearchResultsErrors { } GetSearchResultsErrors other = (GetSearchResultsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSearchResultsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSearchResultsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSearchResultsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSearchResultsErrors { this.status = status; return this; } - + public GetSearchResultsErrors build() { + return new GetSearchResultsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsSearchErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsSearchErrors.java index ca9da163..ac9c8124 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsSearchErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsSearchErrors.java @@ -12,19 +12,21 @@ 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 GetSearchResultsSearchErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSearchResultsSearchErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsSearchErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSearchResultsSearchErrors { return this; } + public GetSearchResultsSearchErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSearchResultsSearchErrors { return this; } + public GetSearchResultsSearchErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSearchResultsSearchErrors { return this; } + public GetSearchResultsSearchErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSearchResultsSearchErrors { } GetSearchResultsSearchErrors other = (GetSearchResultsSearchErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSearchResultsSearchErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSearchResultsSearchErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSearchResultsSearchErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSearchResultsSearchErrors { this.status = status; return this; } - + public GetSearchResultsSearchErrors build() { + return new GetSearchResultsSearchErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsUnauthorized.java index 48662e9b..164731b6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSearchResultsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSearchResultsUnauthorized extends RuntimeException { public GetSearchResultsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSearchResultsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSearchResultsUnauthorized extends RuntimeException { return this; } + public GetSearchResultsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSearchResultsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSearchResultsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSearchResultsUnauthorized extends RuntimeException { } GetSearchResultsUnauthorized other = (GetSearchResultsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSearchResultsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSearchResultsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSearchResultsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSearchResultsUnauthorized build() { + return new GetSearchResultsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesActivitiesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesActivitiesErrors.java index 34f41ced..e90fa152 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesActivitiesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesActivitiesErrors.java @@ -12,19 +12,21 @@ 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 GetServerActivitiesActivitiesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerActivitiesActivitiesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerActivitiesActivitiesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerActivitiesActivitiesErrors { return this; } + public GetServerActivitiesActivitiesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerActivitiesActivitiesErrors { return this; } + public GetServerActivitiesActivitiesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerActivitiesActivitiesErrors { return this; } + public GetServerActivitiesActivitiesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerActivitiesActivitiesErrors { } GetServerActivitiesActivitiesErrors other = (GetServerActivitiesActivitiesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerActivitiesActivitiesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerActivitiesActivitiesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerActivitiesActivitiesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerActivitiesActivitiesErrors { this.status = status; return this; } - + public GetServerActivitiesActivitiesErrors build() { + return new GetServerActivitiesActivitiesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesBadRequest.java index bb881a7a..1462f467 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerActivitiesBadRequest extends RuntimeException { public GetServerActivitiesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerActivitiesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerActivitiesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerActivitiesBadRequest extends RuntimeException { return this; } + public GetServerActivitiesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerActivitiesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerActivitiesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerActivitiesBadRequest extends RuntimeException { } GetServerActivitiesBadRequest other = (GetServerActivitiesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerActivitiesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerActivitiesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerActivitiesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerActivitiesBadRequest build() { + return new GetServerActivitiesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesErrors.java index 97068e23..4cc2295b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesErrors.java @@ -12,19 +12,21 @@ 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 GetServerActivitiesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerActivitiesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerActivitiesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerActivitiesErrors { return this; } + public GetServerActivitiesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerActivitiesErrors { return this; } + public GetServerActivitiesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerActivitiesErrors { return this; } + public GetServerActivitiesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerActivitiesErrors { } GetServerActivitiesErrors other = (GetServerActivitiesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerActivitiesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerActivitiesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerActivitiesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerActivitiesErrors { this.status = status; return this; } - + public GetServerActivitiesErrors build() { + return new GetServerActivitiesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesUnauthorized.java index a9e09eb6..bfa01b91 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerActivitiesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { public GetServerActivitiesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerActivitiesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { return this; } + public GetServerActivitiesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { } GetServerActivitiesUnauthorized other = (GetServerActivitiesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerActivitiesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerActivitiesUnauthorized build() { + return new GetServerActivitiesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesBadRequest.java index 002bb291..54b73039 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { public GetServerCapabilitiesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerCapabilitiesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { return this; } + public GetServerCapabilitiesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { } GetServerCapabilitiesBadRequest other = (GetServerCapabilitiesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerCapabilitiesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerCapabilitiesBadRequest build() { + return new GetServerCapabilitiesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesErrors.java index 7bcdea6f..7c3152e4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesErrors.java @@ -12,19 +12,21 @@ 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 GetServerCapabilitiesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerCapabilitiesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerCapabilitiesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerCapabilitiesErrors { return this; } + public GetServerCapabilitiesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerCapabilitiesErrors { return this; } + public GetServerCapabilitiesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerCapabilitiesErrors { return this; } + public GetServerCapabilitiesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerCapabilitiesErrors { } GetServerCapabilitiesErrors other = (GetServerCapabilitiesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerCapabilitiesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerCapabilitiesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerCapabilitiesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerCapabilitiesErrors { this.status = status; return this; } - + public GetServerCapabilitiesErrors build() { + return new GetServerCapabilitiesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesUnauthorized.java index d1c64f60..03e57955 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerCapabilitiesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { public GetServerCapabilitiesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerCapabilitiesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { return this; } + public GetServerCapabilitiesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { } GetServerCapabilitiesUnauthorized other = (GetServerCapabilitiesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerCapabilitiesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerCapabilitiesUnauthorized build() { + return new GetServerCapabilitiesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerIdentityRequestTimeout.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerIdentityRequestTimeout.java index 22a1fa3a..80ed085e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerIdentityRequestTimeout.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerIdentityRequestTimeout.java @@ -16,7 +16,6 @@ import java.lang.RuntimeException; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; /** @@ -31,6 +30,7 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; @@ -47,7 +47,7 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { @JsonProperty("code") Optional code, @JsonProperty("message") Optional message, @JsonProperty("RawResponse") Optional> rawResponse) { - super(message.orElse(null)); + super(Utils.valueOrElse(message, "API error occurred")); Utils.checkNotNull(code, "code"); Utils.checkNotNull(message, "message"); Utils.checkNotNull(rawResponse, "rawResponse"); @@ -85,9 +85,10 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerIdentityRequestTimeout withCode(int code) { Utils.checkNotNull(code, "code"); @@ -95,6 +96,7 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { return this; } + public GetServerIdentityRequestTimeout withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -107,6 +109,7 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { return this; } + public GetServerIdentityRequestTimeout withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -122,6 +125,7 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -131,7 +135,6 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,17 +145,15 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { } GetServerIdentityRequestTimeout other = (GetServerIdentityRequestTimeout) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - code, - message, - rawResponse); + return Utils.enhancedHash( + code, message, rawResponse); } @Override @@ -162,19 +163,21 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { "message", message, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -187,6 +190,7 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -199,6 +203,7 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -216,13 +221,13 @@ public class GetServerIdentityRequestTimeout extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerIdentityRequestTimeout build() { + return new GetServerIdentityRequestTimeout( - code, - message, - rawResponse); + code, message, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerListBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerListBadRequest.java index 79731abf..7e1b331b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerListBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerListBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerListBadRequest extends RuntimeException { public GetServerListBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerListBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerListBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerListBadRequest extends RuntimeException { return this; } + public GetServerListBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerListBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerListBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerListBadRequest extends RuntimeException { } GetServerListBadRequest other = (GetServerListBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerListBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerListBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerListBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerListBadRequest build() { + return new GetServerListBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerListErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerListErrors.java index 89928561..3f482d30 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerListErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerListErrors.java @@ -12,19 +12,21 @@ 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 GetServerListErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerListErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerListErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerListErrors { return this; } + public GetServerListErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerListErrors { return this; } + public GetServerListErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerListErrors { return this; } + public GetServerListErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerListErrors { } GetServerListErrors other = (GetServerListErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerListErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerListErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerListErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerListErrors { this.status = status; return this; } - + public GetServerListErrors build() { + return new GetServerListErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerListServerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerListServerErrors.java index c686b867..13eeba01 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerListServerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerListServerErrors.java @@ -12,19 +12,21 @@ 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 GetServerListServerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerListServerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerListServerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerListServerErrors { return this; } + public GetServerListServerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerListServerErrors { return this; } + public GetServerListServerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerListServerErrors { return this; } + public GetServerListServerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerListServerErrors { } GetServerListServerErrors other = (GetServerListServerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerListServerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerListServerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerListServerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerListServerErrors { this.status = status; return this; } - + public GetServerListServerErrors build() { + return new GetServerListServerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerListUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerListUnauthorized.java index 53d14afb..e8d81033 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerListUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerListUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerListUnauthorized extends RuntimeException { public GetServerListUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerListUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerListUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerListUnauthorized extends RuntimeException { return this; } + public GetServerListUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerListUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerListUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerListUnauthorized extends RuntimeException { } GetServerListUnauthorized other = (GetServerListUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerListUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerListUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerListUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerListUnauthorized build() { + return new GetServerListUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesBadRequest.java index 6ce3da68..e32fd702 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerPreferencesBadRequest extends RuntimeException { public GetServerPreferencesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerPreferencesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerPreferencesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerPreferencesBadRequest extends RuntimeException { return this; } + public GetServerPreferencesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerPreferencesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerPreferencesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerPreferencesBadRequest extends RuntimeException { } GetServerPreferencesBadRequest other = (GetServerPreferencesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerPreferencesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerPreferencesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerPreferencesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerPreferencesBadRequest build() { + return new GetServerPreferencesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesErrors.java index 7b8dc5b9..befc6770 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesErrors.java @@ -12,19 +12,21 @@ 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 GetServerPreferencesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerPreferencesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerPreferencesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerPreferencesErrors { return this; } + public GetServerPreferencesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerPreferencesErrors { return this; } + public GetServerPreferencesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerPreferencesErrors { return this; } + public GetServerPreferencesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerPreferencesErrors { } GetServerPreferencesErrors other = (GetServerPreferencesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerPreferencesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerPreferencesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerPreferencesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerPreferencesErrors { this.status = status; return this; } - + public GetServerPreferencesErrors build() { + return new GetServerPreferencesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesServerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesServerErrors.java index 9a8cf8d2..6e0b330e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesServerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesServerErrors.java @@ -12,19 +12,21 @@ 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 GetServerPreferencesServerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerPreferencesServerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerPreferencesServerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerPreferencesServerErrors { return this; } + public GetServerPreferencesServerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerPreferencesServerErrors { return this; } + public GetServerPreferencesServerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerPreferencesServerErrors { return this; } + public GetServerPreferencesServerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerPreferencesServerErrors { } GetServerPreferencesServerErrors other = (GetServerPreferencesServerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerPreferencesServerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerPreferencesServerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerPreferencesServerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerPreferencesServerErrors { this.status = status; return this; } - + public GetServerPreferencesServerErrors build() { + return new GetServerPreferencesServerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesUnauthorized.java index 1588dfbd..9b51024f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerPreferencesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { public GetServerPreferencesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerPreferencesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { return this; } + public GetServerPreferencesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { } GetServerPreferencesUnauthorized other = (GetServerPreferencesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerPreferencesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerPreferencesUnauthorized build() { + return new GetServerPreferencesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesBadRequest.java index 7624b2c0..09d5ad13 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerResourcesBadRequest extends RuntimeException { public GetServerResourcesBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerResourcesBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerResourcesBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerResourcesBadRequest extends RuntimeException { return this; } + public GetServerResourcesBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerResourcesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerResourcesBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerResourcesBadRequest extends RuntimeException { } GetServerResourcesBadRequest other = (GetServerResourcesBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerResourcesBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerResourcesBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerResourcesBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerResourcesBadRequest build() { + return new GetServerResourcesBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesErrors.java index 85c77266..8ffc345c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesErrors.java @@ -12,19 +12,21 @@ 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 GetServerResourcesErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerResourcesErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerResourcesErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerResourcesErrors { return this; } + public GetServerResourcesErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerResourcesErrors { return this; } + public GetServerResourcesErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerResourcesErrors { return this; } + public GetServerResourcesErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerResourcesErrors { } GetServerResourcesErrors other = (GetServerResourcesErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerResourcesErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerResourcesErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerResourcesErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerResourcesErrors { this.status = status; return this; } - + public GetServerResourcesErrors build() { + return new GetServerResourcesErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesPlexErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesPlexErrors.java index 3f8a0ccb..58cd038d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesPlexErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesPlexErrors.java @@ -12,19 +12,21 @@ 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 GetServerResourcesPlexErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetServerResourcesPlexErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerResourcesPlexErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetServerResourcesPlexErrors { return this; } + public GetServerResourcesPlexErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetServerResourcesPlexErrors { return this; } + public GetServerResourcesPlexErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetServerResourcesPlexErrors { return this; } + public GetServerResourcesPlexErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetServerResourcesPlexErrors { } GetServerResourcesPlexErrors other = (GetServerResourcesPlexErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetServerResourcesPlexErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetServerResourcesPlexErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetServerResourcesPlexErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetServerResourcesPlexErrors { this.status = status; return this; } - + public GetServerResourcesPlexErrors build() { + return new GetServerResourcesPlexErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesUnauthorized.java index 42271693..5779c72f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetServerResourcesUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetServerResourcesUnauthorized extends RuntimeException { public GetServerResourcesUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetServerResourcesUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerResourcesUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetServerResourcesUnauthorized extends RuntimeException { return this; } + public GetServerResourcesUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetServerResourcesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetServerResourcesUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetServerResourcesUnauthorized extends RuntimeException { } GetServerResourcesUnauthorized other = (GetServerResourcesUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetServerResourcesUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetServerResourcesUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetServerResourcesUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetServerResourcesUnauthorized build() { + return new GetServerResourcesUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryBadRequest.java index bd521b48..4477a496 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSessionHistoryBadRequest extends RuntimeException { public GetSessionHistoryBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSessionHistoryBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionHistoryBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSessionHistoryBadRequest extends RuntimeException { return this; } + public GetSessionHistoryBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSessionHistoryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSessionHistoryBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSessionHistoryBadRequest extends RuntimeException { } GetSessionHistoryBadRequest other = (GetSessionHistoryBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSessionHistoryBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSessionHistoryBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSessionHistoryBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSessionHistoryBadRequest build() { + return new GetSessionHistoryBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryErrors.java index 4dfeab1a..eb85fedf 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryErrors.java @@ -12,19 +12,21 @@ 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 GetSessionHistoryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSessionHistoryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionHistoryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSessionHistoryErrors { return this; } + public GetSessionHistoryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSessionHistoryErrors { return this; } + public GetSessionHistoryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSessionHistoryErrors { return this; } + public GetSessionHistoryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSessionHistoryErrors { } GetSessionHistoryErrors other = (GetSessionHistoryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSessionHistoryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSessionHistoryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSessionHistoryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSessionHistoryErrors { this.status = status; return this; } - + public GetSessionHistoryErrors build() { + return new GetSessionHistoryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistorySessionsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistorySessionsErrors.java index 219bdbfe..34a67ee9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistorySessionsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistorySessionsErrors.java @@ -12,19 +12,21 @@ 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 GetSessionHistorySessionsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSessionHistorySessionsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionHistorySessionsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSessionHistorySessionsErrors { return this; } + public GetSessionHistorySessionsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSessionHistorySessionsErrors { return this; } + public GetSessionHistorySessionsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSessionHistorySessionsErrors { return this; } + public GetSessionHistorySessionsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSessionHistorySessionsErrors { } GetSessionHistorySessionsErrors other = (GetSessionHistorySessionsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSessionHistorySessionsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSessionHistorySessionsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSessionHistorySessionsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSessionHistorySessionsErrors { this.status = status; return this; } - + public GetSessionHistorySessionsErrors build() { + return new GetSessionHistorySessionsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryUnauthorized.java index cf71d445..0ffab36f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionHistoryUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { public GetSessionHistoryUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionHistoryUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { return this; } + public GetSessionHistoryUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { } GetSessionHistoryUnauthorized other = (GetSessionHistoryUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSessionHistoryUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSessionHistoryUnauthorized build() { + return new GetSessionHistoryUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsBadRequest.java index 2f5b6c56..7e1aa357 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSessionsBadRequest extends RuntimeException { public GetSessionsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSessionsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSessionsBadRequest extends RuntimeException { return this; } + public GetSessionsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSessionsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSessionsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSessionsBadRequest extends RuntimeException { } GetSessionsBadRequest other = (GetSessionsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSessionsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSessionsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSessionsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSessionsBadRequest build() { + return new GetSessionsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsErrors.java index d8f52039..6b59f7db 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsErrors.java @@ -12,19 +12,21 @@ 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 GetSessionsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSessionsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSessionsErrors { return this; } + public GetSessionsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSessionsErrors { return this; } + public GetSessionsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSessionsErrors { return this; } + public GetSessionsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSessionsErrors { } GetSessionsErrors other = (GetSessionsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSessionsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSessionsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSessionsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSessionsErrors { this.status = status; return this; } - + public GetSessionsErrors build() { + return new GetSessionsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsSessionsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsSessionsErrors.java index 1e26ab46..b791d8a5 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsSessionsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsSessionsErrors.java @@ -12,19 +12,21 @@ 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 GetSessionsSessionsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSessionsSessionsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsSessionsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSessionsSessionsErrors { return this; } + public GetSessionsSessionsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSessionsSessionsErrors { return this; } + public GetSessionsSessionsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSessionsSessionsErrors { return this; } + public GetSessionsSessionsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSessionsSessionsErrors { } GetSessionsSessionsErrors other = (GetSessionsSessionsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSessionsSessionsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSessionsSessionsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSessionsSessionsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSessionsSessionsErrors { this.status = status; return this; } - + public GetSessionsSessionsErrors build() { + return new GetSessionsSessionsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsUnauthorized.java index f04a3ce0..b7e2e304 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSessionsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSessionsUnauthorized extends RuntimeException { public GetSessionsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSessionsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSessionsUnauthorized extends RuntimeException { return this; } + public GetSessionsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSessionsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSessionsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSessionsUnauthorized extends RuntimeException { } GetSessionsUnauthorized other = (GetSessionsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSessionsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSessionsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSessionsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSessionsUnauthorized build() { + return new GetSessionsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationAuthenticationErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationAuthenticationErrors.java index 88577381..2dcae766 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationAuthenticationErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationAuthenticationErrors.java @@ -12,19 +12,21 @@ 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 GetSourceConnectionInformationAuthenticationErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSourceConnectionInformationAuthenticationErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSourceConnectionInformationAuthenticationErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSourceConnectionInformationAuthenticationErrors { return this; } + public GetSourceConnectionInformationAuthenticationErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSourceConnectionInformationAuthenticationErrors { return this; } + public GetSourceConnectionInformationAuthenticationErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSourceConnectionInformationAuthenticationErrors { return this; } + public GetSourceConnectionInformationAuthenticationErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSourceConnectionInformationAuthenticationErrors { } GetSourceConnectionInformationAuthenticationErrors other = (GetSourceConnectionInformationAuthenticationErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSourceConnectionInformationAuthenticationErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSourceConnectionInformationAuthenticationErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSourceConnectionInformationAuthenticationErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSourceConnectionInformationAuthenticationErrors { this.status = status; return this; } - + public GetSourceConnectionInformationAuthenticationErrors build() { + return new GetSourceConnectionInformationAuthenticationErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationBadRequest.java index 644d5468..87e5e7ee 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { public GetSourceConnectionInformationBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSourceConnectionInformationBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { return this; } + public GetSourceConnectionInformationBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { } GetSourceConnectionInformationBadRequest other = (GetSourceConnectionInformationBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSourceConnectionInformationBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetSourceConnectionInformationBadRequest build() { + return new GetSourceConnectionInformationBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationErrors.java index f1885353..89577330 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationErrors.java @@ -12,19 +12,21 @@ 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 GetSourceConnectionInformationErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetSourceConnectionInformationErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSourceConnectionInformationErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetSourceConnectionInformationErrors { return this; } + public GetSourceConnectionInformationErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetSourceConnectionInformationErrors { return this; } + public GetSourceConnectionInformationErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetSourceConnectionInformationErrors { return this; } + public GetSourceConnectionInformationErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetSourceConnectionInformationErrors { } GetSourceConnectionInformationErrors other = (GetSourceConnectionInformationErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetSourceConnectionInformationErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetSourceConnectionInformationErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetSourceConnectionInformationErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetSourceConnectionInformationErrors { this.status = status; return this; } - + public GetSourceConnectionInformationErrors build() { + return new GetSourceConnectionInformationErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationUnauthorized.java index 81cc8e79..0781eb0e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetSourceConnectionInformationUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException public GetSourceConnectionInformationUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSourceConnectionInformationUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException return this; } + public GetSourceConnectionInformationUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException } GetSourceConnectionInformationUnauthorized other = (GetSourceConnectionInformationUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetSourceConnectionInformationUnauthorized extends RuntimeException this.rawResponse = rawResponse; return this; } - + public GetSourceConnectionInformationUnauthorized build() { + return new GetSourceConnectionInformationUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsBadRequest.java index 1c233cec..20ce3e7d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetStatisticsBadRequest extends RuntimeException { public GetStatisticsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetStatisticsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetStatisticsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetStatisticsBadRequest extends RuntimeException { return this; } + public GetStatisticsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetStatisticsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetStatisticsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetStatisticsBadRequest extends RuntimeException { } GetStatisticsBadRequest other = (GetStatisticsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetStatisticsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetStatisticsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetStatisticsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetStatisticsBadRequest build() { + return new GetStatisticsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsErrors.java index 918b7080..46010076 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsErrors.java @@ -12,19 +12,21 @@ 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 GetStatisticsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetStatisticsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetStatisticsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetStatisticsErrors { return this; } + public GetStatisticsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetStatisticsErrors { return this; } + public GetStatisticsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetStatisticsErrors { return this; } + public GetStatisticsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetStatisticsErrors { } GetStatisticsErrors other = (GetStatisticsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetStatisticsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetStatisticsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetStatisticsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetStatisticsErrors { this.status = status; return this; } - + public GetStatisticsErrors build() { + return new GetStatisticsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsStatisticsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsStatisticsErrors.java index 22a49fd6..ea52939d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsStatisticsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsStatisticsErrors.java @@ -12,19 +12,21 @@ 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 GetStatisticsStatisticsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetStatisticsStatisticsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetStatisticsStatisticsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetStatisticsStatisticsErrors { return this; } + public GetStatisticsStatisticsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetStatisticsStatisticsErrors { return this; } + public GetStatisticsStatisticsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetStatisticsStatisticsErrors { return this; } + public GetStatisticsStatisticsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetStatisticsStatisticsErrors { } GetStatisticsStatisticsErrors other = (GetStatisticsStatisticsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetStatisticsStatisticsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetStatisticsStatisticsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetStatisticsStatisticsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetStatisticsStatisticsErrors { this.status = status; return this; } - + public GetStatisticsStatisticsErrors build() { + return new GetStatisticsStatisticsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsUnauthorized.java index 7c488e28..9924704c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetStatisticsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetStatisticsUnauthorized extends RuntimeException { public GetStatisticsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetStatisticsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetStatisticsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetStatisticsUnauthorized extends RuntimeException { return this; } + public GetStatisticsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetStatisticsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetStatisticsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetStatisticsUnauthorized extends RuntimeException { } GetStatisticsUnauthorized other = (GetStatisticsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetStatisticsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetStatisticsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetStatisticsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetStatisticsUnauthorized build() { + return new GetStatisticsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageBadRequest.java index ec1d9148..95aaaeec 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetThumbImageBadRequest extends RuntimeException { public GetThumbImageBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetThumbImageBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetThumbImageBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetThumbImageBadRequest extends RuntimeException { return this; } + public GetThumbImageBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetThumbImageBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetThumbImageBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetThumbImageBadRequest extends RuntimeException { } GetThumbImageBadRequest other = (GetThumbImageBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetThumbImageBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetThumbImageBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetThumbImageBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetThumbImageBadRequest build() { + return new GetThumbImageBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageErrors.java index 559c002c..a21b3b5a 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageErrors.java @@ -12,19 +12,21 @@ 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 GetThumbImageErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetThumbImageErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetThumbImageErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetThumbImageErrors { return this; } + public GetThumbImageErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetThumbImageErrors { return this; } + public GetThumbImageErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetThumbImageErrors { return this; } + public GetThumbImageErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetThumbImageErrors { } GetThumbImageErrors other = (GetThumbImageErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetThumbImageErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetThumbImageErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetThumbImageErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetThumbImageErrors { this.status = status; return this; } - + public GetThumbImageErrors build() { + return new GetThumbImageErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageMediaErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageMediaErrors.java index 667a3a28..d8a172be 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageMediaErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageMediaErrors.java @@ -12,19 +12,21 @@ 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 GetThumbImageMediaErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetThumbImageMediaErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetThumbImageMediaErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetThumbImageMediaErrors { return this; } + public GetThumbImageMediaErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetThumbImageMediaErrors { return this; } + public GetThumbImageMediaErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetThumbImageMediaErrors { return this; } + public GetThumbImageMediaErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetThumbImageMediaErrors { } GetThumbImageMediaErrors other = (GetThumbImageMediaErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetThumbImageMediaErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetThumbImageMediaErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetThumbImageMediaErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetThumbImageMediaErrors { this.status = status; return this; } - + public GetThumbImageMediaErrors build() { + return new GetThumbImageMediaErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageUnauthorized.java index c8b3d647..e05a3d92 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetThumbImageUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetThumbImageUnauthorized extends RuntimeException { public GetThumbImageUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetThumbImageUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetThumbImageUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetThumbImageUnauthorized extends RuntimeException { return this; } + public GetThumbImageUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetThumbImageUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetThumbImageUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetThumbImageUnauthorized extends RuntimeException { } GetThumbImageUnauthorized other = (GetThumbImageUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetThumbImageUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetThumbImageUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetThumbImageUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetThumbImageUnauthorized build() { + return new GetThumbImageUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineBadRequest.java index 086c9687..c25913fa 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTimelineBadRequest extends RuntimeException { public GetTimelineBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTimelineBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTimelineBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTimelineBadRequest extends RuntimeException { return this; } + public GetTimelineBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTimelineBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTimelineBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTimelineBadRequest extends RuntimeException { } GetTimelineBadRequest other = (GetTimelineBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTimelineBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTimelineBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTimelineBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTimelineBadRequest build() { + return new GetTimelineBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineErrors.java index e73244b3..45c9630a 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineErrors.java @@ -12,19 +12,21 @@ 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 GetTimelineErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTimelineErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTimelineErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTimelineErrors { return this; } + public GetTimelineErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTimelineErrors { return this; } + public GetTimelineErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTimelineErrors { return this; } + public GetTimelineErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTimelineErrors { } GetTimelineErrors other = (GetTimelineErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTimelineErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTimelineErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTimelineErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTimelineErrors { this.status = status; return this; } - + public GetTimelineErrors build() { + return new GetTimelineErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineUnauthorized.java index 974c074d..422f8dab 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTimelineUnauthorized extends RuntimeException { public GetTimelineUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTimelineUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTimelineUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTimelineUnauthorized extends RuntimeException { return this; } + public GetTimelineUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTimelineUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTimelineUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTimelineUnauthorized extends RuntimeException { } GetTimelineUnauthorized other = (GetTimelineUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTimelineUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTimelineUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTimelineUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTimelineUnauthorized build() { + return new GetTimelineUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineVideoErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineVideoErrors.java index 77917f57..be1c8559 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineVideoErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTimelineVideoErrors.java @@ -12,19 +12,21 @@ 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 GetTimelineVideoErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTimelineVideoErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTimelineVideoErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTimelineVideoErrors { return this; } + public GetTimelineVideoErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTimelineVideoErrors { return this; } + public GetTimelineVideoErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTimelineVideoErrors { return this; } + public GetTimelineVideoErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTimelineVideoErrors { } GetTimelineVideoErrors other = (GetTimelineVideoErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTimelineVideoErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTimelineVideoErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTimelineVideoErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTimelineVideoErrors { this.status = status; return this; } - + public GetTimelineVideoErrors build() { + return new GetTimelineVideoErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdBadRequest.java index 79f6bd07..5d934cbd 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { public GetTokenByPinIdBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenByPinIdBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { return this; } + public GetTokenByPinIdBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { } GetTokenByPinIdBadRequest other = (GetTokenByPinIdBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTokenByPinIdBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTokenByPinIdBadRequest build() { + return new GetTokenByPinIdBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdErrors.java index e5d64940..c5893bbf 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdErrors.java @@ -12,19 +12,21 @@ 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 GetTokenByPinIdErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTokenByPinIdErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenByPinIdErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTokenByPinIdErrors { return this; } + public GetTokenByPinIdErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTokenByPinIdErrors { return this; } + public GetTokenByPinIdErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTokenByPinIdErrors { return this; } + public GetTokenByPinIdErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTokenByPinIdErrors { } GetTokenByPinIdErrors other = (GetTokenByPinIdErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTokenByPinIdErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTokenByPinIdErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTokenByPinIdErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTokenByPinIdErrors { this.status = status; return this; } - + public GetTokenByPinIdErrors build() { + return new GetTokenByPinIdErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdPlexErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdPlexErrors.java index cc12054c..f10a04ad 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdPlexErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdPlexErrors.java @@ -12,15 +12,16 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetTokenByPinIdPlexErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; @@ -49,9 +50,10 @@ public class GetTokenByPinIdPlexErrors { return message; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenByPinIdPlexErrors withCode(long code) { Utils.checkNotNull(code, "code"); @@ -59,6 +61,7 @@ public class GetTokenByPinIdPlexErrors { return this; } + public GetTokenByPinIdPlexErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -71,13 +74,13 @@ public class GetTokenByPinIdPlexErrors { return this; } + public GetTokenByPinIdPlexErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,15 +91,14 @@ public class GetTokenByPinIdPlexErrors { } GetTokenByPinIdPlexErrors other = (GetTokenByPinIdPlexErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message); } @Override public int hashCode() { - return Objects.hash( - code, - message); + return Utils.enhancedHash( + code, message); } @Override @@ -105,17 +107,19 @@ public class GetTokenByPinIdPlexErrors { "code", code, "message", message); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(long code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -128,6 +132,7 @@ public class GetTokenByPinIdPlexErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -139,11 +144,12 @@ public class GetTokenByPinIdPlexErrors { this.message = message; return this; } - + public GetTokenByPinIdPlexErrors build() { + return new GetTokenByPinIdPlexErrors( - code, - message); + code, message); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdResponseBody.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdResponseBody.java index bf6d202b..77192a55 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenByPinIdResponseBody.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { public GetTokenByPinIdResponseBody( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenByPinIdResponseBody withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { return this; } + public GetTokenByPinIdResponseBody withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { } GetTokenByPinIdResponseBody other = (GetTokenByPinIdResponseBody) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTokenByPinIdResponseBody extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTokenByPinIdResponseBody build() { + return new GetTokenByPinIdResponseBody( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsAuthenticationErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsAuthenticationErrors.java index da00d2c6..852a8326 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsAuthenticationErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsAuthenticationErrors.java @@ -12,19 +12,21 @@ 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 GetTokenDetailsAuthenticationErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTokenDetailsAuthenticationErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenDetailsAuthenticationErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTokenDetailsAuthenticationErrors { return this; } + public GetTokenDetailsAuthenticationErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTokenDetailsAuthenticationErrors { return this; } + public GetTokenDetailsAuthenticationErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTokenDetailsAuthenticationErrors { return this; } + public GetTokenDetailsAuthenticationErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTokenDetailsAuthenticationErrors { } GetTokenDetailsAuthenticationErrors other = (GetTokenDetailsAuthenticationErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTokenDetailsAuthenticationErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTokenDetailsAuthenticationErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTokenDetailsAuthenticationErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTokenDetailsAuthenticationErrors { this.status = status; return this; } - + public GetTokenDetailsAuthenticationErrors build() { + return new GetTokenDetailsAuthenticationErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsBadRequest.java index 407d4495..32ae5eb6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTokenDetailsBadRequest extends RuntimeException { public GetTokenDetailsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTokenDetailsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenDetailsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTokenDetailsBadRequest extends RuntimeException { return this; } + public GetTokenDetailsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTokenDetailsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTokenDetailsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTokenDetailsBadRequest extends RuntimeException { } GetTokenDetailsBadRequest other = (GetTokenDetailsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTokenDetailsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTokenDetailsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTokenDetailsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTokenDetailsBadRequest build() { + return new GetTokenDetailsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsErrors.java index 56b5c440..e6d7315b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsErrors.java @@ -12,19 +12,21 @@ 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 GetTokenDetailsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTokenDetailsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenDetailsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTokenDetailsErrors { return this; } + public GetTokenDetailsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTokenDetailsErrors { return this; } + public GetTokenDetailsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTokenDetailsErrors { return this; } + public GetTokenDetailsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTokenDetailsErrors { } GetTokenDetailsErrors other = (GetTokenDetailsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTokenDetailsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTokenDetailsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTokenDetailsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTokenDetailsErrors { this.status = status; return this; } - + public GetTokenDetailsErrors build() { + return new GetTokenDetailsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsUnauthorized.java index e2b471c1..99b24e52 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTokenDetailsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { public GetTokenDetailsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenDetailsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { return this; } + public GetTokenDetailsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { } GetTokenDetailsUnauthorized other = (GetTokenDetailsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTokenDetailsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTokenDetailsUnauthorized build() { + return new GetTokenDetailsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentBadRequest.java index be58eb2a..43ec00bc 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { public GetTopWatchedContentBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { return this; } + public GetTopWatchedContentBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { } GetTopWatchedContentBadRequest other = (GetTopWatchedContentBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTopWatchedContentBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTopWatchedContentBadRequest build() { + return new GetTopWatchedContentBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentErrors.java index 1519f049..4b519a01 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentErrors.java @@ -12,19 +12,21 @@ 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 GetTopWatchedContentErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTopWatchedContentErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTopWatchedContentErrors { return this; } + public GetTopWatchedContentErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTopWatchedContentErrors { return this; } + public GetTopWatchedContentErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTopWatchedContentErrors { return this; } + public GetTopWatchedContentErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTopWatchedContentErrors { } GetTopWatchedContentErrors other = (GetTopWatchedContentErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTopWatchedContentErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTopWatchedContentErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTopWatchedContentErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTopWatchedContentErrors { this.status = status; return this; } - + public GetTopWatchedContentErrors build() { + return new GetTopWatchedContentErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentLibraryErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentLibraryErrors.java index c86e4f30..70469bd7 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentLibraryErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentLibraryErrors.java @@ -12,19 +12,21 @@ 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 GetTopWatchedContentLibraryErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTopWatchedContentLibraryErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentLibraryErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTopWatchedContentLibraryErrors { return this; } + public GetTopWatchedContentLibraryErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTopWatchedContentLibraryErrors { return this; } + public GetTopWatchedContentLibraryErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTopWatchedContentLibraryErrors { return this; } + public GetTopWatchedContentLibraryErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTopWatchedContentLibraryErrors { } GetTopWatchedContentLibraryErrors other = (GetTopWatchedContentLibraryErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTopWatchedContentLibraryErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTopWatchedContentLibraryErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTopWatchedContentLibraryErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTopWatchedContentLibraryErrors { this.status = status; return this; } - + public GetTopWatchedContentLibraryErrors build() { + return new GetTopWatchedContentLibraryErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentUnauthorized.java index 3fbf7da3..2015670e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTopWatchedContentUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { public GetTopWatchedContentUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { return this; } + public GetTopWatchedContentUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { } GetTopWatchedContentUnauthorized other = (GetTopWatchedContentUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTopWatchedContentUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTopWatchedContentUnauthorized build() { + return new GetTopWatchedContentUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsBadRequest.java index ed5b7e10..59fc1388 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { public GetTranscodeSessionsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTranscodeSessionsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { return this; } + public GetTranscodeSessionsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { } GetTranscodeSessionsBadRequest other = (GetTranscodeSessionsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTranscodeSessionsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTranscodeSessionsBadRequest build() { + return new GetTranscodeSessionsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsErrors.java index d86be46f..73de9db2 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsErrors.java @@ -12,19 +12,21 @@ 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 GetTranscodeSessionsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTranscodeSessionsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTranscodeSessionsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTranscodeSessionsErrors { return this; } + public GetTranscodeSessionsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTranscodeSessionsErrors { return this; } + public GetTranscodeSessionsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTranscodeSessionsErrors { return this; } + public GetTranscodeSessionsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTranscodeSessionsErrors { } GetTranscodeSessionsErrors other = (GetTranscodeSessionsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTranscodeSessionsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTranscodeSessionsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTranscodeSessionsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTranscodeSessionsErrors { this.status = status; return this; } - + public GetTranscodeSessionsErrors build() { + return new GetTranscodeSessionsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsSessionsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsSessionsErrors.java index d5a7e53d..c276d439 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsSessionsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsSessionsErrors.java @@ -12,19 +12,21 @@ 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 GetTranscodeSessionsSessionsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTranscodeSessionsSessionsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTranscodeSessionsSessionsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTranscodeSessionsSessionsErrors { return this; } + public GetTranscodeSessionsSessionsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTranscodeSessionsSessionsErrors { return this; } + public GetTranscodeSessionsSessionsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTranscodeSessionsSessionsErrors { return this; } + public GetTranscodeSessionsSessionsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTranscodeSessionsSessionsErrors { } GetTranscodeSessionsSessionsErrors other = (GetTranscodeSessionsSessionsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTranscodeSessionsSessionsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTranscodeSessionsSessionsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTranscodeSessionsSessionsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTranscodeSessionsSessionsErrors { this.status = status; return this; } - + public GetTranscodeSessionsSessionsErrors build() { + return new GetTranscodeSessionsSessionsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsUnauthorized.java index ec4dde73..c962fec2 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTranscodeSessionsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { public GetTranscodeSessionsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTranscodeSessionsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { return this; } + public GetTranscodeSessionsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { } GetTranscodeSessionsUnauthorized other = (GetTranscodeSessionsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTranscodeSessionsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTranscodeSessionsUnauthorized build() { + return new GetTranscodeSessionsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenAuthenticationErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenAuthenticationErrors.java index 526f1adf..20e7b31d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenAuthenticationErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenAuthenticationErrors.java @@ -12,19 +12,21 @@ 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 GetTransientTokenAuthenticationErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTransientTokenAuthenticationErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTransientTokenAuthenticationErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTransientTokenAuthenticationErrors { return this; } + public GetTransientTokenAuthenticationErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTransientTokenAuthenticationErrors { return this; } + public GetTransientTokenAuthenticationErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTransientTokenAuthenticationErrors { return this; } + public GetTransientTokenAuthenticationErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTransientTokenAuthenticationErrors { } GetTransientTokenAuthenticationErrors other = (GetTransientTokenAuthenticationErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTransientTokenAuthenticationErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTransientTokenAuthenticationErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTransientTokenAuthenticationErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTransientTokenAuthenticationErrors { this.status = status; return this; } - + public GetTransientTokenAuthenticationErrors build() { + return new GetTransientTokenAuthenticationErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenBadRequest.java index 3bc9ff6d..42f11abc 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTransientTokenBadRequest extends RuntimeException { public GetTransientTokenBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTransientTokenBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTransientTokenBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTransientTokenBadRequest extends RuntimeException { return this; } + public GetTransientTokenBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTransientTokenBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTransientTokenBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTransientTokenBadRequest extends RuntimeException { } GetTransientTokenBadRequest other = (GetTransientTokenBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTransientTokenBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTransientTokenBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTransientTokenBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTransientTokenBadRequest build() { + return new GetTransientTokenBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenErrors.java index 6804a0da..b4cd149c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenErrors.java @@ -12,19 +12,21 @@ 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 GetTransientTokenErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetTransientTokenErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTransientTokenErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetTransientTokenErrors { return this; } + public GetTransientTokenErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetTransientTokenErrors { return this; } + public GetTransientTokenErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetTransientTokenErrors { return this; } + public GetTransientTokenErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTransientTokenErrors { } GetTransientTokenErrors other = (GetTransientTokenErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetTransientTokenErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetTransientTokenErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetTransientTokenErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetTransientTokenErrors { this.status = status; return this; } - + public GetTransientTokenErrors build() { + return new GetTransientTokenErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenUnauthorized.java index 880343c2..0cb5ad96 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetTransientTokenUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetTransientTokenUnauthorized extends RuntimeException { public GetTransientTokenUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetTransientTokenUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTransientTokenUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetTransientTokenUnauthorized extends RuntimeException { return this; } + public GetTransientTokenUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetTransientTokenUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetTransientTokenUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetTransientTokenUnauthorized extends RuntimeException { } GetTransientTokenUnauthorized other = (GetTransientTokenUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetTransientTokenUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetTransientTokenUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetTransientTokenUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetTransientTokenUnauthorized build() { + return new GetTransientTokenUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusBadRequest.java index e3951565..2224093f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetUpdateStatusBadRequest extends RuntimeException { public GetUpdateStatusBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetUpdateStatusBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUpdateStatusBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetUpdateStatusBadRequest extends RuntimeException { return this; } + public GetUpdateStatusBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetUpdateStatusBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetUpdateStatusBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetUpdateStatusBadRequest extends RuntimeException { } GetUpdateStatusBadRequest other = (GetUpdateStatusBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetUpdateStatusBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetUpdateStatusBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetUpdateStatusBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetUpdateStatusBadRequest build() { + return new GetUpdateStatusBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusErrors.java index 842e03e5..9eb47250 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusErrors.java @@ -12,19 +12,21 @@ 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 GetUpdateStatusErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetUpdateStatusErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUpdateStatusErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetUpdateStatusErrors { return this; } + public GetUpdateStatusErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetUpdateStatusErrors { return this; } + public GetUpdateStatusErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetUpdateStatusErrors { return this; } + public GetUpdateStatusErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetUpdateStatusErrors { } GetUpdateStatusErrors other = (GetUpdateStatusErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetUpdateStatusErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetUpdateStatusErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetUpdateStatusErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetUpdateStatusErrors { this.status = status; return this; } - + public GetUpdateStatusErrors build() { + return new GetUpdateStatusErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusUnauthorized.java index 3d555a22..db84e0ec 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { public GetUpdateStatusUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUpdateStatusUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { return this; } + public GetUpdateStatusUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { } GetUpdateStatusUnauthorized other = (GetUpdateStatusUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetUpdateStatusUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetUpdateStatusUnauthorized build() { + return new GetUpdateStatusUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusUpdaterErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusUpdaterErrors.java index 4d5c6f31..d0d2cd11 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusUpdaterErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUpdateStatusUpdaterErrors.java @@ -12,19 +12,21 @@ 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 GetUpdateStatusUpdaterErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetUpdateStatusUpdaterErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUpdateStatusUpdaterErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetUpdateStatusUpdaterErrors { return this; } + public GetUpdateStatusUpdaterErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetUpdateStatusUpdaterErrors { return this; } + public GetUpdateStatusUpdaterErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetUpdateStatusUpdaterErrors { return this; } + public GetUpdateStatusUpdaterErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetUpdateStatusUpdaterErrors { } GetUpdateStatusUpdaterErrors other = (GetUpdateStatusUpdaterErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetUpdateStatusUpdaterErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetUpdateStatusUpdaterErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetUpdateStatusUpdaterErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetUpdateStatusUpdaterErrors { this.status = status; return this; } - + public GetUpdateStatusUpdaterErrors build() { + return new GetUpdateStatusUpdaterErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsBadRequest.java index 5c0073eb..87545485 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetUserFriendsBadRequest extends RuntimeException { public GetUserFriendsBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetUserFriendsBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUserFriendsBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetUserFriendsBadRequest extends RuntimeException { return this; } + public GetUserFriendsBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetUserFriendsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetUserFriendsBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetUserFriendsBadRequest extends RuntimeException { } GetUserFriendsBadRequest other = (GetUserFriendsBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetUserFriendsBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetUserFriendsBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetUserFriendsBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetUserFriendsBadRequest build() { + return new GetUserFriendsBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsErrors.java index 2b1069b3..e197e0bb 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsErrors.java @@ -12,19 +12,21 @@ 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 GetUserFriendsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetUserFriendsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUserFriendsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetUserFriendsErrors { return this; } + public GetUserFriendsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetUserFriendsErrors { return this; } + public GetUserFriendsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetUserFriendsErrors { return this; } + public GetUserFriendsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetUserFriendsErrors { } GetUserFriendsErrors other = (GetUserFriendsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetUserFriendsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetUserFriendsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetUserFriendsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetUserFriendsErrors { this.status = status; return this; } - + public GetUserFriendsErrors build() { + return new GetUserFriendsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsPlexErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsPlexErrors.java index ae8dd3de..42f1581d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsPlexErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsPlexErrors.java @@ -12,19 +12,21 @@ 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 GetUserFriendsPlexErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetUserFriendsPlexErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUserFriendsPlexErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetUserFriendsPlexErrors { return this; } + public GetUserFriendsPlexErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetUserFriendsPlexErrors { return this; } + public GetUserFriendsPlexErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetUserFriendsPlexErrors { return this; } + public GetUserFriendsPlexErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetUserFriendsPlexErrors { } GetUserFriendsPlexErrors other = (GetUserFriendsPlexErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetUserFriendsPlexErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetUserFriendsPlexErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetUserFriendsPlexErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetUserFriendsPlexErrors { this.status = status; return this; } - + public GetUserFriendsPlexErrors build() { + return new GetUserFriendsPlexErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsUnauthorized.java index afec13c6..465a293f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUserFriendsUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetUserFriendsUnauthorized extends RuntimeException { public GetUserFriendsUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetUserFriendsUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUserFriendsUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetUserFriendsUnauthorized extends RuntimeException { return this; } + public GetUserFriendsUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetUserFriendsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetUserFriendsUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetUserFriendsUnauthorized extends RuntimeException { } GetUserFriendsUnauthorized other = (GetUserFriendsUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetUserFriendsUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetUserFriendsUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetUserFriendsUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetUserFriendsUnauthorized build() { + return new GetUserFriendsUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUsersBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUsersBadRequest.java index 22f9ea18..779c9445 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUsersBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUsersBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetUsersBadRequest extends RuntimeException { public GetUsersBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetUsersBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUsersBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetUsersBadRequest extends RuntimeException { return this; } + public GetUsersBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetUsersBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetUsersBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetUsersBadRequest extends RuntimeException { } GetUsersBadRequest other = (GetUsersBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetUsersBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetUsersBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetUsersBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetUsersBadRequest build() { + return new GetUsersBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUsersErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUsersErrors.java index 3cc0c2c6..000c5a00 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUsersErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUsersErrors.java @@ -12,19 +12,21 @@ 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 GetUsersErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetUsersErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUsersErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetUsersErrors { return this; } + public GetUsersErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetUsersErrors { return this; } + public GetUsersErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetUsersErrors { return this; } + public GetUsersErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetUsersErrors { } GetUsersErrors other = (GetUsersErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetUsersErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetUsersErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetUsersErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetUsersErrors { this.status = status; return this; } - + public GetUsersErrors build() { + return new GetUsersErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUsersUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUsersUnauthorized.java index 00b80a2b..4c6188be 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUsersUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUsersUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetUsersUnauthorized extends RuntimeException { public GetUsersUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetUsersUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUsersUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetUsersUnauthorized extends RuntimeException { return this; } + public GetUsersUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetUsersUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetUsersUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetUsersUnauthorized extends RuntimeException { } GetUsersUnauthorized other = (GetUsersUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetUsersUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetUsersUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetUsersUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetUsersUnauthorized build() { + return new GetUsersUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetUsersUsersErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetUsersUsersErrors.java index 2fe32316..dcce047e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetUsersUsersErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetUsersUsersErrors.java @@ -12,19 +12,21 @@ 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 GetUsersUsersErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetUsersUsersErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUsersUsersErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetUsersUsersErrors { return this; } + public GetUsersUsersErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetUsersUsersErrors { return this; } + public GetUsersUsersErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetUsersUsersErrors { return this; } + public GetUsersUsersErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetUsersUsersErrors { } GetUsersUsersErrors other = (GetUsersUsersErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetUsersUsersErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetUsersUsersErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetUsersUsersErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetUsersUsersErrors { this.status = status; return this; } - + public GetUsersUsersErrors build() { + return new GetUsersUsersErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListBadRequest.java index a573972b..25d64ba6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetWatchListBadRequest extends RuntimeException { public GetWatchListBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetWatchListBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetWatchListBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetWatchListBadRequest extends RuntimeException { return this; } + public GetWatchListBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetWatchListBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetWatchListBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetWatchListBadRequest extends RuntimeException { } GetWatchListBadRequest other = (GetWatchListBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetWatchListBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetWatchListBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetWatchListBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetWatchListBadRequest build() { + return new GetWatchListBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListErrors.java index df8be00e..3e94d7d7 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListErrors.java @@ -12,19 +12,21 @@ 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 GetWatchListErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetWatchListErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetWatchListErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetWatchListErrors { return this; } + public GetWatchListErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetWatchListErrors { return this; } + public GetWatchListErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetWatchListErrors { return this; } + public GetWatchListErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetWatchListErrors { } GetWatchListErrors other = (GetWatchListErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetWatchListErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetWatchListErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetWatchListErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetWatchListErrors { this.status = status; return this; } - + public GetWatchListErrors build() { + return new GetWatchListErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListUnauthorized.java index 74c65882..f60fe2ed 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class GetWatchListUnauthorized extends RuntimeException { public GetWatchListUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class GetWatchListUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetWatchListUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class GetWatchListUnauthorized extends RuntimeException { return this; } + public GetWatchListUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class GetWatchListUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class GetWatchListUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class GetWatchListUnauthorized extends RuntimeException { } GetWatchListUnauthorized other = (GetWatchListUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class GetWatchListUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class GetWatchListUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class GetWatchListUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public GetWatchListUnauthorized build() { + return new GetWatchListUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListWatchlistErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListWatchlistErrors.java index b5c39d41..3479d130 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListWatchlistErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/GetWatchListWatchlistErrors.java @@ -12,19 +12,21 @@ 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 GetWatchListWatchlistErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class GetWatchListWatchlistErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetWatchListWatchlistErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class GetWatchListWatchlistErrors { return this; } + public GetWatchListWatchlistErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class GetWatchListWatchlistErrors { return this; } + public GetWatchListWatchlistErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class GetWatchListWatchlistErrors { return this; } + public GetWatchListWatchlistErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetWatchListWatchlistErrors { } GetWatchListWatchlistErrors other = (GetWatchListWatchlistErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class GetWatchListWatchlistErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class GetWatchListWatchlistErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class GetWatchListWatchlistErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class GetWatchListWatchlistErrors { this.status = status; return this; } - + public GetWatchListWatchlistErrors build() { + return new GetWatchListWatchlistErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/LogLineBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/LogLineBadRequest.java index 43cf7f68..4355191b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/LogLineBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/LogLineBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class LogLineBadRequest extends RuntimeException { public LogLineBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class LogLineBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public LogLineBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class LogLineBadRequest extends RuntimeException { return this; } + public LogLineBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class LogLineBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class LogLineBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class LogLineBadRequest extends RuntimeException { } LogLineBadRequest other = (LogLineBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class LogLineBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class LogLineBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class LogLineBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public LogLineBadRequest build() { + return new LogLineBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/LogLineErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/LogLineErrors.java index 43a7d17c..4c1f6970 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/LogLineErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/LogLineErrors.java @@ -12,19 +12,21 @@ 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 LogLineErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class LogLineErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public LogLineErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class LogLineErrors { return this; } + public LogLineErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class LogLineErrors { return this; } + public LogLineErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class LogLineErrors { return this; } + public LogLineErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class LogLineErrors { } LogLineErrors other = (LogLineErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class LogLineErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class LogLineErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class LogLineErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class LogLineErrors { this.status = status; return this; } - + public LogLineErrors build() { + return new LogLineErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/LogLineLogErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/LogLineLogErrors.java index 4210d5f2..bec5f571 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/LogLineLogErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/LogLineLogErrors.java @@ -12,19 +12,21 @@ 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 LogLineLogErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class LogLineLogErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public LogLineLogErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class LogLineLogErrors { return this; } + public LogLineLogErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class LogLineLogErrors { return this; } + public LogLineLogErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class LogLineLogErrors { return this; } + public LogLineLogErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class LogLineLogErrors { } LogLineLogErrors other = (LogLineLogErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class LogLineLogErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class LogLineLogErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class LogLineLogErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class LogLineLogErrors { this.status = status; return this; } - + public LogLineLogErrors build() { + return new LogLineLogErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/LogLineUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/LogLineUnauthorized.java index dc22a528..c506c71b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/LogLineUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/LogLineUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class LogLineUnauthorized extends RuntimeException { public LogLineUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class LogLineUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public LogLineUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class LogLineUnauthorized extends RuntimeException { return this; } + public LogLineUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class LogLineUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class LogLineUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class LogLineUnauthorized extends RuntimeException { } LogLineUnauthorized other = (LogLineUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class LogLineUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class LogLineUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class LogLineUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public LogLineUnauthorized build() { + return new LogLineUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineBadRequest.java index 882d50f8..c5337e11 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class LogMultiLineBadRequest extends RuntimeException { public LogMultiLineBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class LogMultiLineBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public LogMultiLineBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class LogMultiLineBadRequest extends RuntimeException { return this; } + public LogMultiLineBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class LogMultiLineBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class LogMultiLineBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class LogMultiLineBadRequest extends RuntimeException { } LogMultiLineBadRequest other = (LogMultiLineBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class LogMultiLineBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class LogMultiLineBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class LogMultiLineBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public LogMultiLineBadRequest build() { + return new LogMultiLineBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineErrors.java index 5e98023e..cebd9538 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineErrors.java @@ -12,19 +12,21 @@ 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 LogMultiLineErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class LogMultiLineErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public LogMultiLineErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class LogMultiLineErrors { return this; } + public LogMultiLineErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class LogMultiLineErrors { return this; } + public LogMultiLineErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class LogMultiLineErrors { return this; } + public LogMultiLineErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class LogMultiLineErrors { } LogMultiLineErrors other = (LogMultiLineErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class LogMultiLineErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class LogMultiLineErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class LogMultiLineErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class LogMultiLineErrors { this.status = status; return this; } - + public LogMultiLineErrors build() { + return new LogMultiLineErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineLogErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineLogErrors.java index c4ecb391..20122b87 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineLogErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineLogErrors.java @@ -12,19 +12,21 @@ 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 LogMultiLineLogErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class LogMultiLineLogErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public LogMultiLineLogErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class LogMultiLineLogErrors { return this; } + public LogMultiLineLogErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class LogMultiLineLogErrors { return this; } + public LogMultiLineLogErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class LogMultiLineLogErrors { return this; } + public LogMultiLineLogErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class LogMultiLineLogErrors { } LogMultiLineLogErrors other = (LogMultiLineLogErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class LogMultiLineLogErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class LogMultiLineLogErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class LogMultiLineLogErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class LogMultiLineLogErrors { this.status = status; return this; } - + public LogMultiLineLogErrors build() { + return new LogMultiLineLogErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineUnauthorized.java index 62ec940a..47cee054 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/LogMultiLineUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class LogMultiLineUnauthorized extends RuntimeException { public LogMultiLineUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class LogMultiLineUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public LogMultiLineUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class LogMultiLineUnauthorized extends RuntimeException { return this; } + public LogMultiLineUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class LogMultiLineUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class LogMultiLineUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class LogMultiLineUnauthorized extends RuntimeException { } LogMultiLineUnauthorized other = (LogMultiLineUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class LogMultiLineUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class LogMultiLineUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class LogMultiLineUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public LogMultiLineUnauthorized build() { + return new LogMultiLineUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedBadRequest.java index d1c2e654..d3ff3f17 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class MarkPlayedBadRequest extends RuntimeException { public MarkPlayedBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class MarkPlayedBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MarkPlayedBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class MarkPlayedBadRequest extends RuntimeException { return this; } + public MarkPlayedBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class MarkPlayedBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class MarkPlayedBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class MarkPlayedBadRequest extends RuntimeException { } MarkPlayedBadRequest other = (MarkPlayedBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class MarkPlayedBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class MarkPlayedBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class MarkPlayedBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public MarkPlayedBadRequest build() { + return new MarkPlayedBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedErrors.java index 9e02985d..bbe710c6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedErrors.java @@ -12,19 +12,21 @@ 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 MarkPlayedErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class MarkPlayedErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MarkPlayedErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class MarkPlayedErrors { return this; } + public MarkPlayedErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class MarkPlayedErrors { return this; } + public MarkPlayedErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class MarkPlayedErrors { return this; } + public MarkPlayedErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class MarkPlayedErrors { } MarkPlayedErrors other = (MarkPlayedErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class MarkPlayedErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class MarkPlayedErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class MarkPlayedErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class MarkPlayedErrors { this.status = status; return this; } - + public MarkPlayedErrors build() { + return new MarkPlayedErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedMediaErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedMediaErrors.java index 40f5183d..437a149c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedMediaErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedMediaErrors.java @@ -12,19 +12,21 @@ 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 MarkPlayedMediaErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class MarkPlayedMediaErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MarkPlayedMediaErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class MarkPlayedMediaErrors { return this; } + public MarkPlayedMediaErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class MarkPlayedMediaErrors { return this; } + public MarkPlayedMediaErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class MarkPlayedMediaErrors { return this; } + public MarkPlayedMediaErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class MarkPlayedMediaErrors { } MarkPlayedMediaErrors other = (MarkPlayedMediaErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class MarkPlayedMediaErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class MarkPlayedMediaErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class MarkPlayedMediaErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class MarkPlayedMediaErrors { this.status = status; return this; } - + public MarkPlayedMediaErrors build() { + return new MarkPlayedMediaErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedUnauthorized.java index 51e4826d..fc8fdee3 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/MarkPlayedUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class MarkPlayedUnauthorized extends RuntimeException { public MarkPlayedUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class MarkPlayedUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MarkPlayedUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class MarkPlayedUnauthorized extends RuntimeException { return this; } + public MarkPlayedUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class MarkPlayedUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class MarkPlayedUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class MarkPlayedUnauthorized extends RuntimeException { } MarkPlayedUnauthorized other = (MarkPlayedUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class MarkPlayedUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class MarkPlayedUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class MarkPlayedUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public MarkPlayedUnauthorized build() { + return new MarkPlayedUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedBadRequest.java index 38f9aab0..e6c5d73a 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class MarkUnplayedBadRequest extends RuntimeException { public MarkUnplayedBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class MarkUnplayedBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MarkUnplayedBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class MarkUnplayedBadRequest extends RuntimeException { return this; } + public MarkUnplayedBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class MarkUnplayedBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class MarkUnplayedBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class MarkUnplayedBadRequest extends RuntimeException { } MarkUnplayedBadRequest other = (MarkUnplayedBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class MarkUnplayedBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class MarkUnplayedBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class MarkUnplayedBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public MarkUnplayedBadRequest build() { + return new MarkUnplayedBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedErrors.java index 82ebfbbd..bfe0ac17 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedErrors.java @@ -12,19 +12,21 @@ 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 MarkUnplayedErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class MarkUnplayedErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MarkUnplayedErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class MarkUnplayedErrors { return this; } + public MarkUnplayedErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class MarkUnplayedErrors { return this; } + public MarkUnplayedErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class MarkUnplayedErrors { return this; } + public MarkUnplayedErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class MarkUnplayedErrors { } MarkUnplayedErrors other = (MarkUnplayedErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class MarkUnplayedErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class MarkUnplayedErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class MarkUnplayedErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class MarkUnplayedErrors { this.status = status; return this; } - + public MarkUnplayedErrors build() { + return new MarkUnplayedErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedMediaErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedMediaErrors.java index c968ccc4..2227b40d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedMediaErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedMediaErrors.java @@ -12,19 +12,21 @@ 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 MarkUnplayedMediaErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class MarkUnplayedMediaErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MarkUnplayedMediaErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class MarkUnplayedMediaErrors { return this; } + public MarkUnplayedMediaErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class MarkUnplayedMediaErrors { return this; } + public MarkUnplayedMediaErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class MarkUnplayedMediaErrors { return this; } + public MarkUnplayedMediaErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class MarkUnplayedMediaErrors { } MarkUnplayedMediaErrors other = (MarkUnplayedMediaErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class MarkUnplayedMediaErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class MarkUnplayedMediaErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class MarkUnplayedMediaErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class MarkUnplayedMediaErrors { this.status = status; return this; } - + public MarkUnplayedMediaErrors build() { + return new MarkUnplayedMediaErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedUnauthorized.java index 6e7bf28f..9a404384 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/MarkUnplayedUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class MarkUnplayedUnauthorized extends RuntimeException { public MarkUnplayedUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class MarkUnplayedUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MarkUnplayedUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class MarkUnplayedUnauthorized extends RuntimeException { return this; } + public MarkUnplayedUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class MarkUnplayedUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class MarkUnplayedUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class MarkUnplayedUnauthorized extends RuntimeException { } MarkUnplayedUnauthorized other = (MarkUnplayedUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class MarkUnplayedUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class MarkUnplayedUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class MarkUnplayedUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public MarkUnplayedUnauthorized build() { + return new MarkUnplayedUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchBadRequest.java index 8962fc60..a3b30263 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class PerformSearchBadRequest extends RuntimeException { public PerformSearchBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class PerformSearchBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PerformSearchBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class PerformSearchBadRequest extends RuntimeException { return this; } + public PerformSearchBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class PerformSearchBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class PerformSearchBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class PerformSearchBadRequest extends RuntimeException { } PerformSearchBadRequest other = (PerformSearchBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class PerformSearchBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class PerformSearchBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class PerformSearchBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public PerformSearchBadRequest build() { + return new PerformSearchBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchErrors.java index cb232fac..c2d9eb48 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchErrors.java @@ -12,19 +12,21 @@ 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 PerformSearchErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class PerformSearchErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PerformSearchErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class PerformSearchErrors { return this; } + public PerformSearchErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class PerformSearchErrors { return this; } + public PerformSearchErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class PerformSearchErrors { return this; } + public PerformSearchErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class PerformSearchErrors { } PerformSearchErrors other = (PerformSearchErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class PerformSearchErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class PerformSearchErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class PerformSearchErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class PerformSearchErrors { this.status = status; return this; } - + public PerformSearchErrors build() { + return new PerformSearchErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchSearchErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchSearchErrors.java index 2096b4f3..5848b015 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchSearchErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchSearchErrors.java @@ -12,19 +12,21 @@ 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 PerformSearchSearchErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class PerformSearchSearchErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PerformSearchSearchErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class PerformSearchSearchErrors { return this; } + public PerformSearchSearchErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class PerformSearchSearchErrors { return this; } + public PerformSearchSearchErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class PerformSearchSearchErrors { return this; } + public PerformSearchSearchErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class PerformSearchSearchErrors { } PerformSearchSearchErrors other = (PerformSearchSearchErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class PerformSearchSearchErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class PerformSearchSearchErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class PerformSearchSearchErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class PerformSearchSearchErrors { this.status = status; return this; } - + public PerformSearchSearchErrors build() { + return new PerformSearchSearchErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchUnauthorized.java index 9ec7d5c6..2eb53a1c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PerformSearchUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class PerformSearchUnauthorized extends RuntimeException { public PerformSearchUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class PerformSearchUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PerformSearchUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class PerformSearchUnauthorized extends RuntimeException { return this; } + public PerformSearchUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class PerformSearchUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class PerformSearchUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class PerformSearchUnauthorized extends RuntimeException { } PerformSearchUnauthorized other = (PerformSearchUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class PerformSearchUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class PerformSearchUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class PerformSearchUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public PerformSearchUnauthorized build() { + return new PerformSearchUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchBadRequest.java index fbe28db5..518b59df 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { public PerformVoiceSearchBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PerformVoiceSearchBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { return this; } + public PerformVoiceSearchBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { } PerformVoiceSearchBadRequest other = (PerformVoiceSearchBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class PerformVoiceSearchBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public PerformVoiceSearchBadRequest build() { + return new PerformVoiceSearchBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchErrors.java index 0e77b39a..7f5fd2b6 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchErrors.java @@ -12,19 +12,21 @@ 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 PerformVoiceSearchErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class PerformVoiceSearchErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PerformVoiceSearchErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class PerformVoiceSearchErrors { return this; } + public PerformVoiceSearchErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class PerformVoiceSearchErrors { return this; } + public PerformVoiceSearchErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class PerformVoiceSearchErrors { return this; } + public PerformVoiceSearchErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class PerformVoiceSearchErrors { } PerformVoiceSearchErrors other = (PerformVoiceSearchErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class PerformVoiceSearchErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class PerformVoiceSearchErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class PerformVoiceSearchErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class PerformVoiceSearchErrors { this.status = status; return this; } - + public PerformVoiceSearchErrors build() { + return new PerformVoiceSearchErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchSearchErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchSearchErrors.java index cc22e403..00d68b6f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchSearchErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchSearchErrors.java @@ -12,19 +12,21 @@ 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 PerformVoiceSearchSearchErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class PerformVoiceSearchSearchErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PerformVoiceSearchSearchErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class PerformVoiceSearchSearchErrors { return this; } + public PerformVoiceSearchSearchErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class PerformVoiceSearchSearchErrors { return this; } + public PerformVoiceSearchSearchErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class PerformVoiceSearchSearchErrors { return this; } + public PerformVoiceSearchSearchErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class PerformVoiceSearchSearchErrors { } PerformVoiceSearchSearchErrors other = (PerformVoiceSearchSearchErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class PerformVoiceSearchSearchErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class PerformVoiceSearchSearchErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class PerformVoiceSearchSearchErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class PerformVoiceSearchSearchErrors { this.status = status; return this; } - + public PerformVoiceSearchSearchErrors build() { + return new PerformVoiceSearchSearchErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchUnauthorized.java index 34dfab48..9709ef45 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PerformVoiceSearchUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { public PerformVoiceSearchUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PerformVoiceSearchUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { return this; } + public PerformVoiceSearchUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { } PerformVoiceSearchUnauthorized other = (PerformVoiceSearchUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class PerformVoiceSearchUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public PerformVoiceSearchUnauthorized build() { + return new PerformVoiceSearchUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataAuthenticationErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataAuthenticationErrors.java index 14ce306a..a2a3bf96 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataAuthenticationErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataAuthenticationErrors.java @@ -12,19 +12,21 @@ 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 PostUsersSignInDataAuthenticationErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class PostUsersSignInDataAuthenticationErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PostUsersSignInDataAuthenticationErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class PostUsersSignInDataAuthenticationErrors { return this; } + public PostUsersSignInDataAuthenticationErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class PostUsersSignInDataAuthenticationErrors { return this; } + public PostUsersSignInDataAuthenticationErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class PostUsersSignInDataAuthenticationErrors { return this; } + public PostUsersSignInDataAuthenticationErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class PostUsersSignInDataAuthenticationErrors { } PostUsersSignInDataAuthenticationErrors other = (PostUsersSignInDataAuthenticationErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class PostUsersSignInDataAuthenticationErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class PostUsersSignInDataAuthenticationErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class PostUsersSignInDataAuthenticationErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class PostUsersSignInDataAuthenticationErrors { this.status = status; return this; } - + public PostUsersSignInDataAuthenticationErrors build() { + return new PostUsersSignInDataAuthenticationErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataBadRequest.java index ae05abe0..3276d5b4 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { public PostUsersSignInDataBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PostUsersSignInDataBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { return this; } + public PostUsersSignInDataBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { } PostUsersSignInDataBadRequest other = (PostUsersSignInDataBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class PostUsersSignInDataBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public PostUsersSignInDataBadRequest build() { + return new PostUsersSignInDataBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataErrors.java index acd88d3d..540ccfb9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataErrors.java @@ -12,19 +12,21 @@ 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 PostUsersSignInDataErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class PostUsersSignInDataErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PostUsersSignInDataErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class PostUsersSignInDataErrors { return this; } + public PostUsersSignInDataErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class PostUsersSignInDataErrors { return this; } + public PostUsersSignInDataErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class PostUsersSignInDataErrors { return this; } + public PostUsersSignInDataErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class PostUsersSignInDataErrors { } PostUsersSignInDataErrors other = (PostUsersSignInDataErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class PostUsersSignInDataErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class PostUsersSignInDataErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class PostUsersSignInDataErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class PostUsersSignInDataErrors { this.status = status; return this; } - + public PostUsersSignInDataErrors build() { + return new PostUsersSignInDataErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataUnauthorized.java index 94fe741c..5c5b622f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/PostUsersSignInDataUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { public PostUsersSignInDataUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PostUsersSignInDataUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { return this; } + public PostUsersSignInDataUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { } PostUsersSignInDataUnauthorized other = (PostUsersSignInDataUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class PostUsersSignInDataUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public PostUsersSignInDataUnauthorized build() { + return new PostUsersSignInDataUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/SDKError.java b/src/main/java/dev/plexapi/sdk/models/errors/SDKError.java index 30d3c996..0a6bba97 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/SDKError.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/SDKError.java @@ -5,6 +5,7 @@ package dev.plexapi.sdk.models.errors; import java.net.http.HttpResponse; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import dev.plexapi.sdk.utils.Utils; /** @@ -23,6 +24,7 @@ public class SDKError extends Exception { int code, String message, byte[] body) { + super(message); Utils.checkNotNull(rawResponse, "rawResponse"); Utils.checkNotNull(message, "message"); Utils.checkNotNull(body, "body"); @@ -60,10 +62,12 @@ public class SDKError extends Exception { @Override public String toString() { return Utils.toString(SDKError.class, - "rawResponse", rawResponse, + "requestMethod", rawResponse.request().method(), + "requestUri", rawResponse.request().uri(), "code", code, + "responseHeaders", rawResponse.headers().map(), "message", message, - "body", body); + "body", bodyAsString()); } public HttpResponse rawResponse() { @@ -81,4 +85,8 @@ public class SDKError extends Exception { public byte[] body() { return this.body; } -} + + public String bodyAsString() { + return new String(body(), StandardCharsets.UTF_8); + } +} \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksBadRequest.java index aeb88aaa..77dbb4d7 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StartAllTasksBadRequest extends RuntimeException { public StartAllTasksBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StartAllTasksBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartAllTasksBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StartAllTasksBadRequest extends RuntimeException { return this; } + public StartAllTasksBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StartAllTasksBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StartAllTasksBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StartAllTasksBadRequest extends RuntimeException { } StartAllTasksBadRequest other = (StartAllTasksBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StartAllTasksBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StartAllTasksBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StartAllTasksBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StartAllTasksBadRequest build() { + return new StartAllTasksBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksButlerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksButlerErrors.java index 95155955..3932b34c 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksButlerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksButlerErrors.java @@ -12,19 +12,21 @@ 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 StartAllTasksButlerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StartAllTasksButlerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartAllTasksButlerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StartAllTasksButlerErrors { return this; } + public StartAllTasksButlerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StartAllTasksButlerErrors { return this; } + public StartAllTasksButlerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StartAllTasksButlerErrors { return this; } + public StartAllTasksButlerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StartAllTasksButlerErrors { } StartAllTasksButlerErrors other = (StartAllTasksButlerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StartAllTasksButlerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StartAllTasksButlerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StartAllTasksButlerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StartAllTasksButlerErrors { this.status = status; return this; } - + public StartAllTasksButlerErrors build() { + return new StartAllTasksButlerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksErrors.java index da07f0ba..ef043182 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksErrors.java @@ -12,19 +12,21 @@ 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 StartAllTasksErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StartAllTasksErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartAllTasksErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StartAllTasksErrors { return this; } + public StartAllTasksErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StartAllTasksErrors { return this; } + public StartAllTasksErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StartAllTasksErrors { return this; } + public StartAllTasksErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StartAllTasksErrors { } StartAllTasksErrors other = (StartAllTasksErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StartAllTasksErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StartAllTasksErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StartAllTasksErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StartAllTasksErrors { this.status = status; return this; } - + public StartAllTasksErrors build() { + return new StartAllTasksErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksUnauthorized.java index 43dac03c..3e2bb37e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartAllTasksUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StartAllTasksUnauthorized extends RuntimeException { public StartAllTasksUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StartAllTasksUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartAllTasksUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StartAllTasksUnauthorized extends RuntimeException { return this; } + public StartAllTasksUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StartAllTasksUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StartAllTasksUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StartAllTasksUnauthorized extends RuntimeException { } StartAllTasksUnauthorized other = (StartAllTasksUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StartAllTasksUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StartAllTasksUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StartAllTasksUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StartAllTasksUnauthorized build() { + return new StartAllTasksUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartTaskBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/StartTaskBadRequest.java index b8c591d4..abdbb68e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartTaskBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartTaskBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StartTaskBadRequest extends RuntimeException { public StartTaskBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StartTaskBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartTaskBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StartTaskBadRequest extends RuntimeException { return this; } + public StartTaskBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StartTaskBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StartTaskBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StartTaskBadRequest extends RuntimeException { } StartTaskBadRequest other = (StartTaskBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StartTaskBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StartTaskBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StartTaskBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StartTaskBadRequest build() { + return new StartTaskBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartTaskButlerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StartTaskButlerErrors.java index df2da11d..6d7d2ce5 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartTaskButlerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartTaskButlerErrors.java @@ -12,19 +12,21 @@ 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 StartTaskButlerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StartTaskButlerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartTaskButlerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StartTaskButlerErrors { return this; } + public StartTaskButlerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StartTaskButlerErrors { return this; } + public StartTaskButlerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StartTaskButlerErrors { return this; } + public StartTaskButlerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StartTaskButlerErrors { } StartTaskButlerErrors other = (StartTaskButlerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StartTaskButlerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StartTaskButlerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StartTaskButlerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StartTaskButlerErrors { this.status = status; return this; } - + public StartTaskButlerErrors build() { + return new StartTaskButlerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartTaskErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StartTaskErrors.java index 763e7dae..a84ef3dc 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartTaskErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartTaskErrors.java @@ -12,19 +12,21 @@ 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 StartTaskErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StartTaskErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartTaskErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StartTaskErrors { return this; } + public StartTaskErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StartTaskErrors { return this; } + public StartTaskErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StartTaskErrors { return this; } + public StartTaskErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StartTaskErrors { } StartTaskErrors other = (StartTaskErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StartTaskErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StartTaskErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StartTaskErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StartTaskErrors { this.status = status; return this; } - + public StartTaskErrors build() { + return new StartTaskErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartTaskUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/StartTaskUnauthorized.java index 736beff4..944324a8 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartTaskUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartTaskUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StartTaskUnauthorized extends RuntimeException { public StartTaskUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StartTaskUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartTaskUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StartTaskUnauthorized extends RuntimeException { return this; } + public StartTaskUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StartTaskUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StartTaskUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StartTaskUnauthorized extends RuntimeException { } StartTaskUnauthorized other = (StartTaskUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StartTaskUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StartTaskUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StartTaskUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StartTaskUnauthorized build() { + return new StartTaskUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeBadRequest.java index 1c510774..9a1c9ede 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { public StartUniversalTranscodeBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartUniversalTranscodeBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { return this; } + public StartUniversalTranscodeBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { } StartUniversalTranscodeBadRequest other = (StartUniversalTranscodeBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StartUniversalTranscodeBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StartUniversalTranscodeBadRequest build() { + return new StartUniversalTranscodeBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeErrors.java index 62b506fa..3272e431 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeErrors.java @@ -12,19 +12,21 @@ 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 StartUniversalTranscodeErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StartUniversalTranscodeErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartUniversalTranscodeErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StartUniversalTranscodeErrors { return this; } + public StartUniversalTranscodeErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StartUniversalTranscodeErrors { return this; } + public StartUniversalTranscodeErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StartUniversalTranscodeErrors { return this; } + public StartUniversalTranscodeErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StartUniversalTranscodeErrors { } StartUniversalTranscodeErrors other = (StartUniversalTranscodeErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StartUniversalTranscodeErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StartUniversalTranscodeErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StartUniversalTranscodeErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StartUniversalTranscodeErrors { this.status = status; return this; } - + public StartUniversalTranscodeErrors build() { + return new StartUniversalTranscodeErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeUnauthorized.java index 1ec9f003..d94c8397 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { public StartUniversalTranscodeUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartUniversalTranscodeUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { return this; } + public StartUniversalTranscodeUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { } StartUniversalTranscodeUnauthorized other = (StartUniversalTranscodeUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StartUniversalTranscodeUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StartUniversalTranscodeUnauthorized build() { + return new StartUniversalTranscodeUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeVideoErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeVideoErrors.java index e43ca94c..e5c3278b 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeVideoErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StartUniversalTranscodeVideoErrors.java @@ -12,19 +12,21 @@ 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 StartUniversalTranscodeVideoErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StartUniversalTranscodeVideoErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StartUniversalTranscodeVideoErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StartUniversalTranscodeVideoErrors { return this; } + public StartUniversalTranscodeVideoErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StartUniversalTranscodeVideoErrors { return this; } + public StartUniversalTranscodeVideoErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StartUniversalTranscodeVideoErrors { return this; } + public StartUniversalTranscodeVideoErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StartUniversalTranscodeVideoErrors { } StartUniversalTranscodeVideoErrors other = (StartUniversalTranscodeVideoErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StartUniversalTranscodeVideoErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StartUniversalTranscodeVideoErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StartUniversalTranscodeVideoErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StartUniversalTranscodeVideoErrors { this.status = status; return this; } - + public StartUniversalTranscodeVideoErrors build() { + return new StartUniversalTranscodeVideoErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksBadRequest.java index 0299018a..cbf3b070 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StopAllTasksBadRequest extends RuntimeException { public StopAllTasksBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StopAllTasksBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopAllTasksBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StopAllTasksBadRequest extends RuntimeException { return this; } + public StopAllTasksBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StopAllTasksBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StopAllTasksBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StopAllTasksBadRequest extends RuntimeException { } StopAllTasksBadRequest other = (StopAllTasksBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StopAllTasksBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StopAllTasksBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StopAllTasksBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StopAllTasksBadRequest build() { + return new StopAllTasksBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksButlerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksButlerErrors.java index 7125477e..78f36152 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksButlerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksButlerErrors.java @@ -12,19 +12,21 @@ 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 StopAllTasksButlerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StopAllTasksButlerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopAllTasksButlerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StopAllTasksButlerErrors { return this; } + public StopAllTasksButlerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StopAllTasksButlerErrors { return this; } + public StopAllTasksButlerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StopAllTasksButlerErrors { return this; } + public StopAllTasksButlerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StopAllTasksButlerErrors { } StopAllTasksButlerErrors other = (StopAllTasksButlerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StopAllTasksButlerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StopAllTasksButlerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StopAllTasksButlerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StopAllTasksButlerErrors { this.status = status; return this; } - + public StopAllTasksButlerErrors build() { + return new StopAllTasksButlerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksErrors.java index 79922cae..d83d3278 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksErrors.java @@ -12,19 +12,21 @@ 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 StopAllTasksErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StopAllTasksErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopAllTasksErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StopAllTasksErrors { return this; } + public StopAllTasksErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StopAllTasksErrors { return this; } + public StopAllTasksErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StopAllTasksErrors { return this; } + public StopAllTasksErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StopAllTasksErrors { } StopAllTasksErrors other = (StopAllTasksErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StopAllTasksErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StopAllTasksErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StopAllTasksErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StopAllTasksErrors { this.status = status; return this; } - + public StopAllTasksErrors build() { + return new StopAllTasksErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksUnauthorized.java index cffe7559..abb4bbd0 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopAllTasksUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StopAllTasksUnauthorized extends RuntimeException { public StopAllTasksUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StopAllTasksUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopAllTasksUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StopAllTasksUnauthorized extends RuntimeException { return this; } + public StopAllTasksUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StopAllTasksUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StopAllTasksUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StopAllTasksUnauthorized extends RuntimeException { } StopAllTasksUnauthorized other = (StopAllTasksUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StopAllTasksUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StopAllTasksUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StopAllTasksUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StopAllTasksUnauthorized build() { + return new StopAllTasksUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopTaskBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/StopTaskBadRequest.java index b96135da..d8de4b44 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopTaskBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopTaskBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StopTaskBadRequest extends RuntimeException { public StopTaskBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StopTaskBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopTaskBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StopTaskBadRequest extends RuntimeException { return this; } + public StopTaskBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StopTaskBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StopTaskBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StopTaskBadRequest extends RuntimeException { } StopTaskBadRequest other = (StopTaskBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StopTaskBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StopTaskBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StopTaskBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StopTaskBadRequest build() { + return new StopTaskBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopTaskButlerErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StopTaskButlerErrors.java index 5ac8ddfa..40934f1e 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopTaskButlerErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopTaskButlerErrors.java @@ -12,19 +12,21 @@ 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 StopTaskButlerErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StopTaskButlerErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopTaskButlerErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StopTaskButlerErrors { return this; } + public StopTaskButlerErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StopTaskButlerErrors { return this; } + public StopTaskButlerErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StopTaskButlerErrors { return this; } + public StopTaskButlerErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StopTaskButlerErrors { } StopTaskButlerErrors other = (StopTaskButlerErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StopTaskButlerErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StopTaskButlerErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StopTaskButlerErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StopTaskButlerErrors { this.status = status; return this; } - + public StopTaskButlerErrors build() { + return new StopTaskButlerErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopTaskErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StopTaskErrors.java index ebaf5fc1..ba74c818 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopTaskErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopTaskErrors.java @@ -12,19 +12,21 @@ 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 StopTaskErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StopTaskErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopTaskErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StopTaskErrors { return this; } + public StopTaskErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StopTaskErrors { return this; } + public StopTaskErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StopTaskErrors { return this; } + public StopTaskErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StopTaskErrors { } StopTaskErrors other = (StopTaskErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StopTaskErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StopTaskErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StopTaskErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StopTaskErrors { this.status = status; return this; } - + public StopTaskErrors build() { + return new StopTaskErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopTaskUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/StopTaskUnauthorized.java index 181f165e..a49dc063 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopTaskUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopTaskUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StopTaskUnauthorized extends RuntimeException { public StopTaskUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StopTaskUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopTaskUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StopTaskUnauthorized extends RuntimeException { return this; } + public StopTaskUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StopTaskUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StopTaskUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StopTaskUnauthorized extends RuntimeException { } StopTaskUnauthorized other = (StopTaskUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StopTaskUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StopTaskUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StopTaskUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StopTaskUnauthorized build() { + return new StopTaskUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionBadRequest.java index c02bd999..9a3d2f6f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { public StopTranscodeSessionBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopTranscodeSessionBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { return this; } + public StopTranscodeSessionBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { } StopTranscodeSessionBadRequest other = (StopTranscodeSessionBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StopTranscodeSessionBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StopTranscodeSessionBadRequest build() { + return new StopTranscodeSessionBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionErrors.java index 158a1e40..c9399632 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionErrors.java @@ -12,19 +12,21 @@ 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 StopTranscodeSessionErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StopTranscodeSessionErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopTranscodeSessionErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StopTranscodeSessionErrors { return this; } + public StopTranscodeSessionErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StopTranscodeSessionErrors { return this; } + public StopTranscodeSessionErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StopTranscodeSessionErrors { return this; } + public StopTranscodeSessionErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StopTranscodeSessionErrors { } StopTranscodeSessionErrors other = (StopTranscodeSessionErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StopTranscodeSessionErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StopTranscodeSessionErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StopTranscodeSessionErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StopTranscodeSessionErrors { this.status = status; return this; } - + public StopTranscodeSessionErrors build() { + return new StopTranscodeSessionErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionSessionsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionSessionsErrors.java index 909ce3ff..fb8a5d81 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionSessionsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionSessionsErrors.java @@ -12,19 +12,21 @@ 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 StopTranscodeSessionSessionsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class StopTranscodeSessionSessionsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopTranscodeSessionSessionsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class StopTranscodeSessionSessionsErrors { return this; } + public StopTranscodeSessionSessionsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class StopTranscodeSessionSessionsErrors { return this; } + public StopTranscodeSessionSessionsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class StopTranscodeSessionSessionsErrors { return this; } + public StopTranscodeSessionSessionsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class StopTranscodeSessionSessionsErrors { } StopTranscodeSessionSessionsErrors other = (StopTranscodeSessionSessionsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class StopTranscodeSessionSessionsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class StopTranscodeSessionSessionsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class StopTranscodeSessionSessionsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class StopTranscodeSessionSessionsErrors { this.status = status; return this; } - + public StopTranscodeSessionSessionsErrors build() { + return new StopTranscodeSessionSessionsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionUnauthorized.java index 3183c17c..eeb96439 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/StopTranscodeSessionUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { public StopTranscodeSessionUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StopTranscodeSessionUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { return this; } + public StopTranscodeSessionUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { } StopTranscodeSessionUnauthorized other = (StopTranscodeSessionUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class StopTranscodeSessionUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public StopTranscodeSessionUnauthorized build() { + return new StopTranscodeSessionUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UncheckedSDKError.java b/src/main/java/dev/plexapi/sdk/models/errors/UncheckedSDKError.java new file mode 100644 index 00000000..f7398027 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/UncheckedSDKError.java @@ -0,0 +1,93 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors; + +import java.net.http.HttpResponse; +import dev.plexapi.sdk.utils.Blob; +import java.nio.charset.StandardCharsets; +import dev.plexapi.sdk.utils.Utils; + +/** + * Thrown by an async service call when an error response occurs. Contains details about the response. + * This is an unchecked exception suitable for use in CompletableFuture chains. + */ +@SuppressWarnings("serial") +public class UncheckedSDKError extends RuntimeException { + + private final HttpResponse rawResponse; + private final int code; + private final String message; + private final byte[] body; + + public UncheckedSDKError( + HttpResponse rawResponse, + int code, + String message, + byte[] body) { + super(message); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(body, "body"); + this.rawResponse = rawResponse; + this.code = code; + this.message = message; + this.body = body; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UncheckedSDKError other = (UncheckedSDKError) o; + return + java.util.Objects.deepEquals(this.rawResponse, other.rawResponse) && + java.util.Objects.deepEquals(this.code, other.code) && + java.util.Objects.deepEquals(this.message, other.message) && + java.util.Objects.deepEquals(this.body, other.body); + } + + @Override + public int hashCode() { + return java.util.Objects.hash( + rawResponse, + code, + message, + body); + } + + @Override + public String toString() { + return Utils.toString(UncheckedSDKError.class, + "requestMethod", rawResponse.request().method(), + "requestUri", rawResponse.request().uri(), + "code", code, + "responseHeaders", rawResponse.headers().map(), + "message", message, + "body", bodyAsString()); + } + + public HttpResponse rawResponse() { + return this.rawResponse; + } + + public int code() { + return this.code; + } + + public String message() { + return this.message; + } + + public byte[] body() { + return this.body; + } + + public String bodyAsString() { + return new String(body(), StandardCharsets.UTF_8); + } +} \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressBadRequest.java index 847bd53c..ec2feeed 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { public UpdatePlayProgressBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UpdatePlayProgressBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { return this; } + public UpdatePlayProgressBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { } UpdatePlayProgressBadRequest other = (UpdatePlayProgressBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class UpdatePlayProgressBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public UpdatePlayProgressBadRequest build() { + return new UpdatePlayProgressBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressErrors.java index 7adad3c4..f56b67ea 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressErrors.java @@ -12,19 +12,21 @@ 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 UpdatePlayProgressErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class UpdatePlayProgressErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UpdatePlayProgressErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class UpdatePlayProgressErrors { return this; } + public UpdatePlayProgressErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class UpdatePlayProgressErrors { return this; } + public UpdatePlayProgressErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class UpdatePlayProgressErrors { return this; } + public UpdatePlayProgressErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class UpdatePlayProgressErrors { } UpdatePlayProgressErrors other = (UpdatePlayProgressErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class UpdatePlayProgressErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class UpdatePlayProgressErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class UpdatePlayProgressErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class UpdatePlayProgressErrors { this.status = status; return this; } - + public UpdatePlayProgressErrors build() { + return new UpdatePlayProgressErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressMediaErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressMediaErrors.java index 228919a8..36a07dbf 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressMediaErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressMediaErrors.java @@ -12,19 +12,21 @@ 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 UpdatePlayProgressMediaErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class UpdatePlayProgressMediaErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UpdatePlayProgressMediaErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class UpdatePlayProgressMediaErrors { return this; } + public UpdatePlayProgressMediaErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class UpdatePlayProgressMediaErrors { return this; } + public UpdatePlayProgressMediaErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class UpdatePlayProgressMediaErrors { return this; } + public UpdatePlayProgressMediaErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class UpdatePlayProgressMediaErrors { } UpdatePlayProgressMediaErrors other = (UpdatePlayProgressMediaErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class UpdatePlayProgressMediaErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class UpdatePlayProgressMediaErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class UpdatePlayProgressMediaErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class UpdatePlayProgressMediaErrors { this.status = status; return this; } - + public UpdatePlayProgressMediaErrors build() { + return new UpdatePlayProgressMediaErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressUnauthorized.java index 8246017a..2673c521 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlayProgressUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { public UpdatePlayProgressUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UpdatePlayProgressUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { return this; } + public UpdatePlayProgressUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { } UpdatePlayProgressUnauthorized other = (UpdatePlayProgressUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class UpdatePlayProgressUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public UpdatePlayProgressUnauthorized build() { + return new UpdatePlayProgressUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistBadRequest.java index 45d222fc..39182bc9 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class UpdatePlaylistBadRequest extends RuntimeException { public UpdatePlaylistBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class UpdatePlaylistBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UpdatePlaylistBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class UpdatePlaylistBadRequest extends RuntimeException { return this; } + public UpdatePlaylistBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class UpdatePlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class UpdatePlaylistBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class UpdatePlaylistBadRequest extends RuntimeException { } UpdatePlaylistBadRequest other = (UpdatePlaylistBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class UpdatePlaylistBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class UpdatePlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class UpdatePlaylistBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public UpdatePlaylistBadRequest build() { + return new UpdatePlaylistBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistErrors.java index 6aaa6668..9e704e0f 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistErrors.java @@ -12,19 +12,21 @@ 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 UpdatePlaylistErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class UpdatePlaylistErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UpdatePlaylistErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class UpdatePlaylistErrors { return this; } + public UpdatePlaylistErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class UpdatePlaylistErrors { return this; } + public UpdatePlaylistErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class UpdatePlaylistErrors { return this; } + public UpdatePlaylistErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class UpdatePlaylistErrors { } UpdatePlaylistErrors other = (UpdatePlaylistErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class UpdatePlaylistErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class UpdatePlaylistErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class UpdatePlaylistErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class UpdatePlaylistErrors { this.status = status; return this; } - + public UpdatePlaylistErrors build() { + return new UpdatePlaylistErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistPlaylistsErrors.java index 4b239806..70d7cd11 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 UpdatePlaylistPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class UpdatePlaylistPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UpdatePlaylistPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class UpdatePlaylistPlaylistsErrors { return this; } + public UpdatePlaylistPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class UpdatePlaylistPlaylistsErrors { return this; } + public UpdatePlaylistPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class UpdatePlaylistPlaylistsErrors { return this; } + public UpdatePlaylistPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class UpdatePlaylistPlaylistsErrors { } UpdatePlaylistPlaylistsErrors other = (UpdatePlaylistPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class UpdatePlaylistPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class UpdatePlaylistPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class UpdatePlaylistPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class UpdatePlaylistPlaylistsErrors { this.status = status; return this; } - + public UpdatePlaylistPlaylistsErrors build() { + return new UpdatePlaylistPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistUnauthorized.java index e43501ac..1e864d97 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UpdatePlaylistUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { public UpdatePlaylistUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UpdatePlaylistUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { return this; } + public UpdatePlaylistUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { } UpdatePlaylistUnauthorized other = (UpdatePlaylistUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class UpdatePlaylistUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public UpdatePlaylistUnauthorized build() { + return new UpdatePlaylistUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistBadRequest.java index e367d988..8b2cda45 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistBadRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistBadRequest.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class UploadPlaylistBadRequest extends RuntimeException { public UploadPlaylistBadRequest( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class UploadPlaylistBadRequest extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UploadPlaylistBadRequest withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class UploadPlaylistBadRequest extends RuntimeException { return this; } + public UploadPlaylistBadRequest withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class UploadPlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class UploadPlaylistBadRequest extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class UploadPlaylistBadRequest extends RuntimeException { } UploadPlaylistBadRequest other = (UploadPlaylistBadRequest) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class UploadPlaylistBadRequest extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class UploadPlaylistBadRequest extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class UploadPlaylistBadRequest extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public UploadPlaylistBadRequest build() { + return new UploadPlaylistBadRequest( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistErrors.java index c78902c1..487e8e7d 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistErrors.java @@ -12,19 +12,21 @@ 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 UploadPlaylistErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class UploadPlaylistErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UploadPlaylistErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class UploadPlaylistErrors { return this; } + public UploadPlaylistErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class UploadPlaylistErrors { return this; } + public UploadPlaylistErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class UploadPlaylistErrors { return this; } + public UploadPlaylistErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class UploadPlaylistErrors { } UploadPlaylistErrors other = (UploadPlaylistErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class UploadPlaylistErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class UploadPlaylistErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class UploadPlaylistErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class UploadPlaylistErrors { this.status = status; return this; } - + public UploadPlaylistErrors build() { + return new UploadPlaylistErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistPlaylistsErrors.java b/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistPlaylistsErrors.java index 880d054e..74743f47 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistPlaylistsErrors.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistPlaylistsErrors.java @@ -12,19 +12,21 @@ 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 UploadPlaylistPlaylistsErrors { @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") private Optional code; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") private Optional message; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; @@ -61,9 +63,10 @@ public class UploadPlaylistPlaylistsErrors { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UploadPlaylistPlaylistsErrors withCode(int code) { Utils.checkNotNull(code, "code"); @@ -71,6 +74,7 @@ public class UploadPlaylistPlaylistsErrors { return this; } + public UploadPlaylistPlaylistsErrors withCode(Optional code) { Utils.checkNotNull(code, "code"); this.code = code; @@ -83,6 +87,7 @@ public class UploadPlaylistPlaylistsErrors { return this; } + public UploadPlaylistPlaylistsErrors withMessage(Optional message) { Utils.checkNotNull(message, "message"); this.message = message; @@ -95,13 +100,13 @@ public class UploadPlaylistPlaylistsErrors { return this; } + public UploadPlaylistPlaylistsErrors withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class UploadPlaylistPlaylistsErrors { } UploadPlaylistPlaylistsErrors other = (UploadPlaylistPlaylistsErrors) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - code, - message, - status); + return Utils.enhancedHash( + code, message, status); } @Override @@ -132,19 +135,21 @@ public class UploadPlaylistPlaylistsErrors { "message", message, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional code = Optional.empty(); - + private Optional message = Optional.empty(); - + private Optional status = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder code(int code) { Utils.checkNotNull(code, "code"); this.code = Optional.ofNullable(code); @@ -157,6 +162,7 @@ public class UploadPlaylistPlaylistsErrors { return this; } + public Builder message(String message) { Utils.checkNotNull(message, "message"); this.message = Optional.ofNullable(message); @@ -169,6 +175,7 @@ public class UploadPlaylistPlaylistsErrors { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -180,12 +187,12 @@ public class UploadPlaylistPlaylistsErrors { this.status = status; return this; } - + public UploadPlaylistPlaylistsErrors build() { + return new UploadPlaylistPlaylistsErrors( - code, - message, - status); + code, message, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistUnauthorized.java index bc1e3d95..131150ec 100644 --- a/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistUnauthorized.java +++ b/src/main/java/dev/plexapi/sdk/models/errors/UploadPlaylistUnauthorized.java @@ -16,7 +16,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -42,6 +41,7 @@ public class UploadPlaylistUnauthorized extends RuntimeException { public UploadPlaylistUnauthorized( @JsonProperty("errors") Optional> errors, @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); Utils.checkNotNull(errors, "errors"); Utils.checkNotNull(rawResponse, "rawResponse"); this.errors = errors; @@ -67,9 +67,10 @@ public class UploadPlaylistUnauthorized extends RuntimeException { return (Optional>) rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UploadPlaylistUnauthorized withErrors(List errors) { Utils.checkNotNull(errors, "errors"); @@ -77,6 +78,7 @@ public class UploadPlaylistUnauthorized extends RuntimeException { return this; } + public UploadPlaylistUnauthorized withErrors(Optional> errors) { Utils.checkNotNull(errors, "errors"); this.errors = errors; @@ -92,6 +94,7 @@ public class UploadPlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -101,7 +104,6 @@ public class UploadPlaylistUnauthorized extends RuntimeException { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,15 +114,14 @@ public class UploadPlaylistUnauthorized extends RuntimeException { } UploadPlaylistUnauthorized other = (UploadPlaylistUnauthorized) o; return - Objects.deepEquals(this.errors, other.errors) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - errors, - rawResponse); + return Utils.enhancedHash( + errors, rawResponse); } @Override @@ -129,17 +130,19 @@ public class UploadPlaylistUnauthorized extends RuntimeException { "errors", errors, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> errors = Optional.empty(); - + private Optional> rawResponse; - + private Builder() { // force use of static builder() method } + public Builder errors(List errors) { Utils.checkNotNull(errors, "errors"); this.errors = Optional.ofNullable(errors); @@ -152,6 +155,7 @@ public class UploadPlaylistUnauthorized extends RuntimeException { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +173,13 @@ public class UploadPlaylistUnauthorized extends RuntimeException { this.rawResponse = rawResponse; return this; } - + public UploadPlaylistUnauthorized build() { + return new UploadPlaylistUnauthorized( - errors, - rawResponse); + errors, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsBadRequest.java new file mode 100644 index 00000000..67cbc7b1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.AddPlaylistContentsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * AddPlaylistContentsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class AddPlaylistContentsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public AddPlaylistContentsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public AddPlaylistContentsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public AddPlaylistContentsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public AddPlaylistContentsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AddPlaylistContentsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AddPlaylistContentsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPlaylistContentsBadRequest other = (AddPlaylistContentsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(AddPlaylistContentsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public AddPlaylistContentsBadRequest build() { + + return new AddPlaylistContentsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsUnauthorized.java new file mode 100644 index 00000000..ab1dc280 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/AddPlaylistContentsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.AddPlaylistContentsPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * AddPlaylistContentsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class AddPlaylistContentsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public AddPlaylistContentsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public AddPlaylistContentsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public AddPlaylistContentsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public AddPlaylistContentsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AddPlaylistContentsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AddPlaylistContentsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPlaylistContentsUnauthorized other = (AddPlaylistContentsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(AddPlaylistContentsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public AddPlaylistContentsUnauthorized build() { + + return new AddPlaylistContentsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesBadRequest.java new file mode 100644 index 00000000..dacd6750 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.ApplyUpdatesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * ApplyUpdatesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class ApplyUpdatesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public ApplyUpdatesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public ApplyUpdatesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public ApplyUpdatesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public ApplyUpdatesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ApplyUpdatesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ApplyUpdatesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApplyUpdatesBadRequest other = (ApplyUpdatesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ApplyUpdatesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public ApplyUpdatesBadRequest build() { + + return new ApplyUpdatesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesUnauthorized.java new file mode 100644 index 00000000..c0062d56 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/ApplyUpdatesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.ApplyUpdatesUpdaterErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * ApplyUpdatesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class ApplyUpdatesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public ApplyUpdatesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public ApplyUpdatesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public ApplyUpdatesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public ApplyUpdatesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ApplyUpdatesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ApplyUpdatesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApplyUpdatesUnauthorized other = (ApplyUpdatesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ApplyUpdatesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public ApplyUpdatesUnauthorized build() { + + return new ApplyUpdatesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesBadRequest.java new file mode 100644 index 00000000..cf767cb8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.CancelServerActivitiesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * CancelServerActivitiesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class CancelServerActivitiesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public CancelServerActivitiesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public CancelServerActivitiesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public CancelServerActivitiesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public CancelServerActivitiesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CancelServerActivitiesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CancelServerActivitiesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelServerActivitiesBadRequest other = (CancelServerActivitiesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CancelServerActivitiesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CancelServerActivitiesBadRequest build() { + + return new CancelServerActivitiesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesUnauthorized.java new file mode 100644 index 00000000..3908892b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/CancelServerActivitiesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.CancelServerActivitiesActivitiesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * CancelServerActivitiesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class CancelServerActivitiesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public CancelServerActivitiesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public CancelServerActivitiesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public CancelServerActivitiesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public CancelServerActivitiesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CancelServerActivitiesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CancelServerActivitiesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelServerActivitiesUnauthorized other = (CancelServerActivitiesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CancelServerActivitiesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CancelServerActivitiesUnauthorized build() { + + return new CancelServerActivitiesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesBadRequest.java new file mode 100644 index 00000000..247977cb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.CheckForUpdatesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * CheckForUpdatesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class CheckForUpdatesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public CheckForUpdatesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public CheckForUpdatesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public CheckForUpdatesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public CheckForUpdatesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CheckForUpdatesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CheckForUpdatesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckForUpdatesBadRequest other = (CheckForUpdatesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CheckForUpdatesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CheckForUpdatesBadRequest build() { + + return new CheckForUpdatesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesUnauthorized.java new file mode 100644 index 00000000..f946f040 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/CheckForUpdatesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.CheckForUpdatesUpdaterErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * CheckForUpdatesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class CheckForUpdatesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public CheckForUpdatesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public CheckForUpdatesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public CheckForUpdatesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public CheckForUpdatesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CheckForUpdatesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CheckForUpdatesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckForUpdatesUnauthorized other = (CheckForUpdatesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CheckForUpdatesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CheckForUpdatesUnauthorized build() { + + return new CheckForUpdatesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsBadRequest.java new file mode 100644 index 00000000..1d11c23c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.ClearPlaylistContentsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * ClearPlaylistContentsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class ClearPlaylistContentsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public ClearPlaylistContentsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public ClearPlaylistContentsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public ClearPlaylistContentsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public ClearPlaylistContentsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClearPlaylistContentsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClearPlaylistContentsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClearPlaylistContentsBadRequest other = (ClearPlaylistContentsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ClearPlaylistContentsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public ClearPlaylistContentsBadRequest build() { + + return new ClearPlaylistContentsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsUnauthorized.java new file mode 100644 index 00000000..8b11e62a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/ClearPlaylistContentsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.ClearPlaylistContentsPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * ClearPlaylistContentsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class ClearPlaylistContentsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public ClearPlaylistContentsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public ClearPlaylistContentsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public ClearPlaylistContentsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public ClearPlaylistContentsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClearPlaylistContentsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClearPlaylistContentsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClearPlaylistContentsUnauthorized other = (ClearPlaylistContentsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ClearPlaylistContentsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public ClearPlaylistContentsUnauthorized build() { + + return new ClearPlaylistContentsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistBadRequest.java new file mode 100644 index 00000000..40f2b807 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.CreatePlaylistErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * CreatePlaylistBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class CreatePlaylistBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public CreatePlaylistBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public CreatePlaylistBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public CreatePlaylistBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public CreatePlaylistBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePlaylistBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePlaylistBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePlaylistBadRequest other = (CreatePlaylistBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreatePlaylistBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CreatePlaylistBadRequest build() { + + return new CreatePlaylistBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistUnauthorized.java new file mode 100644 index 00000000..e845d72d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/CreatePlaylistUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.CreatePlaylistPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * CreatePlaylistUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class CreatePlaylistUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public CreatePlaylistUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public CreatePlaylistUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public CreatePlaylistUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public CreatePlaylistUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePlaylistUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePlaylistUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePlaylistUnauthorized other = (CreatePlaylistUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CreatePlaylistUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CreatePlaylistUnauthorized build() { + + return new CreatePlaylistUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryBadRequest.java new file mode 100644 index 00000000..1030c581 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.DeleteLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * DeleteLibraryBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class DeleteLibraryBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public DeleteLibraryBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public DeleteLibraryBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public DeleteLibraryBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public DeleteLibraryBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteLibraryBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteLibraryBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteLibraryBadRequest other = (DeleteLibraryBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteLibraryBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeleteLibraryBadRequest build() { + + return new DeleteLibraryBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryUnauthorized.java new file mode 100644 index 00000000..e56095ce --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/DeleteLibraryUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.DeleteLibraryLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * DeleteLibraryUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class DeleteLibraryUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public DeleteLibraryUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public DeleteLibraryUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public DeleteLibraryUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public DeleteLibraryUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteLibraryUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteLibraryUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteLibraryUnauthorized other = (DeleteLibraryUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteLibraryUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeleteLibraryUnauthorized build() { + + return new DeleteLibraryUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistBadRequest.java new file mode 100644 index 00000000..5c26ae9b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.DeletePlaylistErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * DeletePlaylistBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class DeletePlaylistBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public DeletePlaylistBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public DeletePlaylistBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public DeletePlaylistBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public DeletePlaylistBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeletePlaylistBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeletePlaylistBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletePlaylistBadRequest other = (DeletePlaylistBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeletePlaylistBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeletePlaylistBadRequest build() { + + return new DeletePlaylistBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistUnauthorized.java new file mode 100644 index 00000000..bf68f7ab --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/DeletePlaylistUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.DeletePlaylistPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * DeletePlaylistUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class DeletePlaylistUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public DeletePlaylistUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public DeletePlaylistUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public DeletePlaylistUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public DeletePlaylistUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeletePlaylistUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeletePlaylistUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletePlaylistUnauthorized other = (DeletePlaylistUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeletePlaylistUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeletePlaylistUnauthorized build() { + + return new DeletePlaylistUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailBadRequest.java new file mode 100644 index 00000000..e13c8612 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.EnablePaperTrailErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * EnablePaperTrailBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class EnablePaperTrailBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public EnablePaperTrailBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public EnablePaperTrailBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public EnablePaperTrailBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public EnablePaperTrailBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EnablePaperTrailBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EnablePaperTrailBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnablePaperTrailBadRequest other = (EnablePaperTrailBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(EnablePaperTrailBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public EnablePaperTrailBadRequest build() { + + return new EnablePaperTrailBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailUnauthorized.java new file mode 100644 index 00000000..a1a8aa8e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/EnablePaperTrailUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.EnablePaperTrailLogErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * EnablePaperTrailUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class EnablePaperTrailUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public EnablePaperTrailUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public EnablePaperTrailUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public EnablePaperTrailUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public EnablePaperTrailUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EnablePaperTrailUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EnablePaperTrailUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnablePaperTrailUnauthorized other = (EnablePaperTrailUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(EnablePaperTrailUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public EnablePaperTrailUnauthorized build() { + + return new EnablePaperTrailUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryBadRequest.java new file mode 100644 index 00000000..b8576f91 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetActorsLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetActorsLibraryBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetActorsLibraryBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetActorsLibraryBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetActorsLibraryBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetActorsLibraryBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetActorsLibraryBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetActorsLibraryBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetActorsLibraryBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetActorsLibraryBadRequest other = (GetActorsLibraryBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetActorsLibraryBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetActorsLibraryBadRequest build() { + + return new GetActorsLibraryBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryUnauthorized.java new file mode 100644 index 00000000..5ecb9c44 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetActorsLibraryUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetActorsLibraryLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetActorsLibraryUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetActorsLibraryUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetActorsLibraryUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetActorsLibraryUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetActorsLibraryUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetActorsLibraryUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetActorsLibraryUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetActorsLibraryUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetActorsLibraryUnauthorized other = (GetActorsLibraryUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetActorsLibraryUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetActorsLibraryUnauthorized build() { + + return new GetActorsLibraryUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesBadRequest.java new file mode 100644 index 00000000..4975b87c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetAllLibrariesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetAllLibrariesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetAllLibrariesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetAllLibrariesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetAllLibrariesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetAllLibrariesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetAllLibrariesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAllLibrariesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAllLibrariesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllLibrariesBadRequest other = (GetAllLibrariesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAllLibrariesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetAllLibrariesBadRequest build() { + + return new GetAllLibrariesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesUnauthorized.java new file mode 100644 index 00000000..348cfff1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetAllLibrariesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetAllLibrariesLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetAllLibrariesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetAllLibrariesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetAllLibrariesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetAllLibrariesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetAllLibrariesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetAllLibrariesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAllLibrariesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAllLibrariesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllLibrariesUnauthorized other = (GetAllLibrariesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAllLibrariesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetAllLibrariesUnauthorized build() { + + return new GetAllLibrariesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsBadRequest.java new file mode 100644 index 00000000..6344c752 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetAvailableClientsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetAvailableClientsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetAvailableClientsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetAvailableClientsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetAvailableClientsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetAvailableClientsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetAvailableClientsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAvailableClientsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAvailableClientsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAvailableClientsBadRequest other = (GetAvailableClientsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAvailableClientsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetAvailableClientsBadRequest build() { + + return new GetAvailableClientsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsUnauthorized.java new file mode 100644 index 00000000..4fcab35f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetAvailableClientsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetAvailableClientsServerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetAvailableClientsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetAvailableClientsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetAvailableClientsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetAvailableClientsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetAvailableClientsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetAvailableClientsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAvailableClientsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAvailableClientsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAvailableClientsUnauthorized other = (GetAvailableClientsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetAvailableClientsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetAvailableClientsUnauthorized build() { + + return new GetAvailableClientsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsBadRequest.java new file mode 100644 index 00000000..1f9e5073 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetBandwidthStatisticsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetBandwidthStatisticsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetBandwidthStatisticsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetBandwidthStatisticsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetBandwidthStatisticsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetBandwidthStatisticsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetBandwidthStatisticsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBandwidthStatisticsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBandwidthStatisticsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsBadRequest other = (GetBandwidthStatisticsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetBandwidthStatisticsBadRequest build() { + + return new GetBandwidthStatisticsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsUnauthorized.java new file mode 100644 index 00000000..664b82fa --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetBandwidthStatisticsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetBandwidthStatisticsStatisticsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetBandwidthStatisticsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetBandwidthStatisticsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetBandwidthStatisticsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetBandwidthStatisticsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetBandwidthStatisticsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetBandwidthStatisticsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBandwidthStatisticsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBandwidthStatisticsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsUnauthorized other = (GetBandwidthStatisticsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetBandwidthStatisticsUnauthorized build() { + + return new GetBandwidthStatisticsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageBadRequest.java new file mode 100644 index 00000000..255c5798 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetBannerImageErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetBannerImageBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetBannerImageBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetBannerImageBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetBannerImageBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetBannerImageBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetBannerImageBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBannerImageBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBannerImageBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBannerImageBadRequest other = (GetBannerImageBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetBannerImageBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetBannerImageBadRequest build() { + + return new GetBannerImageBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageUnauthorized.java new file mode 100644 index 00000000..807132a2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetBannerImageUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetBannerImageMediaErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetBannerImageUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetBannerImageUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetBannerImageUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetBannerImageUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetBannerImageUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetBannerImageUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBannerImageUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBannerImageUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBannerImageUnauthorized other = (GetBannerImageUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetBannerImageUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetBannerImageUnauthorized build() { + + return new GetBannerImageUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksBadRequest.java new file mode 100644 index 00000000..e86cc1ed --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetButlerTasksErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetButlerTasksBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetButlerTasksBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetButlerTasksBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetButlerTasksBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetButlerTasksBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetButlerTasksBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetButlerTasksBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetButlerTasksBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetButlerTasksBadRequest other = (GetButlerTasksBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetButlerTasksBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetButlerTasksBadRequest build() { + + return new GetButlerTasksBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksUnauthorized.java new file mode 100644 index 00000000..ec911073 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetButlerTasksUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetButlerTasksButlerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetButlerTasksUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetButlerTasksUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetButlerTasksUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetButlerTasksUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetButlerTasksUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetButlerTasksUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetButlerTasksUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetButlerTasksUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetButlerTasksUnauthorized other = (GetButlerTasksUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetButlerTasksUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetButlerTasksUnauthorized build() { + + return new GetButlerTasksUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataBadRequest.java new file mode 100644 index 00000000..207163e2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetCompanionsDataErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetCompanionsDataBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetCompanionsDataBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetCompanionsDataBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetCompanionsDataBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetCompanionsDataBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetCompanionsDataBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCompanionsDataBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCompanionsDataBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCompanionsDataBadRequest other = (GetCompanionsDataBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCompanionsDataBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetCompanionsDataBadRequest build() { + + return new GetCompanionsDataBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataUnauthorized.java new file mode 100644 index 00000000..bcf7c3ba --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetCompanionsDataUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetCompanionsDataPlexErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetCompanionsDataUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetCompanionsDataUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetCompanionsDataUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetCompanionsDataUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetCompanionsDataUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetCompanionsDataUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCompanionsDataUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCompanionsDataUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCompanionsDataUnauthorized other = (GetCompanionsDataUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCompanionsDataUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetCompanionsDataUnauthorized build() { + + return new GetCompanionsDataUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryBadRequest.java new file mode 100644 index 00000000..3b4934f7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetCountriesLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetCountriesLibraryBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetCountriesLibraryBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetCountriesLibraryBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetCountriesLibraryBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetCountriesLibraryBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetCountriesLibraryBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCountriesLibraryBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCountriesLibraryBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCountriesLibraryBadRequest other = (GetCountriesLibraryBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCountriesLibraryBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetCountriesLibraryBadRequest build() { + + return new GetCountriesLibraryBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryUnauthorized.java new file mode 100644 index 00000000..4af1c000 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetCountriesLibraryUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetCountriesLibraryLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetCountriesLibraryUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetCountriesLibraryUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetCountriesLibraryUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetCountriesLibraryUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetCountriesLibraryUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetCountriesLibraryUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCountriesLibraryUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCountriesLibraryUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCountriesLibraryUnauthorized other = (GetCountriesLibraryUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetCountriesLibraryUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetCountriesLibraryUnauthorized build() { + + return new GetCountriesLibraryUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesBadRequest.java new file mode 100644 index 00000000..4af87125 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetDevicesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetDevicesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetDevicesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetDevicesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetDevicesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetDevicesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetDevicesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDevicesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDevicesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDevicesBadRequest other = (GetDevicesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetDevicesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetDevicesBadRequest build() { + + return new GetDevicesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesUnauthorized.java new file mode 100644 index 00000000..9c78cdf5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetDevicesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetDevicesServerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetDevicesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetDevicesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetDevicesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetDevicesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetDevicesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetDevicesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDevicesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDevicesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDevicesUnauthorized other = (GetDevicesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetDevicesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetDevicesUnauthorized build() { + + return new GetDevicesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashBadRequest.java new file mode 100644 index 00000000..1d276d4b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetFileHashErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetFileHashBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetFileHashBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetFileHashBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetFileHashBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetFileHashBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetFileHashBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetFileHashBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetFileHashBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFileHashBadRequest other = (GetFileHashBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetFileHashBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetFileHashBadRequest build() { + + return new GetFileHashBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashUnauthorized.java new file mode 100644 index 00000000..0c0ded87 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetFileHashUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetFileHashLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetFileHashUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetFileHashUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetFileHashUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetFileHashUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetFileHashUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetFileHashUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetFileHashUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetFileHashUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFileHashUnauthorized other = (GetFileHashUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetFileHashUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetFileHashUnauthorized build() { + + return new GetFileHashUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryBadRequest.java new file mode 100644 index 00000000..3190c64f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetGenresLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetGenresLibraryBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetGenresLibraryBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetGenresLibraryBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetGenresLibraryBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetGenresLibraryBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetGenresLibraryBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGenresLibraryBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGenresLibraryBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGenresLibraryBadRequest other = (GetGenresLibraryBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetGenresLibraryBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetGenresLibraryBadRequest build() { + + return new GetGenresLibraryBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryUnauthorized.java new file mode 100644 index 00000000..0cfa1632 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGenresLibraryUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetGenresLibraryLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetGenresLibraryUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetGenresLibraryUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetGenresLibraryUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetGenresLibraryUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetGenresLibraryUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetGenresLibraryUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGenresLibraryUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGenresLibraryUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGenresLibraryUnauthorized other = (GetGenresLibraryUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetGenresLibraryUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetGenresLibraryUnauthorized build() { + + return new GetGenresLibraryUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataBadRequest.java new file mode 100644 index 00000000..1507cc31 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetGeoDataErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetGeoDataBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetGeoDataBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetGeoDataBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetGeoDataBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetGeoDataBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetGeoDataBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGeoDataBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGeoDataBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGeoDataBadRequest other = (GetGeoDataBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetGeoDataBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetGeoDataBadRequest build() { + + return new GetGeoDataBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataUnauthorized.java new file mode 100644 index 00000000..6d732748 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGeoDataUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetGeoDataPlexErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetGeoDataUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetGeoDataUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetGeoDataUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetGeoDataUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetGeoDataUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetGeoDataUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGeoDataUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGeoDataUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGeoDataUnauthorized other = (GetGeoDataUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetGeoDataUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetGeoDataUnauthorized build() { + + return new GetGeoDataUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsBadRequest.java new file mode 100644 index 00000000..fe0df478 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetGlobalHubsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetGlobalHubsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetGlobalHubsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetGlobalHubsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetGlobalHubsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetGlobalHubsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetGlobalHubsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGlobalHubsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGlobalHubsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGlobalHubsBadRequest other = (GetGlobalHubsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetGlobalHubsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetGlobalHubsBadRequest build() { + + return new GetGlobalHubsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsUnauthorized.java new file mode 100644 index 00000000..04d9736d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetGlobalHubsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetGlobalHubsHubsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetGlobalHubsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetGlobalHubsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetGlobalHubsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetGlobalHubsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetGlobalHubsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetGlobalHubsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGlobalHubsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGlobalHubsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGlobalHubsUnauthorized other = (GetGlobalHubsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetGlobalHubsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetGlobalHubsUnauthorized build() { + + return new GetGlobalHubsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataBadRequest.java new file mode 100644 index 00000000..b3881490 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetHomeDataErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetHomeDataBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetHomeDataBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetHomeDataBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetHomeDataBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetHomeDataBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetHomeDataBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetHomeDataBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetHomeDataBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetHomeDataBadRequest other = (GetHomeDataBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetHomeDataBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetHomeDataBadRequest build() { + + return new GetHomeDataBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataUnauthorized.java new file mode 100644 index 00000000..e8c5238c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetHomeDataUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetHomeDataPlexErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetHomeDataUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetHomeDataUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetHomeDataUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetHomeDataUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetHomeDataUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetHomeDataUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetHomeDataUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetHomeDataUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetHomeDataUnauthorized other = (GetHomeDataUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetHomeDataUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetHomeDataUnauthorized build() { + + return new GetHomeDataUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsBadRequest.java new file mode 100644 index 00000000..ed608233 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetLibraryDetailsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetLibraryDetailsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetLibraryDetailsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryDetailsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryDetailsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetLibraryDetailsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetLibraryDetailsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryDetailsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryDetailsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryDetailsBadRequest other = (GetLibraryDetailsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryDetailsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetLibraryDetailsBadRequest build() { + + return new GetLibraryDetailsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsUnauthorized.java new file mode 100644 index 00000000..24ea4c0a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryDetailsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetLibraryDetailsLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetLibraryDetailsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetLibraryDetailsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryDetailsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryDetailsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetLibraryDetailsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetLibraryDetailsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryDetailsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryDetailsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryDetailsUnauthorized other = (GetLibraryDetailsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryDetailsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetLibraryDetailsUnauthorized build() { + + return new GetLibraryDetailsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsBadRequest.java new file mode 100644 index 00000000..9d784fae --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetLibraryHubsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetLibraryHubsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetLibraryHubsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryHubsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryHubsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetLibraryHubsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetLibraryHubsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryHubsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryHubsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryHubsBadRequest other = (GetLibraryHubsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryHubsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetLibraryHubsBadRequest build() { + + return new GetLibraryHubsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsUnauthorized.java new file mode 100644 index 00000000..266b5cdc --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryHubsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetLibraryHubsHubsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetLibraryHubsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetLibraryHubsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryHubsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryHubsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetLibraryHubsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetLibraryHubsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryHubsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryHubsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryHubsUnauthorized other = (GetLibraryHubsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryHubsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetLibraryHubsUnauthorized build() { + + return new GetLibraryHubsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsBadRequest.java new file mode 100644 index 00000000..605408e3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetLibraryItemsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetLibraryItemsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetLibraryItemsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryItemsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryItemsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetLibraryItemsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetLibraryItemsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryItemsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryItemsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsBadRequest other = (GetLibraryItemsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetLibraryItemsBadRequest build() { + + return new GetLibraryItemsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsUnauthorized.java new file mode 100644 index 00000000..3e1713e3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibraryItemsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetLibraryItemsLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetLibraryItemsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetLibraryItemsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetLibraryItemsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibraryItemsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetLibraryItemsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetLibraryItemsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryItemsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryItemsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsUnauthorized other = (GetLibraryItemsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetLibraryItemsUnauthorized build() { + + return new GetLibraryItemsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllBadRequest.java new file mode 100644 index 00000000..f57adaa7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetLibrarySectionsAllErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetLibrarySectionsAllBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetLibrarySectionsAllBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetLibrarySectionsAllBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibrarySectionsAllBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetLibrarySectionsAllBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetLibrarySectionsAllBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibrarySectionsAllBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibrarySectionsAllBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibrarySectionsAllBadRequest other = (GetLibrarySectionsAllBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibrarySectionsAllBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetLibrarySectionsAllBadRequest build() { + + return new GetLibrarySectionsAllBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllUnauthorized.java new file mode 100644 index 00000000..0956a3d2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetLibrarySectionsAllUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetLibrarySectionsAllLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetLibrarySectionsAllUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetLibrarySectionsAllUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetLibrarySectionsAllUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetLibrarySectionsAllUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetLibrarySectionsAllUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetLibrarySectionsAllUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibrarySectionsAllUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibrarySectionsAllUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibrarySectionsAllUnauthorized other = (GetLibrarySectionsAllUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetLibrarySectionsAllUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetLibrarySectionsAllUnauthorized build() { + + return new GetLibrarySectionsAllUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataBadRequest.java new file mode 100644 index 00000000..41bf4be1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetMediaMetaDataErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetMediaMetaDataBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetMediaMetaDataBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetMediaMetaDataBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMediaMetaDataBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetMediaMetaDataBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetMediaMetaDataBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaMetaDataBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaMetaDataBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMediaMetaDataBadRequest other = (GetMediaMetaDataBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMediaMetaDataBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMediaMetaDataBadRequest build() { + + return new GetMediaMetaDataBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataUnauthorized.java new file mode 100644 index 00000000..8057a0bb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaMetaDataUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetMediaMetaDataLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetMediaMetaDataUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetMediaMetaDataUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetMediaMetaDataUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMediaMetaDataUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetMediaMetaDataUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetMediaMetaDataUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaMetaDataUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaMetaDataUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMediaMetaDataUnauthorized other = (GetMediaMetaDataUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMediaMetaDataUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMediaMetaDataUnauthorized build() { + + return new GetMediaMetaDataUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersBadRequest.java new file mode 100644 index 00000000..30cb2ee3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetMediaProvidersErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetMediaProvidersBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetMediaProvidersBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetMediaProvidersBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMediaProvidersBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetMediaProvidersBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetMediaProvidersBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaProvidersBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaProvidersBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMediaProvidersBadRequest other = (GetMediaProvidersBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMediaProvidersBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMediaProvidersBadRequest build() { + + return new GetMediaProvidersBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersUnauthorized.java new file mode 100644 index 00000000..df7a06e5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMediaProvidersUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetMediaProvidersServerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetMediaProvidersUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetMediaProvidersUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetMediaProvidersUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMediaProvidersUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetMediaProvidersUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetMediaProvidersUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaProvidersUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaProvidersUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMediaProvidersUnauthorized other = (GetMediaProvidersUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMediaProvidersUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMediaProvidersUnauthorized build() { + + return new GetMediaProvidersUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenBadRequest.java new file mode 100644 index 00000000..01a55373 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetMetadataChildrenErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetMetadataChildrenBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetMetadataChildrenBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetMetadataChildrenBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMetadataChildrenBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetMetadataChildrenBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetMetadataChildrenBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataChildrenBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataChildrenBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMetadataChildrenBadRequest other = (GetMetadataChildrenBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMetadataChildrenBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMetadataChildrenBadRequest build() { + + return new GetMetadataChildrenBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenUnauthorized.java new file mode 100644 index 00000000..0330b1ec --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMetadataChildrenUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetMetadataChildrenLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetMetadataChildrenUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetMetadataChildrenUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetMetadataChildrenUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMetadataChildrenUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetMetadataChildrenUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetMetadataChildrenUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataChildrenUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataChildrenUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMetadataChildrenUnauthorized other = (GetMetadataChildrenUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMetadataChildrenUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMetadataChildrenUnauthorized build() { + + return new GetMetadataChildrenUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountBadRequest.java new file mode 100644 index 00000000..81fd9f3a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetMyPlexAccountErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetMyPlexAccountBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetMyPlexAccountBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetMyPlexAccountBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMyPlexAccountBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetMyPlexAccountBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetMyPlexAccountBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMyPlexAccountBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMyPlexAccountBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMyPlexAccountBadRequest other = (GetMyPlexAccountBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMyPlexAccountBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMyPlexAccountBadRequest build() { + + return new GetMyPlexAccountBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountUnauthorized.java new file mode 100644 index 00000000..72c491b2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetMyPlexAccountUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetMyPlexAccountServerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetMyPlexAccountUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetMyPlexAccountUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetMyPlexAccountUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetMyPlexAccountUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetMyPlexAccountUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetMyPlexAccountUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMyPlexAccountUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMyPlexAccountUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMyPlexAccountUnauthorized other = (GetMyPlexAccountUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetMyPlexAccountUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetMyPlexAccountUnauthorized build() { + + return new GetMyPlexAccountUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetPinBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPinBadRequest.java new file mode 100644 index 00000000..c2519f67 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPinBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetPinErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetPinBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetPinBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetPinBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPinBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetPinBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetPinBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPinBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPinBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPinBadRequest other = (GetPinBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPinBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetPinBadRequest build() { + + return new GetPinBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistBadRequest.java new file mode 100644 index 00000000..58119271 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetPlaylistErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetPlaylistBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetPlaylistBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetPlaylistBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetPlaylistBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistBadRequest other = (GetPlaylistBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetPlaylistBadRequest build() { + + return new GetPlaylistBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsBadRequest.java new file mode 100644 index 00000000..20c91140 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetPlaylistContentsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetPlaylistContentsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetPlaylistContentsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistContentsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistContentsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetPlaylistContentsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetPlaylistContentsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistContentsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistContentsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistContentsBadRequest other = (GetPlaylistContentsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistContentsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetPlaylistContentsBadRequest build() { + + return new GetPlaylistContentsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsUnauthorized.java new file mode 100644 index 00000000..4c0e7a48 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistContentsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetPlaylistContentsPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetPlaylistContentsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetPlaylistContentsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistContentsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistContentsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetPlaylistContentsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetPlaylistContentsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistContentsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistContentsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistContentsUnauthorized other = (GetPlaylistContentsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistContentsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetPlaylistContentsUnauthorized build() { + + return new GetPlaylistContentsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistUnauthorized.java new file mode 100644 index 00000000..305334c8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetPlaylistPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetPlaylistUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetPlaylistUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetPlaylistUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetPlaylistUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistUnauthorized other = (GetPlaylistUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetPlaylistUnauthorized build() { + + return new GetPlaylistUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsBadRequest.java new file mode 100644 index 00000000..ff50fabe --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetPlaylistsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetPlaylistsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetPlaylistsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetPlaylistsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistsBadRequest other = (GetPlaylistsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetPlaylistsBadRequest build() { + + return new GetPlaylistsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsUnauthorized.java new file mode 100644 index 00000000..ed675cca --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetPlaylistsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetPlaylistsPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetPlaylistsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetPlaylistsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetPlaylistsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetPlaylistsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetPlaylistsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetPlaylistsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistsUnauthorized other = (GetPlaylistsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetPlaylistsUnauthorized build() { + + return new GetPlaylistsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryBadRequest.java new file mode 100644 index 00000000..5f0fef99 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetRecentlyAddedLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetRecentlyAddedLibraryBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetRecentlyAddedLibraryBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetRecentlyAddedLibraryBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetRecentlyAddedLibraryBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetRecentlyAddedLibraryBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetRecentlyAddedLibraryBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRecentlyAddedLibraryBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRecentlyAddedLibraryBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRecentlyAddedLibraryBadRequest other = (GetRecentlyAddedLibraryBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetRecentlyAddedLibraryBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetRecentlyAddedLibraryBadRequest build() { + + return new GetRecentlyAddedLibraryBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryUnauthorized.java new file mode 100644 index 00000000..ef7a0554 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetRecentlyAddedLibraryUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetRecentlyAddedLibraryLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetRecentlyAddedLibraryUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetRecentlyAddedLibraryUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetRecentlyAddedLibraryUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetRecentlyAddedLibraryUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetRecentlyAddedLibraryUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetRecentlyAddedLibraryUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRecentlyAddedLibraryUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRecentlyAddedLibraryUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRecentlyAddedLibraryUnauthorized other = (GetRecentlyAddedLibraryUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetRecentlyAddedLibraryUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetRecentlyAddedLibraryUnauthorized build() { + + return new GetRecentlyAddedLibraryUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataBadRequest.java new file mode 100644 index 00000000..22f6dd20 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetRefreshLibraryMetadataErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetRefreshLibraryMetadataBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetRefreshLibraryMetadataBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetRefreshLibraryMetadataBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetRefreshLibraryMetadataBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetRefreshLibraryMetadataBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetRefreshLibraryMetadataBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRefreshLibraryMetadataBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRefreshLibraryMetadataBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRefreshLibraryMetadataBadRequest other = (GetRefreshLibraryMetadataBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetRefreshLibraryMetadataBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetRefreshLibraryMetadataBadRequest build() { + + return new GetRefreshLibraryMetadataBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataUnauthorized.java new file mode 100644 index 00000000..e7a88050 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetRefreshLibraryMetadataUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetRefreshLibraryMetadataLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetRefreshLibraryMetadataUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetRefreshLibraryMetadataUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetRefreshLibraryMetadataUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetRefreshLibraryMetadataUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetRefreshLibraryMetadataUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetRefreshLibraryMetadataUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRefreshLibraryMetadataUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRefreshLibraryMetadataUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRefreshLibraryMetadataUnauthorized other = (GetRefreshLibraryMetadataUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetRefreshLibraryMetadataUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetRefreshLibraryMetadataUnauthorized build() { + + return new GetRefreshLibraryMetadataUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoBadRequest.java new file mode 100644 index 00000000..f75070bf --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetResizedPhotoErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetResizedPhotoBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetResizedPhotoBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetResizedPhotoBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetResizedPhotoBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetResizedPhotoBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetResizedPhotoBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResizedPhotoBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResizedPhotoBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResizedPhotoBadRequest other = (GetResizedPhotoBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetResizedPhotoBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetResizedPhotoBadRequest build() { + + return new GetResizedPhotoBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoUnauthorized.java new file mode 100644 index 00000000..7cf513bf --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetResizedPhotoUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetResizedPhotoServerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetResizedPhotoUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetResizedPhotoUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetResizedPhotoUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetResizedPhotoUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetResizedPhotoUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetResizedPhotoUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResizedPhotoUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResizedPhotoUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResizedPhotoUnauthorized other = (GetResizedPhotoUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetResizedPhotoUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetResizedPhotoUnauthorized build() { + + return new GetResizedPhotoUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsBadRequest.java new file mode 100644 index 00000000..7b4bf770 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetResourcesStatisticsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetResourcesStatisticsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetResourcesStatisticsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetResourcesStatisticsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetResourcesStatisticsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetResourcesStatisticsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetResourcesStatisticsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResourcesStatisticsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResourcesStatisticsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourcesStatisticsBadRequest other = (GetResourcesStatisticsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetResourcesStatisticsBadRequest build() { + + return new GetResourcesStatisticsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsUnauthorized.java new file mode 100644 index 00000000..105c9a15 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetResourcesStatisticsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetResourcesStatisticsStatisticsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetResourcesStatisticsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetResourcesStatisticsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetResourcesStatisticsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetResourcesStatisticsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetResourcesStatisticsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetResourcesStatisticsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResourcesStatisticsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResourcesStatisticsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourcesStatisticsUnauthorized other = (GetResourcesStatisticsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetResourcesStatisticsUnauthorized build() { + + return new GetResourcesStatisticsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesBadRequest.java new file mode 100644 index 00000000..1e22ea00 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSearchAllLibrariesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSearchAllLibrariesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetSearchAllLibrariesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSearchAllLibrariesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchAllLibrariesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSearchAllLibrariesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSearchAllLibrariesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesBadRequest other = (GetSearchAllLibrariesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSearchAllLibrariesBadRequest build() { + + return new GetSearchAllLibrariesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesUnauthorized.java new file mode 100644 index 00000000..c94f2839 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchAllLibrariesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSearchAllLibrariesLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSearchAllLibrariesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetSearchAllLibrariesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSearchAllLibrariesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchAllLibrariesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSearchAllLibrariesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSearchAllLibrariesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesUnauthorized other = (GetSearchAllLibrariesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSearchAllLibrariesUnauthorized build() { + + return new GetSearchAllLibrariesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryBadRequest.java new file mode 100644 index 00000000..dc960fee --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSearchLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSearchLibraryBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetSearchLibraryBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSearchLibraryBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchLibraryBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSearchLibraryBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSearchLibraryBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchLibraryBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchLibraryBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchLibraryBadRequest other = (GetSearchLibraryBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchLibraryBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSearchLibraryBadRequest build() { + + return new GetSearchLibraryBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryUnauthorized.java new file mode 100644 index 00000000..1130b975 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchLibraryUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSearchLibraryLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSearchLibraryUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetSearchLibraryUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSearchLibraryUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchLibraryUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSearchLibraryUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSearchLibraryUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchLibraryUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchLibraryUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchLibraryUnauthorized other = (GetSearchLibraryUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchLibraryUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSearchLibraryUnauthorized build() { + + return new GetSearchLibraryUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsBadRequest.java new file mode 100644 index 00000000..201056f3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSearchResultsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSearchResultsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetSearchResultsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSearchResultsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchResultsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSearchResultsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSearchResultsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchResultsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchResultsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchResultsBadRequest other = (GetSearchResultsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchResultsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSearchResultsBadRequest build() { + + return new GetSearchResultsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsUnauthorized.java new file mode 100644 index 00000000..aadb9187 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSearchResultsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSearchResultsSearchErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSearchResultsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetSearchResultsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSearchResultsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSearchResultsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSearchResultsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSearchResultsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchResultsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchResultsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchResultsUnauthorized other = (GetSearchResultsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSearchResultsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSearchResultsUnauthorized build() { + + return new GetSearchResultsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesBadRequest.java new file mode 100644 index 00000000..462815f2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerActivitiesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerActivitiesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetServerActivitiesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerActivitiesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerActivitiesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerActivitiesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerActivitiesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerActivitiesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerActivitiesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerActivitiesBadRequest other = (GetServerActivitiesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerActivitiesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerActivitiesBadRequest build() { + + return new GetServerActivitiesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesUnauthorized.java new file mode 100644 index 00000000..fb9a4960 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerActivitiesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerActivitiesActivitiesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerActivitiesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetServerActivitiesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerActivitiesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerActivitiesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerActivitiesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerActivitiesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerActivitiesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerActivitiesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerActivitiesUnauthorized other = (GetServerActivitiesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerActivitiesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerActivitiesUnauthorized build() { + + return new GetServerActivitiesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesBadRequest.java new file mode 100644 index 00000000..0c15d26b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.Errors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerCapabilitiesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetServerCapabilitiesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerCapabilitiesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerCapabilitiesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerCapabilitiesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerCapabilitiesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerCapabilitiesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerCapabilitiesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerCapabilitiesBadRequest other = (GetServerCapabilitiesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerCapabilitiesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerCapabilitiesBadRequest build() { + + return new GetServerCapabilitiesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesUnauthorized.java new file mode 100644 index 00000000..c9e90ad2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerCapabilitiesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerCapabilitiesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerCapabilitiesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetServerCapabilitiesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerCapabilitiesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerCapabilitiesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerCapabilitiesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerCapabilitiesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerCapabilitiesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerCapabilitiesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerCapabilitiesUnauthorized other = (GetServerCapabilitiesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerCapabilitiesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerCapabilitiesUnauthorized build() { + + return new GetServerCapabilitiesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerIdentityRequestTimeout.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerIdentityRequestTimeout.java new file mode 100644 index 00000000..4f9723fe --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerIdentityRequestTimeout.java @@ -0,0 +1,233 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + +/** + * GetServerIdentityRequestTimeout + * + *

Request Timeout + */ +@SuppressWarnings("serial") +public class GetServerIdentityRequestTimeout extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private Optional code; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("message") + private Optional message; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerIdentityRequestTimeout( + @JsonProperty("code") Optional code, + @JsonProperty("message") Optional message, + @JsonProperty("RawResponse") Optional> rawResponse) { + super(Utils.valueOrElse(message, "API error occurred")); + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(message, "message"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.code = code; + this.message = message; + this.rawResponse = rawResponse; + } + + public GetServerIdentityRequestTimeout() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public Optional code() { + return code; + } + + @JsonIgnore + public Optional message() { + return message; + } + + @JsonIgnore + @Override + public String getMessage() { + return Utils.valueOrNull(message); + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerIdentityRequestTimeout withCode(int code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + + public GetServerIdentityRequestTimeout withCode(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + public GetServerIdentityRequestTimeout withMessage(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + + public GetServerIdentityRequestTimeout withMessage(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerIdentityRequestTimeout withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerIdentityRequestTimeout withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerIdentityRequestTimeout other = (GetServerIdentityRequestTimeout) o; + return + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + code, message, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerIdentityRequestTimeout.class, + "code", code, + "message", message, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional code = Optional.empty(); + + private Optional message = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder code(int code) { + Utils.checkNotNull(code, "code"); + this.code = Optional.ofNullable(code); + return this; + } + + public Builder code(Optional code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + + public Builder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = Optional.ofNullable(message); + return this; + } + + public Builder message(Optional message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerIdentityRequestTimeout build() { + + return new GetServerIdentityRequestTimeout( + code, message, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListBadRequest.java new file mode 100644 index 00000000..2b546078 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerListErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerListBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetServerListBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerListBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerListBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerListBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerListBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerListBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerListBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerListBadRequest other = (GetServerListBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerListBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerListBadRequest build() { + + return new GetServerListBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListUnauthorized.java new file mode 100644 index 00000000..907a4eb1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerListUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerListServerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerListUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetServerListUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerListUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerListUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerListUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerListUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerListUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerListUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerListUnauthorized other = (GetServerListUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerListUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerListUnauthorized build() { + + return new GetServerListUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesBadRequest.java new file mode 100644 index 00000000..c4ed885b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerPreferencesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerPreferencesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetServerPreferencesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerPreferencesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerPreferencesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerPreferencesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerPreferencesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerPreferencesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerPreferencesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerPreferencesBadRequest other = (GetServerPreferencesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerPreferencesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerPreferencesBadRequest build() { + + return new GetServerPreferencesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesUnauthorized.java new file mode 100644 index 00000000..0ffbb2a1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerPreferencesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerPreferencesServerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerPreferencesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetServerPreferencesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerPreferencesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerPreferencesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerPreferencesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerPreferencesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerPreferencesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerPreferencesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerPreferencesUnauthorized other = (GetServerPreferencesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerPreferencesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerPreferencesUnauthorized build() { + + return new GetServerPreferencesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesBadRequest.java new file mode 100644 index 00000000..73b8fd29 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerResourcesErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerResourcesBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetServerResourcesBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerResourcesBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerResourcesBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerResourcesBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerResourcesBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerResourcesBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerResourcesBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerResourcesBadRequest other = (GetServerResourcesBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerResourcesBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerResourcesBadRequest build() { + + return new GetServerResourcesBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesUnauthorized.java new file mode 100644 index 00000000..e2450108 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetServerResourcesUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetServerResourcesPlexErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetServerResourcesUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetServerResourcesUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetServerResourcesUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetServerResourcesUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetServerResourcesUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetServerResourcesUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerResourcesUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerResourcesUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerResourcesUnauthorized other = (GetServerResourcesUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetServerResourcesUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetServerResourcesUnauthorized build() { + + return new GetServerResourcesUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryBadRequest.java new file mode 100644 index 00000000..4bb6377e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSessionHistoryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSessionHistoryBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetSessionHistoryBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSessionHistoryBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSessionHistoryBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSessionHistoryBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSessionHistoryBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionHistoryBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionHistoryBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionHistoryBadRequest other = (GetSessionHistoryBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSessionHistoryBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSessionHistoryBadRequest build() { + + return new GetSessionHistoryBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryUnauthorized.java new file mode 100644 index 00000000..1c96cd96 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionHistoryUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSessionHistorySessionsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSessionHistoryUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetSessionHistoryUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSessionHistoryUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSessionHistoryUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSessionHistoryUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSessionHistoryUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionHistoryUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionHistoryUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionHistoryUnauthorized other = (GetSessionHistoryUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSessionHistoryUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSessionHistoryUnauthorized build() { + + return new GetSessionHistoryUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsBadRequest.java new file mode 100644 index 00000000..4ebbd73d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSessionsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSessionsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetSessionsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSessionsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSessionsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSessionsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSessionsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionsBadRequest other = (GetSessionsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSessionsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSessionsBadRequest build() { + + return new GetSessionsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsUnauthorized.java new file mode 100644 index 00000000..ff042e65 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSessionsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSessionsSessionsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSessionsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetSessionsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSessionsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSessionsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSessionsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSessionsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionsUnauthorized other = (GetSessionsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSessionsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSessionsUnauthorized build() { + + return new GetSessionsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationBadRequest.java new file mode 100644 index 00000000..7531b603 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSourceConnectionInformationErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSourceConnectionInformationBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetSourceConnectionInformationBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSourceConnectionInformationBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSourceConnectionInformationBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSourceConnectionInformationBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSourceConnectionInformationBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSourceConnectionInformationBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSourceConnectionInformationBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourceConnectionInformationBadRequest other = (GetSourceConnectionInformationBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSourceConnectionInformationBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSourceConnectionInformationBadRequest build() { + + return new GetSourceConnectionInformationBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationUnauthorized.java new file mode 100644 index 00000000..838a025a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetSourceConnectionInformationUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetSourceConnectionInformationAuthenticationErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetSourceConnectionInformationUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetSourceConnectionInformationUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetSourceConnectionInformationUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetSourceConnectionInformationUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetSourceConnectionInformationUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetSourceConnectionInformationUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSourceConnectionInformationUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSourceConnectionInformationUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourceConnectionInformationUnauthorized other = (GetSourceConnectionInformationUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSourceConnectionInformationUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSourceConnectionInformationUnauthorized build() { + + return new GetSourceConnectionInformationUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsBadRequest.java new file mode 100644 index 00000000..2a6e1245 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetStatisticsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetStatisticsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetStatisticsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetStatisticsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetStatisticsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetStatisticsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetStatisticsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetStatisticsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetStatisticsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatisticsBadRequest other = (GetStatisticsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetStatisticsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetStatisticsBadRequest build() { + + return new GetStatisticsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsUnauthorized.java new file mode 100644 index 00000000..d5b923b8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetStatisticsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetStatisticsStatisticsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetStatisticsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetStatisticsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetStatisticsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetStatisticsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetStatisticsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetStatisticsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetStatisticsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetStatisticsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatisticsUnauthorized other = (GetStatisticsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetStatisticsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetStatisticsUnauthorized build() { + + return new GetStatisticsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageBadRequest.java new file mode 100644 index 00000000..f59262aa --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetThumbImageErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetThumbImageBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetThumbImageBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetThumbImageBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetThumbImageBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetThumbImageBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetThumbImageBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetThumbImageBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetThumbImageBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetThumbImageBadRequest other = (GetThumbImageBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetThumbImageBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetThumbImageBadRequest build() { + + return new GetThumbImageBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageUnauthorized.java new file mode 100644 index 00000000..e2d730d1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetThumbImageUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetThumbImageMediaErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetThumbImageUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetThumbImageUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetThumbImageUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetThumbImageUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetThumbImageUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetThumbImageUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetThumbImageUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetThumbImageUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetThumbImageUnauthorized other = (GetThumbImageUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetThumbImageUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetThumbImageUnauthorized build() { + + return new GetThumbImageUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineBadRequest.java new file mode 100644 index 00000000..4fcaa560 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTimelineErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTimelineBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetTimelineBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTimelineBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTimelineBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTimelineBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTimelineBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTimelineBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTimelineBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTimelineBadRequest other = (GetTimelineBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTimelineBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTimelineBadRequest build() { + + return new GetTimelineBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineUnauthorized.java new file mode 100644 index 00000000..c2601915 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTimelineUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTimelineVideoErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTimelineUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetTimelineUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTimelineUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTimelineUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTimelineUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTimelineUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTimelineUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTimelineUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTimelineUnauthorized other = (GetTimelineUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTimelineUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTimelineUnauthorized build() { + + return new GetTimelineUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdBadRequest.java new file mode 100644 index 00000000..5f2884d0 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTokenByPinIdErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTokenByPinIdBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetTokenByPinIdBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTokenByPinIdBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTokenByPinIdBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTokenByPinIdBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTokenByPinIdBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenByPinIdBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenByPinIdBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenByPinIdBadRequest other = (GetTokenByPinIdBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTokenByPinIdBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTokenByPinIdBadRequest build() { + + return new GetTokenByPinIdBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdResponseBody.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdResponseBody.java new file mode 100644 index 00000000..c12fa788 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenByPinIdResponseBody.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTokenByPinIdPlexErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTokenByPinIdResponseBody + * + *

Not Found or Expired + */ +@SuppressWarnings("serial") +public class GetTokenByPinIdResponseBody extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTokenByPinIdResponseBody( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTokenByPinIdResponseBody() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTokenByPinIdResponseBody withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTokenByPinIdResponseBody withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenByPinIdResponseBody withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenByPinIdResponseBody withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenByPinIdResponseBody other = (GetTokenByPinIdResponseBody) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTokenByPinIdResponseBody.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTokenByPinIdResponseBody build() { + + return new GetTokenByPinIdResponseBody( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsBadRequest.java new file mode 100644 index 00000000..5031fc1a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTokenDetailsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTokenDetailsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetTokenDetailsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTokenDetailsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTokenDetailsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTokenDetailsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTokenDetailsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenDetailsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenDetailsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenDetailsBadRequest other = (GetTokenDetailsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTokenDetailsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTokenDetailsBadRequest build() { + + return new GetTokenDetailsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsUnauthorized.java new file mode 100644 index 00000000..f773d1f5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTokenDetailsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTokenDetailsAuthenticationErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTokenDetailsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetTokenDetailsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTokenDetailsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTokenDetailsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTokenDetailsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTokenDetailsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenDetailsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenDetailsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenDetailsUnauthorized other = (GetTokenDetailsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTokenDetailsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTokenDetailsUnauthorized build() { + + return new GetTokenDetailsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentBadRequest.java new file mode 100644 index 00000000..e3a44b03 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTopWatchedContentErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTopWatchedContentBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetTopWatchedContentBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTopWatchedContentBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTopWatchedContentBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTopWatchedContentBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTopWatchedContentBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTopWatchedContentBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTopWatchedContentBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentBadRequest other = (GetTopWatchedContentBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTopWatchedContentBadRequest build() { + + return new GetTopWatchedContentBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentUnauthorized.java new file mode 100644 index 00000000..2f39fba6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTopWatchedContentUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTopWatchedContentLibraryErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTopWatchedContentUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetTopWatchedContentUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTopWatchedContentUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTopWatchedContentUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTopWatchedContentUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTopWatchedContentUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTopWatchedContentUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTopWatchedContentUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentUnauthorized other = (GetTopWatchedContentUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTopWatchedContentUnauthorized build() { + + return new GetTopWatchedContentUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsBadRequest.java new file mode 100644 index 00000000..33c05041 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTranscodeSessionsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTranscodeSessionsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetTranscodeSessionsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTranscodeSessionsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTranscodeSessionsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTranscodeSessionsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTranscodeSessionsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTranscodeSessionsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTranscodeSessionsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTranscodeSessionsBadRequest other = (GetTranscodeSessionsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTranscodeSessionsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTranscodeSessionsBadRequest build() { + + return new GetTranscodeSessionsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsUnauthorized.java new file mode 100644 index 00000000..104b87b6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTranscodeSessionsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTranscodeSessionsSessionsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTranscodeSessionsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetTranscodeSessionsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTranscodeSessionsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTranscodeSessionsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTranscodeSessionsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTranscodeSessionsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTranscodeSessionsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTranscodeSessionsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTranscodeSessionsUnauthorized other = (GetTranscodeSessionsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTranscodeSessionsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTranscodeSessionsUnauthorized build() { + + return new GetTranscodeSessionsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenBadRequest.java new file mode 100644 index 00000000..f7db8fd6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTransientTokenErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTransientTokenBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetTransientTokenBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTransientTokenBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTransientTokenBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTransientTokenBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTransientTokenBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTransientTokenBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTransientTokenBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransientTokenBadRequest other = (GetTransientTokenBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTransientTokenBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTransientTokenBadRequest build() { + + return new GetTransientTokenBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenUnauthorized.java new file mode 100644 index 00000000..346863e7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetTransientTokenUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetTransientTokenAuthenticationErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetTransientTokenUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetTransientTokenUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetTransientTokenUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetTransientTokenUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetTransientTokenUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetTransientTokenUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTransientTokenUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTransientTokenUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransientTokenUnauthorized other = (GetTransientTokenUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTransientTokenUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTransientTokenUnauthorized build() { + + return new GetTransientTokenUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusBadRequest.java new file mode 100644 index 00000000..3f96a42e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetUpdateStatusErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetUpdateStatusBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetUpdateStatusBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetUpdateStatusBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetUpdateStatusBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetUpdateStatusBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetUpdateStatusBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUpdateStatusBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUpdateStatusBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUpdateStatusBadRequest other = (GetUpdateStatusBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetUpdateStatusBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetUpdateStatusBadRequest build() { + + return new GetUpdateStatusBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusUnauthorized.java new file mode 100644 index 00000000..b9914973 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUpdateStatusUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetUpdateStatusUpdaterErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetUpdateStatusUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetUpdateStatusUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetUpdateStatusUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetUpdateStatusUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetUpdateStatusUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetUpdateStatusUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUpdateStatusUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUpdateStatusUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUpdateStatusUnauthorized other = (GetUpdateStatusUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetUpdateStatusUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetUpdateStatusUnauthorized build() { + + return new GetUpdateStatusUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsBadRequest.java new file mode 100644 index 00000000..521fc2e3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetUserFriendsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetUserFriendsBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetUserFriendsBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetUserFriendsBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetUserFriendsBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetUserFriendsBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetUserFriendsBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUserFriendsBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUserFriendsBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserFriendsBadRequest other = (GetUserFriendsBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetUserFriendsBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetUserFriendsBadRequest build() { + + return new GetUserFriendsBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsUnauthorized.java new file mode 100644 index 00000000..684973e9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUserFriendsUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetUserFriendsPlexErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetUserFriendsUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetUserFriendsUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetUserFriendsUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetUserFriendsUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetUserFriendsUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetUserFriendsUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUserFriendsUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUserFriendsUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserFriendsUnauthorized other = (GetUserFriendsUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetUserFriendsUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetUserFriendsUnauthorized build() { + + return new GetUserFriendsUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersBadRequest.java new file mode 100644 index 00000000..8f9bbc0f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetUsersErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetUsersBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetUsersBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetUsersBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetUsersBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetUsersBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetUsersBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUsersBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUsersBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUsersBadRequest other = (GetUsersBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetUsersBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetUsersBadRequest build() { + + return new GetUsersBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersUnauthorized.java new file mode 100644 index 00000000..de9f10cb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetUsersUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetUsersUsersErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetUsersUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetUsersUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetUsersUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetUsersUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetUsersUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetUsersUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUsersUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUsersUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUsersUnauthorized other = (GetUsersUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetUsersUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetUsersUnauthorized build() { + + return new GetUsersUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListBadRequest.java new file mode 100644 index 00000000..e101a020 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetWatchListErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetWatchListBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class GetWatchListBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetWatchListBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetWatchListBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetWatchListBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetWatchListBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetWatchListBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetWatchListBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWatchListBadRequest other = (GetWatchListBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetWatchListBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetWatchListBadRequest build() { + + return new GetWatchListBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListUnauthorized.java new file mode 100644 index 00000000..0cd55187 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/GetWatchListUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.GetWatchListWatchlistErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * GetWatchListUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class GetWatchListUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public GetWatchListUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public GetWatchListUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public GetWatchListUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public GetWatchListUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetWatchListUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetWatchListUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWatchListUnauthorized other = (GetWatchListUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetWatchListUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetWatchListUnauthorized build() { + + return new GetWatchListUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/LogLineBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/LogLineBadRequest.java new file mode 100644 index 00000000..2c346700 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/LogLineBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.LogLineErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * LogLineBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class LogLineBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public LogLineBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public LogLineBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public LogLineBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public LogLineBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogLineBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogLineBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogLineBadRequest other = (LogLineBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(LogLineBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public LogLineBadRequest build() { + + return new LogLineBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/LogLineUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/LogLineUnauthorized.java new file mode 100644 index 00000000..2188e76d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/LogLineUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.LogLineLogErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * LogLineUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class LogLineUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public LogLineUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public LogLineUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public LogLineUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public LogLineUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogLineUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogLineUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogLineUnauthorized other = (LogLineUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(LogLineUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public LogLineUnauthorized build() { + + return new LogLineUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineBadRequest.java new file mode 100644 index 00000000..14c62341 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.LogMultiLineErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * LogMultiLineBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class LogMultiLineBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public LogMultiLineBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public LogMultiLineBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public LogMultiLineBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public LogMultiLineBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogMultiLineBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogMultiLineBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogMultiLineBadRequest other = (LogMultiLineBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(LogMultiLineBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public LogMultiLineBadRequest build() { + + return new LogMultiLineBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineUnauthorized.java new file mode 100644 index 00000000..5dfb4eb0 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/LogMultiLineUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.LogMultiLineLogErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * LogMultiLineUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class LogMultiLineUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public LogMultiLineUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public LogMultiLineUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public LogMultiLineUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public LogMultiLineUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogMultiLineUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogMultiLineUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogMultiLineUnauthorized other = (LogMultiLineUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(LogMultiLineUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public LogMultiLineUnauthorized build() { + + return new LogMultiLineUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedBadRequest.java new file mode 100644 index 00000000..ef786afc --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.MarkPlayedErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * MarkPlayedBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class MarkPlayedBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public MarkPlayedBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public MarkPlayedBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public MarkPlayedBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public MarkPlayedBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkPlayedBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkPlayedBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkPlayedBadRequest other = (MarkPlayedBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(MarkPlayedBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public MarkPlayedBadRequest build() { + + return new MarkPlayedBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedUnauthorized.java new file mode 100644 index 00000000..b6371ae7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/MarkPlayedUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.MarkPlayedMediaErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * MarkPlayedUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class MarkPlayedUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public MarkPlayedUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public MarkPlayedUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public MarkPlayedUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public MarkPlayedUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkPlayedUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkPlayedUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkPlayedUnauthorized other = (MarkPlayedUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(MarkPlayedUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public MarkPlayedUnauthorized build() { + + return new MarkPlayedUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedBadRequest.java new file mode 100644 index 00000000..37af0b96 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.MarkUnplayedErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * MarkUnplayedBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class MarkUnplayedBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public MarkUnplayedBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public MarkUnplayedBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public MarkUnplayedBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public MarkUnplayedBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkUnplayedBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkUnplayedBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkUnplayedBadRequest other = (MarkUnplayedBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(MarkUnplayedBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public MarkUnplayedBadRequest build() { + + return new MarkUnplayedBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedUnauthorized.java new file mode 100644 index 00000000..274837d1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/MarkUnplayedUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.MarkUnplayedMediaErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * MarkUnplayedUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class MarkUnplayedUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public MarkUnplayedUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public MarkUnplayedUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public MarkUnplayedUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public MarkUnplayedUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkUnplayedUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkUnplayedUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkUnplayedUnauthorized other = (MarkUnplayedUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(MarkUnplayedUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public MarkUnplayedUnauthorized build() { + + return new MarkUnplayedUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchBadRequest.java new file mode 100644 index 00000000..17613379 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.PerformSearchErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * PerformSearchBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class PerformSearchBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public PerformSearchBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public PerformSearchBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public PerformSearchBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public PerformSearchBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformSearchBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformSearchBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerformSearchBadRequest other = (PerformSearchBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PerformSearchBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PerformSearchBadRequest build() { + + return new PerformSearchBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchUnauthorized.java new file mode 100644 index 00000000..ed8c5c35 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/PerformSearchUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.PerformSearchSearchErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * PerformSearchUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class PerformSearchUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public PerformSearchUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public PerformSearchUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public PerformSearchUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public PerformSearchUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformSearchUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformSearchUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerformSearchUnauthorized other = (PerformSearchUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PerformSearchUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PerformSearchUnauthorized build() { + + return new PerformSearchUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchBadRequest.java new file mode 100644 index 00000000..b1a52df5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.PerformVoiceSearchErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * PerformVoiceSearchBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class PerformVoiceSearchBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public PerformVoiceSearchBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public PerformVoiceSearchBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public PerformVoiceSearchBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public PerformVoiceSearchBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformVoiceSearchBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformVoiceSearchBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerformVoiceSearchBadRequest other = (PerformVoiceSearchBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PerformVoiceSearchBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PerformVoiceSearchBadRequest build() { + + return new PerformVoiceSearchBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchUnauthorized.java new file mode 100644 index 00000000..d4fd1122 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/PerformVoiceSearchUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.PerformVoiceSearchSearchErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * PerformVoiceSearchUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class PerformVoiceSearchUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public PerformVoiceSearchUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public PerformVoiceSearchUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public PerformVoiceSearchUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public PerformVoiceSearchUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformVoiceSearchUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformVoiceSearchUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerformVoiceSearchUnauthorized other = (PerformVoiceSearchUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PerformVoiceSearchUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PerformVoiceSearchUnauthorized build() { + + return new PerformVoiceSearchUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataBadRequest.java new file mode 100644 index 00000000..83ac2655 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.PostUsersSignInDataErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * PostUsersSignInDataBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class PostUsersSignInDataBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public PostUsersSignInDataBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public PostUsersSignInDataBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public PostUsersSignInDataBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public PostUsersSignInDataBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PostUsersSignInDataBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PostUsersSignInDataBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostUsersSignInDataBadRequest other = (PostUsersSignInDataBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PostUsersSignInDataBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PostUsersSignInDataBadRequest build() { + + return new PostUsersSignInDataBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataUnauthorized.java new file mode 100644 index 00000000..7a6476f9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/PostUsersSignInDataUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.PostUsersSignInDataAuthenticationErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * PostUsersSignInDataUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class PostUsersSignInDataUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public PostUsersSignInDataUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public PostUsersSignInDataUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public PostUsersSignInDataUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public PostUsersSignInDataUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PostUsersSignInDataUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PostUsersSignInDataUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostUsersSignInDataUnauthorized other = (PostUsersSignInDataUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PostUsersSignInDataUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PostUsersSignInDataUnauthorized build() { + + return new PostUsersSignInDataUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksBadRequest.java new file mode 100644 index 00000000..c82edc82 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StartAllTasksErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StartAllTasksBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class StartAllTasksBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StartAllTasksBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartAllTasksBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StartAllTasksBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StartAllTasksBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartAllTasksBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartAllTasksBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartAllTasksBadRequest other = (StartAllTasksBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartAllTasksBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartAllTasksBadRequest build() { + + return new StartAllTasksBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksUnauthorized.java new file mode 100644 index 00000000..ba3ce802 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StartAllTasksUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StartAllTasksButlerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StartAllTasksUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class StartAllTasksUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StartAllTasksUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartAllTasksUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StartAllTasksUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StartAllTasksUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartAllTasksUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartAllTasksUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartAllTasksUnauthorized other = (StartAllTasksUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartAllTasksUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartAllTasksUnauthorized build() { + + return new StartAllTasksUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskBadRequest.java new file mode 100644 index 00000000..7fa451ef --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StartTaskErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StartTaskBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class StartTaskBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StartTaskBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartTaskBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StartTaskBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StartTaskBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartTaskBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartTaskBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartTaskBadRequest other = (StartTaskBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartTaskBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartTaskBadRequest build() { + + return new StartTaskBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskUnauthorized.java new file mode 100644 index 00000000..f56da7dd --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StartTaskUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StartTaskButlerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StartTaskUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class StartTaskUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StartTaskUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartTaskUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StartTaskUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StartTaskUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartTaskUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartTaskUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartTaskUnauthorized other = (StartTaskUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartTaskUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartTaskUnauthorized build() { + + return new StartTaskUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeBadRequest.java new file mode 100644 index 00000000..5d7fc529 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StartUniversalTranscodeErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StartUniversalTranscodeBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class StartUniversalTranscodeBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StartUniversalTranscodeBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartUniversalTranscodeBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StartUniversalTranscodeBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StartUniversalTranscodeBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartUniversalTranscodeBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartUniversalTranscodeBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartUniversalTranscodeBadRequest other = (StartUniversalTranscodeBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartUniversalTranscodeBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartUniversalTranscodeBadRequest build() { + + return new StartUniversalTranscodeBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeUnauthorized.java new file mode 100644 index 00000000..59ee3cfa --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StartUniversalTranscodeUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StartUniversalTranscodeVideoErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StartUniversalTranscodeUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class StartUniversalTranscodeUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StartUniversalTranscodeUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StartUniversalTranscodeUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StartUniversalTranscodeUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StartUniversalTranscodeUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartUniversalTranscodeUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartUniversalTranscodeUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartUniversalTranscodeUnauthorized other = (StartUniversalTranscodeUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartUniversalTranscodeUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartUniversalTranscodeUnauthorized build() { + + return new StartUniversalTranscodeUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksBadRequest.java new file mode 100644 index 00000000..29e01c9c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StopAllTasksErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StopAllTasksBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class StopAllTasksBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StopAllTasksBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopAllTasksBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StopAllTasksBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StopAllTasksBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopAllTasksBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopAllTasksBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopAllTasksBadRequest other = (StopAllTasksBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopAllTasksBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopAllTasksBadRequest build() { + + return new StopAllTasksBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksUnauthorized.java new file mode 100644 index 00000000..356f90e8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StopAllTasksUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StopAllTasksButlerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StopAllTasksUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class StopAllTasksUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StopAllTasksUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopAllTasksUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StopAllTasksUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StopAllTasksUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopAllTasksUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopAllTasksUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopAllTasksUnauthorized other = (StopAllTasksUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopAllTasksUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopAllTasksUnauthorized build() { + + return new StopAllTasksUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskBadRequest.java new file mode 100644 index 00000000..528fb3a9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StopTaskErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StopTaskBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class StopTaskBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StopTaskBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopTaskBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StopTaskBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StopTaskBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTaskBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTaskBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopTaskBadRequest other = (StopTaskBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopTaskBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopTaskBadRequest build() { + + return new StopTaskBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskUnauthorized.java new file mode 100644 index 00000000..86f863e4 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StopTaskUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StopTaskButlerErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StopTaskUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class StopTaskUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StopTaskUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopTaskUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StopTaskUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StopTaskUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTaskUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTaskUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopTaskUnauthorized other = (StopTaskUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopTaskUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopTaskUnauthorized build() { + + return new StopTaskUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionBadRequest.java new file mode 100644 index 00000000..9e203287 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StopTranscodeSessionErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StopTranscodeSessionBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class StopTranscodeSessionBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StopTranscodeSessionBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopTranscodeSessionBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StopTranscodeSessionBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StopTranscodeSessionBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTranscodeSessionBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTranscodeSessionBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopTranscodeSessionBadRequest other = (StopTranscodeSessionBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopTranscodeSessionBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopTranscodeSessionBadRequest build() { + + return new StopTranscodeSessionBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionUnauthorized.java new file mode 100644 index 00000000..1da70cfb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/StopTranscodeSessionUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.StopTranscodeSessionSessionsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * StopTranscodeSessionUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class StopTranscodeSessionUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public StopTranscodeSessionUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public StopTranscodeSessionUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public StopTranscodeSessionUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public StopTranscodeSessionUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTranscodeSessionUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTranscodeSessionUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopTranscodeSessionUnauthorized other = (StopTranscodeSessionUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopTranscodeSessionUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopTranscodeSessionUnauthorized build() { + + return new StopTranscodeSessionUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressBadRequest.java new file mode 100644 index 00000000..acceabf5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.UpdatePlayProgressErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * UpdatePlayProgressBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class UpdatePlayProgressBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public UpdatePlayProgressBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public UpdatePlayProgressBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public UpdatePlayProgressBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public UpdatePlayProgressBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlayProgressBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlayProgressBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePlayProgressBadRequest other = (UpdatePlayProgressBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdatePlayProgressBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UpdatePlayProgressBadRequest build() { + + return new UpdatePlayProgressBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressUnauthorized.java new file mode 100644 index 00000000..e36c445b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlayProgressUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.UpdatePlayProgressMediaErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * UpdatePlayProgressUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class UpdatePlayProgressUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public UpdatePlayProgressUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public UpdatePlayProgressUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public UpdatePlayProgressUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public UpdatePlayProgressUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlayProgressUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlayProgressUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePlayProgressUnauthorized other = (UpdatePlayProgressUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdatePlayProgressUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UpdatePlayProgressUnauthorized build() { + + return new UpdatePlayProgressUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistBadRequest.java new file mode 100644 index 00000000..520a9f84 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.UpdatePlaylistErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * UpdatePlaylistBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class UpdatePlaylistBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public UpdatePlaylistBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public UpdatePlaylistBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public UpdatePlaylistBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public UpdatePlaylistBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlaylistBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlaylistBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePlaylistBadRequest other = (UpdatePlaylistBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdatePlaylistBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UpdatePlaylistBadRequest build() { + + return new UpdatePlaylistBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistUnauthorized.java new file mode 100644 index 00000000..c1ecdd1e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/UpdatePlaylistUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.UpdatePlaylistPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * UpdatePlaylistUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class UpdatePlaylistUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public UpdatePlaylistUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public UpdatePlaylistUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public UpdatePlaylistUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public UpdatePlaylistUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlaylistUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlaylistUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePlaylistUnauthorized other = (UpdatePlaylistUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdatePlaylistUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UpdatePlaylistUnauthorized build() { + + return new UpdatePlaylistUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistBadRequest.java b/src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistBadRequest.java new file mode 100644 index 00000000..c055552c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistBadRequest.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.UploadPlaylistErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * UploadPlaylistBadRequest + * + *

Bad Request - A parameter was not specified, or was specified incorrectly. + */ +@SuppressWarnings("serial") +public class UploadPlaylistBadRequest extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public UploadPlaylistBadRequest( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public UploadPlaylistBadRequest() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public UploadPlaylistBadRequest withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public UploadPlaylistBadRequest withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadPlaylistBadRequest withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadPlaylistBadRequest withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadPlaylistBadRequest other = (UploadPlaylistBadRequest) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UploadPlaylistBadRequest.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UploadPlaylistBadRequest build() { + + return new UploadPlaylistBadRequest( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistUnauthorized.java b/src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistUnauthorized.java new file mode 100644 index 00000000..541d3507 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/errors/async/UploadPlaylistUnauthorized.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.errors.async; + +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.models.errors.UploadPlaylistPlaylistsErrors; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Override; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + +/** + * UploadPlaylistUnauthorized + * + *

Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + */ +@SuppressWarnings("serial") +public class UploadPlaylistUnauthorized extends RuntimeException { + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("errors") + private Optional> errors; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("RawResponse") + private Optional> rawResponse; + + @JsonCreator + public UploadPlaylistUnauthorized( + @JsonProperty("errors") Optional> errors, + @JsonProperty("RawResponse") Optional> rawResponse) { + super("API error occurred"); + Utils.checkNotNull(errors, "errors"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.errors = errors; + this.rawResponse = rawResponse; + } + + public UploadPlaylistUnauthorized() { + this(Optional.empty(), Optional.empty()); + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> errors() { + return (Optional>) errors; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> rawResponse() { + return (Optional>) rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + public UploadPlaylistUnauthorized withErrors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + + public UploadPlaylistUnauthorized withErrors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadPlaylistUnauthorized withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadPlaylistUnauthorized withRawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadPlaylistUnauthorized other = (UploadPlaylistUnauthorized) o; + return + Utils.enhancedDeepEquals(this.errors, other.errors) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + errors, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UploadPlaylistUnauthorized.class, + "errors", errors, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional> errors = Optional.empty(); + + private Optional> rawResponse; + + private Builder() { + // force use of static builder() method + } + + + public Builder errors(List errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = Optional.ofNullable(errors); + return this; + } + + public Builder errors(Optional> errors) { + Utils.checkNotNull(errors, "errors"); + this.errors = errors; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = Optional.ofNullable(rawResponse); + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(Optional> rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UploadPlaylistUnauthorized build() { + + return new UploadPlaylistUnauthorized( + errors, rawResponse); + } + + } +} + diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Account.java b/src/main/java/dev/plexapi/sdk/models/operations/Account.java index 8c06e241..d487dd6b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Account.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Account.java @@ -13,39 +13,46 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class Account { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") private Optional name; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultAudioLanguage") private Optional defaultAudioLanguage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("autoSelectAudio") private Optional autoSelectAudio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleLanguage") private Optional defaultSubtitleLanguage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtitleMode") private Optional subtitleMode; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; @@ -79,7 +86,9 @@ public class Account { } public Account() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -122,9 +131,10 @@ public class Account { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Account withId(int id) { Utils.checkNotNull(id, "id"); @@ -132,6 +142,7 @@ public class Account { return this; } + public Account withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -144,6 +155,7 @@ public class Account { return this; } + public Account withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -156,6 +168,7 @@ public class Account { return this; } + public Account withName(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; @@ -168,6 +181,7 @@ public class Account { return this; } + public Account withDefaultAudioLanguage(Optional defaultAudioLanguage) { Utils.checkNotNull(defaultAudioLanguage, "defaultAudioLanguage"); this.defaultAudioLanguage = defaultAudioLanguage; @@ -180,6 +194,7 @@ public class Account { return this; } + public Account withAutoSelectAudio(Optional autoSelectAudio) { Utils.checkNotNull(autoSelectAudio, "autoSelectAudio"); this.autoSelectAudio = autoSelectAudio; @@ -192,6 +207,7 @@ public class Account { return this; } + public Account withDefaultSubtitleLanguage(Optional defaultSubtitleLanguage) { Utils.checkNotNull(defaultSubtitleLanguage, "defaultSubtitleLanguage"); this.defaultSubtitleLanguage = defaultSubtitleLanguage; @@ -204,6 +220,7 @@ public class Account { return this; } + public Account withSubtitleMode(Optional subtitleMode) { Utils.checkNotNull(subtitleMode, "subtitleMode"); this.subtitleMode = subtitleMode; @@ -216,13 +233,13 @@ public class Account { return this; } + public Account withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -233,27 +250,22 @@ public class Account { } Account other = (Account) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.defaultAudioLanguage, other.defaultAudioLanguage) && - Objects.deepEquals(this.autoSelectAudio, other.autoSelectAudio) && - Objects.deepEquals(this.defaultSubtitleLanguage, other.defaultSubtitleLanguage) && - Objects.deepEquals(this.subtitleMode, other.subtitleMode) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.defaultAudioLanguage, other.defaultAudioLanguage) && + Utils.enhancedDeepEquals(this.autoSelectAudio, other.autoSelectAudio) && + Utils.enhancedDeepEquals(this.defaultSubtitleLanguage, other.defaultSubtitleLanguage) && + Utils.enhancedDeepEquals(this.subtitleMode, other.subtitleMode) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - key, - name, - defaultAudioLanguage, - autoSelectAudio, - defaultSubtitleLanguage, - subtitleMode, - thumb); + return Utils.enhancedHash( + id, key, name, + defaultAudioLanguage, autoSelectAudio, defaultSubtitleLanguage, + subtitleMode, thumb); } @Override @@ -268,29 +280,31 @@ public class Account { "subtitleMode", subtitleMode, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional name = Optional.empty(); - + private Optional defaultAudioLanguage = Optional.empty(); - + private Optional autoSelectAudio = Optional.empty(); - + private Optional defaultSubtitleLanguage = Optional.empty(); - + private Optional subtitleMode = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -303,6 +317,7 @@ public class Account { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -315,6 +330,7 @@ public class Account { return this; } + public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); @@ -327,6 +343,7 @@ public class Account { return this; } + public Builder defaultAudioLanguage(String defaultAudioLanguage) { Utils.checkNotNull(defaultAudioLanguage, "defaultAudioLanguage"); this.defaultAudioLanguage = Optional.ofNullable(defaultAudioLanguage); @@ -339,6 +356,7 @@ public class Account { return this; } + public Builder autoSelectAudio(boolean autoSelectAudio) { Utils.checkNotNull(autoSelectAudio, "autoSelectAudio"); this.autoSelectAudio = Optional.ofNullable(autoSelectAudio); @@ -351,6 +369,7 @@ public class Account { return this; } + public Builder defaultSubtitleLanguage(String defaultSubtitleLanguage) { Utils.checkNotNull(defaultSubtitleLanguage, "defaultSubtitleLanguage"); this.defaultSubtitleLanguage = Optional.ofNullable(defaultSubtitleLanguage); @@ -363,6 +382,7 @@ public class Account { return this; } + public Builder subtitleMode(int subtitleMode) { Utils.checkNotNull(subtitleMode, "subtitleMode"); this.subtitleMode = Optional.ofNullable(subtitleMode); @@ -375,6 +395,7 @@ public class Account { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -386,17 +407,14 @@ public class Account { this.thumb = thumb; return this; } - + public Account build() { + return new Account( - id, - key, - name, - defaultAudioLanguage, - autoSelectAudio, - defaultSubtitleLanguage, - subtitleMode, - thumb); + id, key, name, + defaultAudioLanguage, autoSelectAudio, defaultSubtitleLanguage, + subtitleMode, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Action.java b/src/main/java/dev/plexapi/sdk/models/operations/Action.java index 5da2ecda..9c8c5914 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Action.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Action.java @@ -9,13 +9,14 @@ 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 Action { @JsonProperty("id") private String id; + @JsonProperty("key") private String key; @@ -39,9 +40,10 @@ public class Action { return key; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Action withId(String id) { Utils.checkNotNull(id, "id"); @@ -55,7 +57,6 @@ public class Action { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,15 +67,14 @@ public class Action { } Action other = (Action) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key); } @Override public int hashCode() { - return Objects.hash( - id, - key); + return Utils.enhancedHash( + id, key); } @Override @@ -83,33 +83,37 @@ public class Action { "id", id, "key", key); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String id; - + private String key; - + private Builder() { // force use of static builder() method } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = key; return this; } - + public Action build() { + return new Action( - id, - key); + id, key); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java index c7caa97c..f86be99f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ActiveDirection.java @@ -20,7 +20,7 @@ public enum ActiveDirection { @JsonValue private final String value; - private ActiveDirection(String value) { + ActiveDirection(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Activity.java b/src/main/java/dev/plexapi/sdk/models/operations/Activity.java index ca9b58fc..fa19cc6d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Activity.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Activity.java @@ -14,39 +14,46 @@ import java.lang.Double; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; + public class Activity { @JsonInclude(Include.NON_ABSENT) @JsonProperty("uuid") private Optional uuid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("cancellable") private Optional cancellable; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("userID") private Optional userID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtitle") private Optional subtitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("progress") private Optional progress; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Context") private Optional context; @@ -80,7 +87,9 @@ public class Activity { } public Activity() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -124,9 +133,10 @@ public class Activity { return (Optional) context; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Activity withUuid(String uuid) { Utils.checkNotNull(uuid, "uuid"); @@ -134,6 +144,7 @@ public class Activity { return this; } + public Activity withUuid(Optional uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = uuid; @@ -146,6 +157,7 @@ public class Activity { return this; } + public Activity withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -158,6 +170,7 @@ public class Activity { return this; } + public Activity withCancellable(Optional cancellable) { Utils.checkNotNull(cancellable, "cancellable"); this.cancellable = cancellable; @@ -170,6 +183,7 @@ public class Activity { return this; } + public Activity withUserID(Optional userID) { Utils.checkNotNull(userID, "userID"); this.userID = userID; @@ -182,6 +196,7 @@ public class Activity { return this; } + public Activity withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -194,6 +209,7 @@ public class Activity { return this; } + public Activity withSubtitle(Optional subtitle) { Utils.checkNotNull(subtitle, "subtitle"); this.subtitle = subtitle; @@ -206,6 +222,7 @@ public class Activity { return this; } + public Activity withProgress(Optional progress) { Utils.checkNotNull(progress, "progress"); this.progress = progress; @@ -218,13 +235,13 @@ public class Activity { return this; } + public Activity withContext(Optional context) { Utils.checkNotNull(context, "context"); this.context = context; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -235,27 +252,22 @@ public class Activity { } Activity other = (Activity) o; return - Objects.deepEquals(this.uuid, other.uuid) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.cancellable, other.cancellable) && - Objects.deepEquals(this.userID, other.userID) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.subtitle, other.subtitle) && - Objects.deepEquals(this.progress, other.progress) && - Objects.deepEquals(this.context, other.context); + Utils.enhancedDeepEquals(this.uuid, other.uuid) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.cancellable, other.cancellable) && + Utils.enhancedDeepEquals(this.userID, other.userID) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.subtitle, other.subtitle) && + Utils.enhancedDeepEquals(this.progress, other.progress) && + Utils.enhancedDeepEquals(this.context, other.context); } @Override public int hashCode() { - return Objects.hash( - uuid, - type, - cancellable, - userID, - title, - subtitle, - progress, - context); + return Utils.enhancedHash( + uuid, type, cancellable, + userID, title, subtitle, + progress, context); } @Override @@ -270,29 +282,31 @@ public class Activity { "progress", progress, "context", context); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional uuid = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional cancellable = Optional.empty(); - + private Optional userID = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional subtitle = Optional.empty(); - + private Optional progress = Optional.empty(); - + private Optional context = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder uuid(String uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = Optional.ofNullable(uuid); @@ -305,6 +319,7 @@ public class Activity { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -317,6 +332,7 @@ public class Activity { return this; } + public Builder cancellable(boolean cancellable) { Utils.checkNotNull(cancellable, "cancellable"); this.cancellable = Optional.ofNullable(cancellable); @@ -329,6 +345,7 @@ public class Activity { return this; } + public Builder userID(double userID) { Utils.checkNotNull(userID, "userID"); this.userID = Optional.ofNullable(userID); @@ -341,6 +358,7 @@ public class Activity { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -353,6 +371,7 @@ public class Activity { return this; } + public Builder subtitle(String subtitle) { Utils.checkNotNull(subtitle, "subtitle"); this.subtitle = Optional.ofNullable(subtitle); @@ -365,6 +384,7 @@ public class Activity { return this; } + public Builder progress(double progress) { Utils.checkNotNull(progress, "progress"); this.progress = Optional.ofNullable(progress); @@ -377,6 +397,7 @@ public class Activity { return this; } + public Builder context(Context context) { Utils.checkNotNull(context, "context"); this.context = Optional.ofNullable(context); @@ -388,17 +409,14 @@ public class Activity { this.context = context; return this; } - + public Activity build() { + return new Activity( - uuid, - type, - cancellable, - userID, - title, - subtitle, - progress, - context); + uuid, type, cancellable, + userID, title, subtitle, + progress, context); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsMediaContainer.java index 9281a6a6..15aba7c3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsMediaContainer.java @@ -14,23 +14,26 @@ 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 AddPlaylistContentsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCountAdded") private Optional leafCountAdded; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCountRequested") private Optional leafCountRequested; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -52,7 +55,8 @@ public class AddPlaylistContentsMediaContainer { } public AddPlaylistContentsMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -76,9 +80,10 @@ public class AddPlaylistContentsMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public AddPlaylistContentsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -86,6 +91,7 @@ public class AddPlaylistContentsMediaContainer { return this; } + public AddPlaylistContentsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -98,6 +104,7 @@ public class AddPlaylistContentsMediaContainer { return this; } + public AddPlaylistContentsMediaContainer withLeafCountAdded(Optional leafCountAdded) { Utils.checkNotNull(leafCountAdded, "leafCountAdded"); this.leafCountAdded = leafCountAdded; @@ -110,6 +117,7 @@ public class AddPlaylistContentsMediaContainer { return this; } + public AddPlaylistContentsMediaContainer withLeafCountRequested(Optional leafCountRequested) { Utils.checkNotNull(leafCountRequested, "leafCountRequested"); this.leafCountRequested = leafCountRequested; @@ -122,13 +130,13 @@ public class AddPlaylistContentsMediaContainer { return this; } + public AddPlaylistContentsMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,18 +147,16 @@ public class AddPlaylistContentsMediaContainer { } AddPlaylistContentsMediaContainer other = (AddPlaylistContentsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.leafCountAdded, other.leafCountAdded) && - Objects.deepEquals(this.leafCountRequested, other.leafCountRequested) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.leafCountAdded, other.leafCountAdded) && + Utils.enhancedDeepEquals(this.leafCountRequested, other.leafCountRequested) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - leafCountAdded, - leafCountRequested, + return Utils.enhancedHash( + size, leafCountAdded, leafCountRequested, metadata); } @@ -162,21 +168,23 @@ public class AddPlaylistContentsMediaContainer { "leafCountRequested", leafCountRequested, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional leafCountAdded = Optional.empty(); - + private Optional leafCountRequested = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -189,6 +197,7 @@ public class AddPlaylistContentsMediaContainer { return this; } + public Builder leafCountAdded(int leafCountAdded) { Utils.checkNotNull(leafCountAdded, "leafCountAdded"); this.leafCountAdded = Optional.ofNullable(leafCountAdded); @@ -201,6 +210,7 @@ public class AddPlaylistContentsMediaContainer { return this; } + public Builder leafCountRequested(int leafCountRequested) { Utils.checkNotNull(leafCountRequested, "leafCountRequested"); this.leafCountRequested = Optional.ofNullable(leafCountRequested); @@ -213,6 +223,7 @@ public class AddPlaylistContentsMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -224,13 +235,13 @@ public class AddPlaylistContentsMediaContainer { this.metadata = metadata; return this; } - + public AddPlaylistContentsMediaContainer build() { + return new AddPlaylistContentsMediaContainer( - size, - leafCountAdded, - leafCountRequested, + size, leafCountAdded, leafCountRequested, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsMetadata.java index 2b28db06..d251675c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsMetadata.java @@ -13,59 +13,71 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class AddPlaylistContentsMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("smart") private Optional smart; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("playlistType") private Optional playlistType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("composite") private Optional composite; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; @@ -114,7 +126,11 @@ public class AddPlaylistContentsMetadata { } public AddPlaylistContentsMetadata() { - 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()); + 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()); } @JsonIgnore @@ -182,9 +198,10 @@ public class AddPlaylistContentsMetadata { return updatedAt; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public AddPlaylistContentsMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -192,6 +209,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -204,6 +222,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -216,6 +235,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -228,6 +248,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -240,6 +261,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -252,6 +274,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -264,6 +287,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withSmart(Optional smart) { Utils.checkNotNull(smart, "smart"); this.smart = smart; @@ -276,6 +300,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withPlaylistType(Optional playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = playlistType; @@ -288,6 +313,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withComposite(Optional composite) { Utils.checkNotNull(composite, "composite"); this.composite = composite; @@ -300,6 +326,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -312,6 +339,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -324,6 +352,7 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -336,13 +365,13 @@ public class AddPlaylistContentsMetadata { return this; } + public AddPlaylistContentsMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,36 +382,28 @@ public class AddPlaylistContentsMetadata { } AddPlaylistContentsMetadata other = (AddPlaylistContentsMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.smart, other.smart) && - Objects.deepEquals(this.playlistType, other.playlistType) && - Objects.deepEquals(this.composite, other.composite) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.smart, other.smart) && + Utils.enhancedDeepEquals(this.playlistType, other.playlistType) && + Utils.enhancedDeepEquals(this.composite, other.composite) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - type, - title, - summary, - smart, - playlistType, - composite, - duration, - leafCount, - addedAt, + return Utils.enhancedHash( + ratingKey, key, guid, + type, title, summary, + smart, playlistType, composite, + duration, leafCount, addedAt, updatedAt); } @@ -403,39 +424,41 @@ public class AddPlaylistContentsMetadata { "addedAt", addedAt, "updatedAt", updatedAt); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional smart = Optional.empty(); - + private Optional playlistType = Optional.empty(); - + private Optional composite = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -448,6 +471,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -460,6 +484,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -472,6 +497,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -484,6 +510,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -496,6 +523,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -508,6 +536,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder smart(boolean smart) { Utils.checkNotNull(smart, "smart"); this.smart = Optional.ofNullable(smart); @@ -520,6 +549,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder playlistType(String playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = Optional.ofNullable(playlistType); @@ -532,6 +562,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder composite(String composite) { Utils.checkNotNull(composite, "composite"); this.composite = Optional.ofNullable(composite); @@ -544,6 +575,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -556,6 +588,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -568,6 +601,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -580,6 +614,7 @@ public class AddPlaylistContentsMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -591,22 +626,16 @@ public class AddPlaylistContentsMetadata { this.updatedAt = updatedAt; return this; } - + public AddPlaylistContentsMetadata build() { + return new AddPlaylistContentsMetadata( - ratingKey, - key, - guid, - type, - title, - summary, - smart, - playlistType, - composite, - duration, - leafCount, - addedAt, + ratingKey, key, guid, + type, title, summary, + smart, playlistType, composite, + duration, leafCount, addedAt, updatedAt); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequest.java index c5f3b643..e86cf8af 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class AddPlaylistContentsRequest { +public class AddPlaylistContentsRequest { /** * the ID of the playlist */ @@ -76,9 +75,10 @@ public class AddPlaylistContentsRequest { return playQueueID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the ID of the playlist @@ -107,6 +107,7 @@ public class AddPlaylistContentsRequest { return this; } + /** * the play queue to add to a playlist */ @@ -116,7 +117,6 @@ public class AddPlaylistContentsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -127,17 +127,15 @@ public class AddPlaylistContentsRequest { } AddPlaylistContentsRequest other = (AddPlaylistContentsRequest) o; return - Objects.deepEquals(this.playlistID, other.playlistID) && - Objects.deepEquals(this.uri, other.uri) && - Objects.deepEquals(this.playQueueID, other.playQueueID); + Utils.enhancedDeepEquals(this.playlistID, other.playlistID) && + Utils.enhancedDeepEquals(this.uri, other.uri) && + Utils.enhancedDeepEquals(this.playQueueID, other.playQueueID); } @Override public int hashCode() { - return Objects.hash( - playlistID, - uri, - playQueueID); + return Utils.enhancedHash( + playlistID, uri, playQueueID); } @Override @@ -147,19 +145,21 @@ public class AddPlaylistContentsRequest { "uri", uri, "playQueueID", playQueueID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double playlistID; - + private String uri; - + private Optional playQueueID = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * the ID of the playlist */ @@ -169,6 +169,7 @@ public class AddPlaylistContentsRequest { return this; } + /** * the content URI for the playlist */ @@ -178,6 +179,7 @@ public class AddPlaylistContentsRequest { return this; } + /** * the play queue to add to a playlist */ @@ -195,12 +197,12 @@ public class AddPlaylistContentsRequest { this.playQueueID = playQueueID; return this; } - + public AddPlaylistContentsRequest build() { + return new AddPlaylistContentsRequest( - playlistID, - uri, - playQueueID); + playlistID, uri, playQueueID); } + } } 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 8a6636b7..9a982077 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.AddPlaylistContents; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -14,10 +18,10 @@ public class AddPlaylistContentsRequestBuilder { private Double playlistID; private String uri; private Optional playQueueID = Optional.empty(); - private final SDKMethodInterfaces.MethodCallAddPlaylistContents sdk; + private final SDKConfiguration sdkConfiguration; - public AddPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallAddPlaylistContents sdk) { - this.sdk = sdk; + public AddPlaylistContentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public AddPlaylistContentsRequestBuilder playlistID(double playlistID) { @@ -44,11 +48,22 @@ public class AddPlaylistContentsRequestBuilder { return this; } - public AddPlaylistContentsResponse call() throws Exception { - return sdk.addPlaylistContents( - playlistID, + private AddPlaylistContentsRequest buildRequest() { + + AddPlaylistContentsRequest request = new AddPlaylistContentsRequest(playlistID, uri, playQueueID); + + return request; + } + + public AddPlaylistContentsResponse call() throws Exception { + + RequestOperation operation + = new AddPlaylistContents.Sync(sdkConfiguration); + AddPlaylistContentsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsResponse.java index b0ed7a5b..2484ed66 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class AddPlaylistContentsResponse implements Response { +public class AddPlaylistContentsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class AddPlaylistContentsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class AddPlaylistContentsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class AddPlaylistContentsResponse implements Response { return this; } + /** * Playlist Updated */ @@ -143,7 +145,6 @@ public class AddPlaylistContentsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class AddPlaylistContentsResponse implements Response { } AddPlaylistContentsResponse other = (AddPlaylistContentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class AddPlaylistContentsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class AddPlaylistContentsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class AddPlaylistContentsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class AddPlaylistContentsResponse implements Response { return this; } + /** * Playlist Updated */ @@ -236,13 +240,13 @@ public class AddPlaylistContentsResponse implements Response { this.object = object; return this; } - + public AddPlaylistContentsResponse build() { + return new AddPlaylistContentsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsResponseBody.java index 3c1f3632..7e779b2f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AddPlaylistContentsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class AddPlaylistContentsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public AddPlaylistContentsResponseBody withMediaContainer(AddPlaylistContentsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class AddPlaylistContentsResponseBody { return this; } + public AddPlaylistContentsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class AddPlaylistContentsResponseBody { } AddPlaylistContentsResponseBody other = (AddPlaylistContentsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class AddPlaylistContentsResponseBody { return Utils.toString(AddPlaylistContentsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(AddPlaylistContentsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class AddPlaylistContentsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public AddPlaylistContentsResponseBody build() { + return new AddPlaylistContentsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AllLibraries.java b/src/main/java/dev/plexapi/sdk/models/operations/AllLibraries.java index 94008238..c1abe1a9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AllLibraries.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AllLibraries.java @@ -19,7 +19,7 @@ public enum AllLibraries { @JsonValue private final int value; - private AllLibraries(int value) { + AllLibraries(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AllowCameraUpload.java b/src/main/java/dev/plexapi/sdk/models/operations/AllowCameraUpload.java index 0dae86eb..a8d7337c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AllowCameraUpload.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AllowCameraUpload.java @@ -19,7 +19,7 @@ public enum AllowCameraUpload { @JsonValue private final int value; - private AllowCameraUpload(int value) { + AllowCameraUpload(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AllowChannels.java b/src/main/java/dev/plexapi/sdk/models/operations/AllowChannels.java index e0f3b4b4..c9babd16 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AllowChannels.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AllowChannels.java @@ -19,7 +19,7 @@ public enum AllowChannels { @JsonValue private final int value; - private AllowChannels(int value) { + AllowChannels(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AllowSubtitleAdmin.java b/src/main/java/dev/plexapi/sdk/models/operations/AllowSubtitleAdmin.java index a682ea86..6294583c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AllowSubtitleAdmin.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AllowSubtitleAdmin.java @@ -19,7 +19,7 @@ public enum AllowSubtitleAdmin { @JsonValue private final int value; - private AllowSubtitleAdmin(int value) { + AllowSubtitleAdmin(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AllowSync.java b/src/main/java/dev/plexapi/sdk/models/operations/AllowSync.java index 5c54c98d..d95b9d70 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AllowSync.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AllowSync.java @@ -19,7 +19,7 @@ public enum AllowSync { @JsonValue private final int value; - private AllowSync(int value) { + AllowSync(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/AllowTuners.java b/src/main/java/dev/plexapi/sdk/models/operations/AllowTuners.java index 3baf3948..48d98770 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AllowTuners.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AllowTuners.java @@ -19,7 +19,7 @@ public enum AllowTuners { @JsonValue private final int value; - private AllowTuners(int value) { + AllowTuners(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequest.java index 786496dc..e6c6b692 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequest.java @@ -10,11 +10,10 @@ 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 ApplyUpdatesRequest { +public class ApplyUpdatesRequest { /** * Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install */ @@ -59,9 +58,10 @@ public class ApplyUpdatesRequest { return (Optional) skip; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install @@ -72,6 +72,7 @@ public class ApplyUpdatesRequest { return this; } + /** * Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install */ @@ -90,6 +91,7 @@ public class ApplyUpdatesRequest { return this; } + /** * Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. */ @@ -99,7 +101,6 @@ public class ApplyUpdatesRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,15 +111,14 @@ public class ApplyUpdatesRequest { } ApplyUpdatesRequest other = (ApplyUpdatesRequest) o; return - Objects.deepEquals(this.tonight, other.tonight) && - Objects.deepEquals(this.skip, other.skip); + Utils.enhancedDeepEquals(this.tonight, other.tonight) && + Utils.enhancedDeepEquals(this.skip, other.skip); } @Override public int hashCode() { - return Objects.hash( - tonight, - skip); + return Utils.enhancedHash( + tonight, skip); } @Override @@ -127,17 +127,19 @@ public class ApplyUpdatesRequest { "tonight", tonight, "skip", skip); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tonight = Optional.empty(); - + private Optional skip = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install */ @@ -156,6 +158,7 @@ public class ApplyUpdatesRequest { return this; } + /** * Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`. */ @@ -173,11 +176,12 @@ public class ApplyUpdatesRequest { this.skip = skip; return this; } - + public ApplyUpdatesRequest build() { + return new ApplyUpdatesRequest( - tonight, - skip); + tonight, skip); } + } } 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 56a054a3..3dc4870c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.ApplyUpdates; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.util.Optional; @@ -11,10 +15,10 @@ public class ApplyUpdatesRequestBuilder { private Optional tonight = Optional.empty(); private Optional skip = Optional.empty(); - private final SDKMethodInterfaces.MethodCallApplyUpdates sdk; + private final SDKConfiguration sdkConfiguration; - public ApplyUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallApplyUpdates sdk) { - this.sdk = sdk; + public ApplyUpdatesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ApplyUpdatesRequestBuilder tonight(Tonight tonight) { @@ -41,10 +45,21 @@ public class ApplyUpdatesRequestBuilder { return this; } - public ApplyUpdatesResponse call() throws Exception { - return sdk.applyUpdates( - tonight, + private ApplyUpdatesRequest buildRequest() { + + ApplyUpdatesRequest request = new ApplyUpdatesRequest(tonight, skip); + + return request; + } + + public ApplyUpdatesResponse call() throws Exception { + + RequestOperation operation + = new ApplyUpdates.Sync(sdkConfiguration); + ApplyUpdatesRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesResponse.java index 8d11b2bf..a46d018c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ApplyUpdatesResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class ApplyUpdatesResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class ApplyUpdatesResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class ApplyUpdatesResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class ApplyUpdatesResponse implements Response { } ApplyUpdatesResponse other = (ApplyUpdatesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class ApplyUpdatesResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class ApplyUpdatesResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class ApplyUpdatesResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class ApplyUpdatesResponse implements Response { this.rawResponse = rawResponse; return this; } - + public ApplyUpdatesResponse build() { + return new ApplyUpdatesResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Attributes.java b/src/main/java/dev/plexapi/sdk/models/operations/Attributes.java index c4f8c2eb..e5b6a1ae 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Attributes.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Attributes.java @@ -12,7 +12,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -21,7 +20,6 @@ import java.util.Optional; *

Attributes associated with the marker. */ public class Attributes { - /** * The identifier for the attributes. */ @@ -66,9 +64,10 @@ public class Attributes { return version; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The identifier for the attributes. @@ -88,6 +87,7 @@ public class Attributes { return this; } + /** * The version number of the marker attributes. */ @@ -97,7 +97,6 @@ public class Attributes { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,15 +107,14 @@ public class Attributes { } Attributes other = (Attributes) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.version, other.version); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.version, other.version); } @Override public int hashCode() { - return Objects.hash( - id, - version); + return Utils.enhancedHash( + id, version); } @Override @@ -125,17 +123,19 @@ public class Attributes { "id", id, "version", version); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional version = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The identifier for the attributes. */ @@ -145,6 +145,7 @@ public class Attributes { return this; } + /** * The version number of the marker attributes. */ @@ -162,11 +163,12 @@ public class Attributes { this.version = version; return this; } - + public Attributes build() { + return new Attributes( - id, - version); + id, version); } + } } 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 3f3ebffe..e42d9885 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/AutoSelectSubtitle.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/AutoSelectSubtitle.java @@ -19,7 +19,7 @@ public enum AutoSelectSubtitle { @JsonValue private final int value; - private AutoSelectSubtitle(int value) { + AutoSelectSubtitle(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Billing.java b/src/main/java/dev/plexapi/sdk/models/operations/Billing.java index a5a08b37..c08bed1e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Billing.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Billing.java @@ -12,14 +12,15 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class Billing { @JsonProperty("internalPaymentMethod") private InternalPaymentMethod internalPaymentMethod; + @JsonInclude(Include.ALWAYS) @JsonProperty("paymentMethodId") private Optional paymentMethodId; @@ -49,9 +50,10 @@ public class Billing { return paymentMethodId; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Billing withInternalPaymentMethod(InternalPaymentMethod internalPaymentMethod) { Utils.checkNotNull(internalPaymentMethod, "internalPaymentMethod"); @@ -65,13 +67,13 @@ public class Billing { return this; } + public Billing withPaymentMethodId(Optional paymentMethodId) { Utils.checkNotNull(paymentMethodId, "paymentMethodId"); this.paymentMethodId = paymentMethodId; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -82,15 +84,14 @@ public class Billing { } Billing other = (Billing) o; return - Objects.deepEquals(this.internalPaymentMethod, other.internalPaymentMethod) && - Objects.deepEquals(this.paymentMethodId, other.paymentMethodId); + Utils.enhancedDeepEquals(this.internalPaymentMethod, other.internalPaymentMethod) && + Utils.enhancedDeepEquals(this.paymentMethodId, other.paymentMethodId); } @Override public int hashCode() { - return Objects.hash( - internalPaymentMethod, - paymentMethodId); + return Utils.enhancedHash( + internalPaymentMethod, paymentMethodId); } @Override @@ -99,23 +100,26 @@ public class Billing { "internalPaymentMethod", internalPaymentMethod, "paymentMethodId", paymentMethodId); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private InternalPaymentMethod internalPaymentMethod; - + private Optional paymentMethodId = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder internalPaymentMethod(InternalPaymentMethod internalPaymentMethod) { Utils.checkNotNull(internalPaymentMethod, "internalPaymentMethod"); this.internalPaymentMethod = internalPaymentMethod; return this; } + public Builder paymentMethodId(long paymentMethodId) { Utils.checkNotNull(paymentMethodId, "paymentMethodId"); this.paymentMethodId = Optional.ofNullable(paymentMethodId); @@ -127,11 +131,12 @@ public class Billing { this.paymentMethodId = paymentMethodId; return this; } - + public Billing build() { + return new Billing( - internalPaymentMethod, - paymentMethodId); + internalPaymentMethod, paymentMethodId); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ButlerTask.java b/src/main/java/dev/plexapi/sdk/models/operations/ButlerTask.java index d06548c5..6f7cbec0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ButlerTask.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ButlerTask.java @@ -13,31 +13,36 @@ import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class ButlerTask { @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") private Optional name; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("interval") private Optional interval; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("scheduleRandomized") private Optional scheduleRandomized; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("enabled") private Optional enabled; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("description") private Optional description; @@ -65,7 +70,8 @@ public class ButlerTask { } public ButlerTask() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -98,9 +104,10 @@ public class ButlerTask { return description; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ButlerTask withName(String name) { Utils.checkNotNull(name, "name"); @@ -108,6 +115,7 @@ public class ButlerTask { return this; } + public ButlerTask withName(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; @@ -120,6 +128,7 @@ public class ButlerTask { return this; } + public ButlerTask withInterval(Optional interval) { Utils.checkNotNull(interval, "interval"); this.interval = interval; @@ -132,6 +141,7 @@ public class ButlerTask { return this; } + public ButlerTask withScheduleRandomized(Optional scheduleRandomized) { Utils.checkNotNull(scheduleRandomized, "scheduleRandomized"); this.scheduleRandomized = scheduleRandomized; @@ -144,6 +154,7 @@ public class ButlerTask { return this; } + public ButlerTask withEnabled(Optional enabled) { Utils.checkNotNull(enabled, "enabled"); this.enabled = enabled; @@ -156,6 +167,7 @@ public class ButlerTask { return this; } + public ButlerTask withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -168,13 +180,13 @@ public class ButlerTask { return this; } + public ButlerTask withDescription(Optional description) { Utils.checkNotNull(description, "description"); this.description = description; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -185,23 +197,19 @@ public class ButlerTask { } ButlerTask other = (ButlerTask) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.interval, other.interval) && - Objects.deepEquals(this.scheduleRandomized, other.scheduleRandomized) && - Objects.deepEquals(this.enabled, other.enabled) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.description, other.description); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.interval, other.interval) && + Utils.enhancedDeepEquals(this.scheduleRandomized, other.scheduleRandomized) && + Utils.enhancedDeepEquals(this.enabled, other.enabled) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.description, other.description); } @Override public int hashCode() { - return Objects.hash( - name, - interval, - scheduleRandomized, - enabled, - title, - description); + return Utils.enhancedHash( + name, interval, scheduleRandomized, + enabled, title, description); } @Override @@ -214,25 +222,27 @@ public class ButlerTask { "title", title, "description", description); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional name = Optional.empty(); - + private Optional interval = Optional.empty(); - + private Optional scheduleRandomized = Optional.empty(); - + private Optional enabled = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional description = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); @@ -245,6 +255,7 @@ public class ButlerTask { return this; } + public Builder interval(double interval) { Utils.checkNotNull(interval, "interval"); this.interval = Optional.ofNullable(interval); @@ -257,6 +268,7 @@ public class ButlerTask { return this; } + public Builder scheduleRandomized(boolean scheduleRandomized) { Utils.checkNotNull(scheduleRandomized, "scheduleRandomized"); this.scheduleRandomized = Optional.ofNullable(scheduleRandomized); @@ -269,6 +281,7 @@ public class ButlerTask { return this; } + public Builder enabled(boolean enabled) { Utils.checkNotNull(enabled, "enabled"); this.enabled = Optional.ofNullable(enabled); @@ -281,6 +294,7 @@ public class ButlerTask { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -293,6 +307,7 @@ public class ButlerTask { return this; } + public Builder description(String description) { Utils.checkNotNull(description, "description"); this.description = Optional.ofNullable(description); @@ -304,15 +319,13 @@ public class ButlerTask { this.description = description; return this; } - + public ButlerTask build() { + return new ButlerTask( - name, - interval, - scheduleRandomized, - enabled, - title, - description); + name, interval, scheduleRandomized, + enabled, title, description); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ButlerTasks.java b/src/main/java/dev/plexapi/sdk/models/operations/ButlerTasks.java index 9f05e3dd..5bb49ec5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ButlerTasks.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ButlerTasks.java @@ -13,9 +13,9 @@ 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 ButlerTasks { @JsonInclude(Include.NON_ABSENT) @@ -39,9 +39,10 @@ public class ButlerTasks { return (Optional>) butlerTask; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ButlerTasks withButlerTask(List butlerTask) { Utils.checkNotNull(butlerTask, "butlerTask"); @@ -49,13 +50,13 @@ public class ButlerTasks { return this; } + public ButlerTasks withButlerTask(Optional> butlerTask) { Utils.checkNotNull(butlerTask, "butlerTask"); this.butlerTask = butlerTask; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,12 +67,12 @@ public class ButlerTasks { } ButlerTasks other = (ButlerTasks) o; return - Objects.deepEquals(this.butlerTask, other.butlerTask); + Utils.enhancedDeepEquals(this.butlerTask, other.butlerTask); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( butlerTask); } @@ -80,15 +81,17 @@ public class ButlerTasks { return Utils.toString(ButlerTasks.class, "butlerTask", butlerTask); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> butlerTask = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder butlerTask(List butlerTask) { Utils.checkNotNull(butlerTask, "butlerTask"); this.butlerTask = Optional.ofNullable(butlerTask); @@ -100,10 +103,12 @@ public class ButlerTasks { this.butlerTask = butlerTask; return this; } - + public ButlerTasks build() { + return new ButlerTasks( butlerTask); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequest.java index c64b289d..349df20e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class CancelServerActivitiesRequest { - /** * The UUID of the activity to cancel. */ @@ -34,9 +33,10 @@ public class CancelServerActivitiesRequest { return activityUUID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The UUID of the activity to cancel. @@ -47,7 +47,6 @@ public class CancelServerActivitiesRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class CancelServerActivitiesRequest { } CancelServerActivitiesRequest other = (CancelServerActivitiesRequest) o; return - Objects.deepEquals(this.activityUUID, other.activityUUID); + Utils.enhancedDeepEquals(this.activityUUID, other.activityUUID); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( activityUUID); } @@ -72,15 +71,17 @@ public class CancelServerActivitiesRequest { return Utils.toString(CancelServerActivitiesRequest.class, "activityUUID", activityUUID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String activityUUID; - + private Builder() { // force use of static builder() method } + /** * The UUID of the activity to cancel. */ @@ -89,10 +90,12 @@ public class CancelServerActivitiesRequest { this.activityUUID = activityUUID; return this; } - + public CancelServerActivitiesRequest build() { + return new CancelServerActivitiesRequest( activityUUID); } + } } 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 d9e92e26..17ee5d06 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.CancelServerActivities; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ import java.lang.String; public class CancelServerActivitiesRequestBuilder { private String activityUUID; - private final SDKMethodInterfaces.MethodCallCancelServerActivities sdk; + private final SDKConfiguration sdkConfiguration; - public CancelServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallCancelServerActivities sdk) { - this.sdk = sdk; + public CancelServerActivitiesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CancelServerActivitiesRequestBuilder activityUUID(String activityUUID) { @@ -22,9 +26,20 @@ public class CancelServerActivitiesRequestBuilder { return this; } - public CancelServerActivitiesResponse call() throws Exception { - return sdk.cancelServerActivities( - activityUUID); + private CancelServerActivitiesRequest buildRequest() { + + CancelServerActivitiesRequest request = new CancelServerActivitiesRequest(activityUUID); + + return request; + } + + public CancelServerActivitiesResponse call() throws Exception { + + RequestOperation operation + = new CancelServerActivities.Sync(sdkConfiguration); + CancelServerActivitiesRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesResponse.java index e0252f0e..090c8f5b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CancelServerActivitiesResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class CancelServerActivitiesResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class CancelServerActivitiesResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class CancelServerActivitiesResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class CancelServerActivitiesResponse implements Response { } CancelServerActivitiesResponse other = (CancelServerActivitiesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class CancelServerActivitiesResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class CancelServerActivitiesResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class CancelServerActivitiesResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class CancelServerActivitiesResponse implements Response { this.rawResponse = rawResponse; return this; } - + public CancelServerActivitiesResponse build() { + return new CancelServerActivitiesResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Chapter.java b/src/main/java/dev/plexapi/sdk/models/operations/Chapter.java index f82f89f7..ee6edba7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Chapter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Chapter.java @@ -10,7 +10,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * Chapter @@ -22,18 +21,23 @@ public class Chapter { @JsonProperty("id") private long id; + @JsonProperty("filter") private String filter; + @JsonProperty("index") private long index; + @JsonProperty("startTimeOffset") private long startTimeOffset; + @JsonProperty("endTimeOffset") private long endTimeOffset; + @JsonProperty("thumb") private String thumb; @@ -89,9 +93,10 @@ public class Chapter { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Chapter withId(long id) { Utils.checkNotNull(id, "id"); @@ -129,7 +134,6 @@ public class Chapter { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -140,23 +144,19 @@ public class Chapter { } Chapter other = (Chapter) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.startTimeOffset, other.startTimeOffset) && - Objects.deepEquals(this.endTimeOffset, other.endTimeOffset) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.startTimeOffset, other.startTimeOffset) && + Utils.enhancedDeepEquals(this.endTimeOffset, other.endTimeOffset) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - index, - startTimeOffset, - endTimeOffset, - thumb); + return Utils.enhancedHash( + id, filter, index, + startTimeOffset, endTimeOffset, thumb); } @Override @@ -169,69 +169,74 @@ public class Chapter { "endTimeOffset", endTimeOffset, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String filter; - + private Long index; - + private Long startTimeOffset; - + private Long endTimeOffset; - + private String thumb; - + private Builder() { // force use of static builder() method } + public Builder id(long id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } + public Builder index(long index) { Utils.checkNotNull(index, "index"); this.index = index; return this; } + public Builder startTimeOffset(long startTimeOffset) { Utils.checkNotNull(startTimeOffset, "startTimeOffset"); this.startTimeOffset = startTimeOffset; return this; } + public Builder endTimeOffset(long endTimeOffset) { Utils.checkNotNull(endTimeOffset, "endTimeOffset"); this.endTimeOffset = endTimeOffset; return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } - + public Chapter build() { + return new Chapter( - id, - filter, - index, - startTimeOffset, - endTimeOffset, - thumb); + id, filter, index, + startTimeOffset, endTimeOffset, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequest.java index 9bf27014..73403aa7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequest.java @@ -10,11 +10,10 @@ 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 CheckForUpdatesRequest { +public class CheckForUpdatesRequest { /** * Indicate that you want to start download any updates found. */ @@ -41,9 +40,10 @@ public class CheckForUpdatesRequest { return (Optional) download; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Indicate that you want to start download any updates found. @@ -54,6 +54,7 @@ public class CheckForUpdatesRequest { return this; } + /** * Indicate that you want to start download any updates found. */ @@ -63,7 +64,6 @@ public class CheckForUpdatesRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,12 +74,12 @@ public class CheckForUpdatesRequest { } CheckForUpdatesRequest other = (CheckForUpdatesRequest) o; return - Objects.deepEquals(this.download, other.download); + Utils.enhancedDeepEquals(this.download, other.download); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( download); } @@ -88,15 +88,17 @@ public class CheckForUpdatesRequest { return Utils.toString(CheckForUpdatesRequest.class, "download", download); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional download = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Indicate that you want to start download any updates found. */ @@ -114,10 +116,12 @@ public class CheckForUpdatesRequest { this.download = download; return this; } - + public CheckForUpdatesRequest build() { + return new CheckForUpdatesRequest( download); } + } } 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 b5e9713e..7c9af06d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.CheckForUpdates; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.util.Optional; @@ -10,10 +14,10 @@ import java.util.Optional; public class CheckForUpdatesRequestBuilder { private Optional download = Optional.empty(); - private final SDKMethodInterfaces.MethodCallCheckForUpdates sdk; + private final SDKConfiguration sdkConfiguration; - public CheckForUpdatesRequestBuilder(SDKMethodInterfaces.MethodCallCheckForUpdates sdk) { - this.sdk = sdk; + public CheckForUpdatesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CheckForUpdatesRequestBuilder download(Download download) { @@ -28,9 +32,20 @@ public class CheckForUpdatesRequestBuilder { return this; } - public CheckForUpdatesResponse call() throws Exception { - return sdk.checkForUpdates( - download); + private CheckForUpdatesRequest buildRequest() { + + CheckForUpdatesRequest request = new CheckForUpdatesRequest(download); + + return request; + } + + public CheckForUpdatesResponse call() throws Exception { + + RequestOperation operation + = new CheckForUpdates.Sync(sdkConfiguration); + CheckForUpdatesRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesResponse.java index 5ec69765..1f2cc6b7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CheckForUpdatesResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class CheckForUpdatesResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class CheckForUpdatesResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class CheckForUpdatesResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class CheckForUpdatesResponse implements Response { } CheckForUpdatesResponse other = (CheckForUpdatesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class CheckForUpdatesResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class CheckForUpdatesResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class CheckForUpdatesResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class CheckForUpdatesResponse implements Response { this.rawResponse = rawResponse; return this; } - + public CheckForUpdatesResponse build() { + return new CheckForUpdatesResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequest.java index 8d564d31..b7ed537f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class ClearPlaylistContentsRequest { - /** * the ID of the playlist */ @@ -35,9 +34,10 @@ public class ClearPlaylistContentsRequest { return playlistID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the ID of the playlist @@ -48,7 +48,6 @@ public class ClearPlaylistContentsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,12 +58,12 @@ public class ClearPlaylistContentsRequest { } ClearPlaylistContentsRequest other = (ClearPlaylistContentsRequest) o; return - Objects.deepEquals(this.playlistID, other.playlistID); + Utils.enhancedDeepEquals(this.playlistID, other.playlistID); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( playlistID); } @@ -73,15 +72,17 @@ public class ClearPlaylistContentsRequest { return Utils.toString(ClearPlaylistContentsRequest.class, "playlistID", playlistID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double playlistID; - + private Builder() { // force use of static builder() method } + /** * the ID of the playlist */ @@ -90,10 +91,12 @@ public class ClearPlaylistContentsRequest { this.playlistID = playlistID; return this; } - + public ClearPlaylistContentsRequest build() { + return new ClearPlaylistContentsRequest( playlistID); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequestBuilder.java index 2a0bd1c0..c69603c3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.ClearPlaylistContents; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -10,10 +14,10 @@ import java.lang.Exception; public class ClearPlaylistContentsRequestBuilder { private Double playlistID; - private final SDKMethodInterfaces.MethodCallClearPlaylistContents sdk; + private final SDKConfiguration sdkConfiguration; - public ClearPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallClearPlaylistContents sdk) { - this.sdk = sdk; + public ClearPlaylistContentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public ClearPlaylistContentsRequestBuilder playlistID(double playlistID) { @@ -22,9 +26,20 @@ public class ClearPlaylistContentsRequestBuilder { return this; } - public ClearPlaylistContentsResponse call() throws Exception { - return sdk.clearPlaylistContents( - playlistID); + private ClearPlaylistContentsRequest buildRequest() { + + ClearPlaylistContentsRequest request = new ClearPlaylistContentsRequest(playlistID); + + return request; + } + + public ClearPlaylistContentsResponse call() throws Exception { + + RequestOperation operation + = new ClearPlaylistContents.Sync(sdkConfiguration); + ClearPlaylistContentsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsResponse.java index 375ea1cd..15f2a066 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ClearPlaylistContentsResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class ClearPlaylistContentsResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class ClearPlaylistContentsResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class ClearPlaylistContentsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class ClearPlaylistContentsResponse implements Response { } ClearPlaylistContentsResponse other = (ClearPlaylistContentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class ClearPlaylistContentsResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class ClearPlaylistContentsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class ClearPlaylistContentsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class ClearPlaylistContentsResponse implements Response { this.rawResponse = rawResponse; return this; } - + public ClearPlaylistContentsResponse build() { + return new ClearPlaylistContentsResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Collection.java b/src/main/java/dev/plexapi/sdk/models/operations/Collection.java index 4b36fb19..b3bd07e8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Collection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Collection.java @@ -9,10 +9,9 @@ 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 Collection { - /** * The user-made collection this media item belongs to */ @@ -34,9 +33,10 @@ public class Collection { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The user-made collection this media item belongs to @@ -47,7 +47,6 @@ public class Collection { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class Collection { } Collection other = (Collection) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -72,15 +71,17 @@ public class Collection { return Utils.toString(Collection.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The user-made collection this media item belongs to */ @@ -89,10 +90,12 @@ public class Collection { this.tag = tag; return this; } - + public Collection build() { + return new Collection( tag); } + } } 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 9d9cf317..68642809 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Connections.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Connections.java @@ -11,10 +11,9 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class Connections { - /** * The protocol used for the connection (http, https, etc) */ @@ -138,9 +137,10 @@ public class Connections { return iPv6; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The protocol used for the connection (http, https, etc) @@ -205,7 +205,6 @@ public class Connections { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -216,24 +215,20 @@ public class Connections { } Connections other = (Connections) o; return - Objects.deepEquals(this.protocol, other.protocol) && - Objects.deepEquals(this.address, other.address) && - Objects.deepEquals(this.port, other.port) && - Objects.deepEquals(this.uri, other.uri) && - Objects.deepEquals(this.local, other.local) && - Objects.deepEquals(this.relay, other.relay) && - Objects.deepEquals(this.iPv6, other.iPv6); + Utils.enhancedDeepEquals(this.protocol, other.protocol) && + Utils.enhancedDeepEquals(this.address, other.address) && + Utils.enhancedDeepEquals(this.port, other.port) && + Utils.enhancedDeepEquals(this.uri, other.uri) && + Utils.enhancedDeepEquals(this.local, other.local) && + Utils.enhancedDeepEquals(this.relay, other.relay) && + Utils.enhancedDeepEquals(this.iPv6, other.iPv6); } @Override public int hashCode() { - return Objects.hash( - protocol, - address, - port, - uri, - local, - relay, + return Utils.enhancedHash( + protocol, address, port, + uri, local, relay, iPv6); } @@ -248,27 +243,29 @@ public class Connections { "relay", relay, "iPv6", iPv6); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Protocol protocol; - + private String address; - + private Integer port; - + private String uri; - + private Boolean local; - + private Boolean relay; - + private Boolean iPv6; - + private Builder() { // force use of static builder() method } + /** * The protocol used for the connection (http, https, etc) */ @@ -278,6 +275,7 @@ public class Connections { return this; } + /** * The (ip) address or domain name used for the connection */ @@ -287,6 +285,7 @@ public class Connections { return this; } + /** * The port used for the connection */ @@ -296,6 +295,7 @@ public class Connections { return this; } + /** * The full URI of the connection */ @@ -305,6 +305,7 @@ public class Connections { return this; } + /** * If the connection is local address */ @@ -314,6 +315,7 @@ public class Connections { return this; } + /** * If the connection is relayed through plex.direct */ @@ -323,6 +325,7 @@ public class Connections { return this; } + /** * If the connection is using IPv6 */ @@ -331,16 +334,14 @@ public class Connections { this.iPv6 = iPv6; return this; } - + public Connections build() { + return new Connections( - protocol, - address, - port, - uri, - local, - relay, + protocol, address, port, + uri, local, relay, iPv6); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Context.java b/src/main/java/dev/plexapi/sdk/models/operations/Context.java index 27a0e63f..8aca69fd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Context.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Context.java @@ -11,9 +11,9 @@ 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 Context { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class Context { return librarySectionID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Context withLibrarySectionID(String librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); @@ -46,13 +47,13 @@ public class Context { return this; } + public Context withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class Context { } Context other = (Context) o; return - Objects.deepEquals(this.librarySectionID, other.librarySectionID); + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( librarySectionID); } @@ -77,15 +78,17 @@ public class Context { return Utils.toString(Context.class, "librarySectionID", librarySectionID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional librarySectionID = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder librarySectionID(String librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -97,10 +100,12 @@ public class Context { this.librarySectionID = librarySectionID; return this; } - + public Context build() { + return new Context( librarySectionID); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Country.java b/src/main/java/dev/plexapi/sdk/models/operations/Country.java index 0a692230..433acf4a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Country.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Country.java @@ -10,7 +10,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * Country @@ -18,7 +17,6 @@ import java.util.Objects; *

The filter query string for country media items. */ public class Country { - /** * The unique identifier for the country. * NOTE: This is different for each Plex server and is not globally unique. @@ -32,6 +30,7 @@ public class Country { @JsonProperty("tag") private String tag; + @JsonProperty("filter") private String filter; @@ -70,9 +69,10 @@ public class Country { return filter; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the country. @@ -99,7 +99,6 @@ public class Country { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class Country { } Country other = (Country) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.filter, other.filter); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.filter, other.filter); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - filter); + return Utils.enhancedHash( + id, tag, filter); } @Override @@ -130,19 +127,21 @@ public class Country { "tag", tag, "filter", filter); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private String filter; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the country. * NOTE: This is different for each Plex server and is not globally unique. @@ -153,6 +152,7 @@ public class Country { return this; } + /** * The country of origin of this media item */ @@ -162,17 +162,18 @@ public class Country { return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } - + public Country build() { + return new Country( - id, - tag, - filter); + id, tag, filter); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistMediaContainer.java index f3701633..cad24c23 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistMediaContainer.java @@ -14,15 +14,16 @@ 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 CreatePlaylistMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -52,9 +53,10 @@ public class CreatePlaylistMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CreatePlaylistMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class CreatePlaylistMediaContainer { return this; } + public CreatePlaylistMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class CreatePlaylistMediaContainer { return this; } + public CreatePlaylistMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class CreatePlaylistMediaContainer { } CreatePlaylistMediaContainer other = (CreatePlaylistMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - metadata); + return Utils.enhancedHash( + size, metadata); } @Override @@ -108,17 +110,19 @@ public class CreatePlaylistMediaContainer { "size", size, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class CreatePlaylistMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -142,11 +147,12 @@ public class CreatePlaylistMediaContainer { this.metadata = metadata; return this; } - + public CreatePlaylistMediaContainer build() { + return new CreatePlaylistMediaContainer( - size, - metadata); + size, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistMetadata.java index c973bd39..a2515277 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistMetadata.java @@ -13,71 +13,86 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class CreatePlaylistMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("smart") private Optional smart; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("playlistType") private Optional playlistType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("icon") private Optional icon; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewCount") private Optional viewCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("lastViewedAt") private Optional lastViewedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("composite") private Optional composite; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; @@ -135,7 +150,12 @@ public class CreatePlaylistMetadata { } public CreatePlaylistMetadata() { - 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()); + 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()); } @JsonIgnore @@ -218,9 +238,10 @@ public class CreatePlaylistMetadata { return duration; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CreatePlaylistMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -228,6 +249,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -240,6 +262,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -252,6 +275,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -264,6 +288,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -276,6 +301,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -288,6 +314,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -300,6 +327,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withSmart(Optional smart) { Utils.checkNotNull(smart, "smart"); this.smart = smart; @@ -312,6 +340,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withPlaylistType(Optional playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = playlistType; @@ -324,6 +353,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withIcon(Optional icon) { Utils.checkNotNull(icon, "icon"); this.icon = icon; @@ -336,6 +366,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withViewCount(Optional viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = viewCount; @@ -348,6 +379,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withLastViewedAt(Optional lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = lastViewedAt; @@ -360,6 +392,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -372,6 +405,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -384,6 +418,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -396,6 +431,7 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withComposite(Optional composite) { Utils.checkNotNull(composite, "composite"); this.composite = composite; @@ -408,13 +444,13 @@ public class CreatePlaylistMetadata { return this; } + public CreatePlaylistMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -425,42 +461,32 @@ public class CreatePlaylistMetadata { } CreatePlaylistMetadata other = (CreatePlaylistMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.smart, other.smart) && - Objects.deepEquals(this.playlistType, other.playlistType) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.composite, other.composite) && - Objects.deepEquals(this.duration, other.duration); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.smart, other.smart) && + Utils.enhancedDeepEquals(this.playlistType, other.playlistType) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.composite, other.composite) && + Utils.enhancedDeepEquals(this.duration, other.duration); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - type, - title, - summary, - smart, - playlistType, - icon, - viewCount, - lastViewedAt, - leafCount, - addedAt, - updatedAt, - composite, + return Utils.enhancedHash( + ratingKey, key, guid, + type, title, summary, + smart, playlistType, icon, + viewCount, lastViewedAt, leafCount, + addedAt, updatedAt, composite, duration); } @@ -484,45 +510,47 @@ public class CreatePlaylistMetadata { "composite", composite, "duration", duration); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional smart = Optional.empty(); - + private Optional playlistType = Optional.empty(); - + private Optional icon = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional composite = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -535,6 +563,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -547,6 +576,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -559,6 +589,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -571,6 +602,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -583,6 +615,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -595,6 +628,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder smart(boolean smart) { Utils.checkNotNull(smart, "smart"); this.smart = Optional.ofNullable(smart); @@ -607,6 +641,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder playlistType(String playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = Optional.ofNullable(playlistType); @@ -619,6 +654,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder icon(String icon) { Utils.checkNotNull(icon, "icon"); this.icon = Optional.ofNullable(icon); @@ -631,6 +667,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder viewCount(int viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = Optional.ofNullable(viewCount); @@ -643,6 +680,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder lastViewedAt(int lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = Optional.ofNullable(lastViewedAt); @@ -655,6 +693,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -667,6 +706,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -679,6 +719,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -691,6 +732,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder composite(String composite) { Utils.checkNotNull(composite, "composite"); this.composite = Optional.ofNullable(composite); @@ -703,6 +745,7 @@ public class CreatePlaylistMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -714,25 +757,17 @@ public class CreatePlaylistMetadata { this.duration = duration; return this; } - + public CreatePlaylistMetadata build() { + return new CreatePlaylistMetadata( - ratingKey, - key, - guid, - type, - title, - summary, - smart, - playlistType, - icon, - viewCount, - lastViewedAt, - leafCount, - addedAt, - updatedAt, - composite, + ratingKey, key, guid, + type, title, summary, + smart, playlistType, icon, + viewCount, lastViewedAt, leafCount, + addedAt, updatedAt, composite, duration); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequest.java index 91e50ee0..c3ec48dc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class CreatePlaylistRequest { +public class CreatePlaylistRequest { /** * name of the playlist */ @@ -69,7 +68,8 @@ public class CreatePlaylistRequest { CreatePlaylistQueryParamType type, Smart smart, String uri) { - this(title, type, smart, uri, Optional.empty()); + this(title, type, smart, + uri, Optional.empty()); } /** @@ -112,9 +112,10 @@ public class CreatePlaylistRequest { return playQueueID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * name of the playlist @@ -161,6 +162,7 @@ public class CreatePlaylistRequest { return this; } + /** * the play queue to copy to a playlist */ @@ -170,7 +172,6 @@ public class CreatePlaylistRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -181,21 +182,18 @@ public class CreatePlaylistRequest { } CreatePlaylistRequest other = (CreatePlaylistRequest) o; return - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.smart, other.smart) && - Objects.deepEquals(this.uri, other.uri) && - Objects.deepEquals(this.playQueueID, other.playQueueID); + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.smart, other.smart) && + Utils.enhancedDeepEquals(this.uri, other.uri) && + Utils.enhancedDeepEquals(this.playQueueID, other.playQueueID); } @Override public int hashCode() { - return Objects.hash( - title, - type, - smart, - uri, - playQueueID); + return Utils.enhancedHash( + title, type, smart, + uri, playQueueID); } @Override @@ -207,23 +205,25 @@ public class CreatePlaylistRequest { "uri", uri, "playQueueID", playQueueID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String title; - + private CreatePlaylistQueryParamType type; - + private Smart smart; - + private String uri; - + private Optional playQueueID = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * name of the playlist */ @@ -233,6 +233,7 @@ public class CreatePlaylistRequest { return this; } + /** * type of playlist to create */ @@ -242,6 +243,7 @@ public class CreatePlaylistRequest { return this; } + /** * whether the playlist is smart or not */ @@ -251,6 +253,7 @@ public class CreatePlaylistRequest { return this; } + /** * the content URI for the playlist */ @@ -260,6 +263,7 @@ public class CreatePlaylistRequest { return this; } + /** * the play queue to copy to a playlist */ @@ -277,14 +281,13 @@ public class CreatePlaylistRequest { this.playQueueID = playQueueID; return this; } - + public CreatePlaylistRequest build() { + return new CreatePlaylistRequest( - title, - type, - smart, - uri, - playQueueID); + title, type, smart, + uri, playQueueID); } + } } 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 85f2e077..ae5509f9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.CreatePlaylist; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class CreatePlaylistRequestBuilder { private CreatePlaylistRequest request; - private final SDKMethodInterfaces.MethodCallCreatePlaylist sdk; + private final SDKConfiguration sdkConfiguration; - public CreatePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallCreatePlaylist sdk) { - this.sdk = sdk; + public CreatePlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public CreatePlaylistRequestBuilder request(CreatePlaylistRequest request) { @@ -22,8 +26,10 @@ public class CreatePlaylistRequestBuilder { } public CreatePlaylistResponse call() throws Exception { + + RequestOperation operation + = new CreatePlaylist.Sync(sdkConfiguration); - return sdk.createPlaylist( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistResponse.java index 85a0dda8..2e770710 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class CreatePlaylistResponse implements Response { +public class CreatePlaylistResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class CreatePlaylistResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class CreatePlaylistResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class CreatePlaylistResponse implements Response { return this; } + /** * returns all playlists */ @@ -143,7 +145,6 @@ public class CreatePlaylistResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class CreatePlaylistResponse implements Response { } CreatePlaylistResponse other = (CreatePlaylistResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class CreatePlaylistResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class CreatePlaylistResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class CreatePlaylistResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class CreatePlaylistResponse implements Response { return this; } + /** * returns all playlists */ @@ -236,13 +240,13 @@ public class CreatePlaylistResponse implements Response { this.object = object; return this; } - + public CreatePlaylistResponse build() { + return new CreatePlaylistResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistResponseBody.java index 04969a9a..394ed3c2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/CreatePlaylistResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class CreatePlaylistResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public CreatePlaylistResponseBody withMediaContainer(CreatePlaylistMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class CreatePlaylistResponseBody { return this; } + public CreatePlaylistResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class CreatePlaylistResponseBody { } CreatePlaylistResponseBody other = (CreatePlaylistResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class CreatePlaylistResponseBody { return Utils.toString(CreatePlaylistResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(CreatePlaylistMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class CreatePlaylistResponseBody { this.mediaContainer = mediaContainer; return this; } - + public CreatePlaylistResponseBody build() { + return new CreatePlaylistResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DefaultDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/DefaultDirection.java index c489609c..3044ffc7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DefaultDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DefaultDirection.java @@ -20,7 +20,7 @@ public enum DefaultDirection { @JsonValue private final String value; - private DefaultDirection(String value) { + DefaultDirection(String value) { this.value = value; } 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 ea490263..ad4d1140 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleAccessibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleAccessibility.java @@ -19,7 +19,7 @@ public enum DefaultSubtitleAccessibility { @JsonValue private final int value; - private DefaultSubtitleAccessibility(int value) { + DefaultSubtitleAccessibility(int value) { this.value = 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 0b58076a..13265dac 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleForced.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DefaultSubtitleForced.java @@ -19,7 +19,7 @@ public enum DefaultSubtitleForced { @JsonValue private final int value; - private DefaultSubtitleForced(int value) { + DefaultSubtitleForced(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequest.java index cc85e8c9..337a61cd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class DeleteLibraryRequest { - /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -37,9 +36,10 @@ public class DeleteLibraryRequest { return sectionKey; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique key of the Plex library. @@ -51,7 +51,6 @@ public class DeleteLibraryRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -62,12 +61,12 @@ public class DeleteLibraryRequest { } DeleteLibraryRequest other = (DeleteLibraryRequest) o; return - Objects.deepEquals(this.sectionKey, other.sectionKey); + Utils.enhancedDeepEquals(this.sectionKey, other.sectionKey); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( sectionKey); } @@ -76,15 +75,17 @@ public class DeleteLibraryRequest { return Utils.toString(DeleteLibraryRequest.class, "sectionKey", sectionKey); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer sectionKey; - + private Builder() { // force use of static builder() method } + /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -94,10 +95,12 @@ public class DeleteLibraryRequest { this.sectionKey = sectionKey; return this; } - + public DeleteLibraryRequest build() { + return new DeleteLibraryRequest( sectionKey); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequestBuilder.java index cb5f3050..affe86c0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.DeleteLibrary; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Integer; @@ -10,10 +14,10 @@ import java.lang.Integer; public class DeleteLibraryRequestBuilder { private Integer sectionKey; - private final SDKMethodInterfaces.MethodCallDeleteLibrary sdk; + private final SDKConfiguration sdkConfiguration; - public DeleteLibraryRequestBuilder(SDKMethodInterfaces.MethodCallDeleteLibrary sdk) { - this.sdk = sdk; + public DeleteLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeleteLibraryRequestBuilder sectionKey(int sectionKey) { @@ -22,9 +26,20 @@ public class DeleteLibraryRequestBuilder { return this; } - public DeleteLibraryResponse call() throws Exception { - return sdk.deleteLibrary( - sectionKey); + private DeleteLibraryRequest buildRequest() { + + DeleteLibraryRequest request = new DeleteLibraryRequest(sectionKey); + + return request; + } + + public DeleteLibraryResponse call() throws Exception { + + RequestOperation operation + = new DeleteLibrary.Sync(sdkConfiguration); + DeleteLibraryRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryResponse.java index 13f9a608..e3734dbb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DeleteLibraryResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class DeleteLibraryResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class DeleteLibraryResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class DeleteLibraryResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class DeleteLibraryResponse implements Response { } DeleteLibraryResponse other = (DeleteLibraryResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class DeleteLibraryResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class DeleteLibraryResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class DeleteLibraryResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class DeleteLibraryResponse implements Response { this.rawResponse = rawResponse; return this; } - + public DeleteLibraryResponse build() { + return new DeleteLibraryResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequest.java index 220236e6..e6e892cf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class DeletePlaylistRequest { - /** * the ID of the playlist */ @@ -35,9 +34,10 @@ public class DeletePlaylistRequest { return playlistID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the ID of the playlist @@ -48,7 +48,6 @@ public class DeletePlaylistRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,12 +58,12 @@ public class DeletePlaylistRequest { } DeletePlaylistRequest other = (DeletePlaylistRequest) o; return - Objects.deepEquals(this.playlistID, other.playlistID); + Utils.enhancedDeepEquals(this.playlistID, other.playlistID); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( playlistID); } @@ -73,15 +72,17 @@ public class DeletePlaylistRequest { return Utils.toString(DeletePlaylistRequest.class, "playlistID", playlistID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double playlistID; - + private Builder() { // force use of static builder() method } + /** * the ID of the playlist */ @@ -90,10 +91,12 @@ public class DeletePlaylistRequest { this.playlistID = playlistID; return this; } - + public DeletePlaylistRequest build() { + return new DeletePlaylistRequest( playlistID); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequestBuilder.java index 4e3878a2..f243b0ae 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.DeletePlaylist; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -10,10 +14,10 @@ import java.lang.Exception; public class DeletePlaylistRequestBuilder { private Double playlistID; - private final SDKMethodInterfaces.MethodCallDeletePlaylist sdk; + private final SDKConfiguration sdkConfiguration; - public DeletePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallDeletePlaylist sdk) { - this.sdk = sdk; + public DeletePlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public DeletePlaylistRequestBuilder playlistID(double playlistID) { @@ -22,9 +26,20 @@ public class DeletePlaylistRequestBuilder { return this; } - public DeletePlaylistResponse call() throws Exception { - return sdk.deletePlaylist( - playlistID); + private DeletePlaylistRequest buildRequest() { + + DeletePlaylistRequest request = new DeletePlaylistRequest(playlistID); + + return request; + } + + public DeletePlaylistResponse call() throws Exception { + + RequestOperation operation + = new DeletePlaylist.Sync(sdkConfiguration); + DeletePlaylistRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistResponse.java index 1a6d65da..39f6e104 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/DeletePlaylistResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class DeletePlaylistResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class DeletePlaylistResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class DeletePlaylistResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class DeletePlaylistResponse implements Response { } DeletePlaylistResponse other = (DeletePlaylistResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class DeletePlaylistResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class DeletePlaylistResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class DeletePlaylistResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class DeletePlaylistResponse implements Response { this.rawResponse = rawResponse; return this; } - + public DeletePlaylistResponse build() { + return new DeletePlaylistResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Device.java b/src/main/java/dev/plexapi/sdk/models/operations/Device.java index 74953a48..e5807309 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Device.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Device.java @@ -12,27 +12,31 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class Device { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") private Optional name; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("platform") private Optional platform; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("clientIdentifier") private Optional clientIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("createdAt") private Optional createdAt; @@ -57,7 +61,8 @@ public class Device { } public Device() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -85,9 +90,10 @@ public class Device { return createdAt; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Device withId(double id) { Utils.checkNotNull(id, "id"); @@ -95,6 +101,7 @@ public class Device { return this; } + public Device withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -107,6 +114,7 @@ public class Device { return this; } + public Device withName(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; @@ -119,6 +127,7 @@ public class Device { return this; } + public Device withPlatform(Optional platform) { Utils.checkNotNull(platform, "platform"); this.platform = platform; @@ -131,6 +140,7 @@ public class Device { return this; } + public Device withClientIdentifier(Optional clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = clientIdentifier; @@ -143,13 +153,13 @@ public class Device { return this; } + public Device withCreatedAt(Optional createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,21 +170,18 @@ public class Device { } Device other = (Device) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.platform, other.platform) && - Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) && - Objects.deepEquals(this.createdAt, other.createdAt); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.platform, other.platform) && + Utils.enhancedDeepEquals(this.clientIdentifier, other.clientIdentifier) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt); } @Override public int hashCode() { - return Objects.hash( - id, - name, - platform, - clientIdentifier, - createdAt); + return Utils.enhancedHash( + id, name, platform, + clientIdentifier, createdAt); } @Override @@ -186,23 +193,25 @@ public class Device { "clientIdentifier", clientIdentifier, "createdAt", createdAt); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional name = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Optional clientIdentifier = Optional.empty(); - + private Optional createdAt = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(double id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -215,6 +224,7 @@ public class Device { return this; } + public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); @@ -227,6 +237,7 @@ public class Device { return this; } + public Builder platform(String platform) { Utils.checkNotNull(platform, "platform"); this.platform = Optional.ofNullable(platform); @@ -239,6 +250,7 @@ public class Device { return this; } + public Builder clientIdentifier(String clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = Optional.ofNullable(clientIdentifier); @@ -251,6 +263,7 @@ public class Device { return this; } + public Builder createdAt(double createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = Optional.ofNullable(createdAt); @@ -262,14 +275,13 @@ public class Device { this.createdAt = createdAt; return this; } - + public Device build() { + return new Device( - id, - name, - platform, - clientIdentifier, - createdAt); + id, name, platform, + clientIdentifier, createdAt); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Director.java b/src/main/java/dev/plexapi/sdk/models/operations/Director.java index c16be627..d72d8d81 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Director.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Director.java @@ -12,11 +12,10 @@ 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 Director { +public class Director { /** * Unique identifier for the director. */ @@ -72,7 +71,8 @@ public class Director { String filter, String tag, String tagKey) { - this(id, filter, tag, tagKey, Optional.empty()); + this(id, filter, tag, + tagKey, Optional.empty()); } /** @@ -115,9 +115,10 @@ public class Director { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the director. @@ -164,6 +165,7 @@ public class Director { return this; } + /** * The absolute URL of the thumbnail image for the director. */ @@ -173,7 +175,6 @@ public class Director { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,21 +185,18 @@ public class Director { } Director other = (Director) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag, - tagKey, - thumb); + return Utils.enhancedHash( + id, filter, tag, + tagKey, thumb); } @Override @@ -210,23 +208,25 @@ public class Director { "tagKey", tagKey, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String filter; - + private String tag; - + private String tagKey; - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the director. */ @@ -236,6 +236,7 @@ public class Director { return this; } + /** * The filter string used to query this director. */ @@ -245,6 +246,7 @@ public class Director { return this; } + /** * The role of Director */ @@ -254,6 +256,7 @@ public class Director { return this; } + /** * A unique 24-character hexadecimal key associated with the director's tag, used for internal identification. */ @@ -263,6 +266,7 @@ public class Director { return this; } + /** * The absolute URL of the thumbnail image for the director. */ @@ -280,14 +284,13 @@ public class Director { this.thumb = thumb; return this; } - + public Director build() { + return new Director( - id, - filter, - tag, - tagKey, - thumb); + id, filter, tag, + tagKey, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Directory.java b/src/main/java/dev/plexapi/sdk/models/operations/Directory.java index e8348079..6d4eac96 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Directory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Directory.java @@ -12,19 +12,21 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class Directory { @JsonInclude(Include.NON_ABSENT) @JsonProperty("count") private Optional count; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; @@ -61,9 +63,10 @@ public class Directory { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Directory withCount(double count) { Utils.checkNotNull(count, "count"); @@ -71,6 +74,7 @@ public class Directory { return this; } + public Directory withCount(Optional count) { Utils.checkNotNull(count, "count"); this.count = count; @@ -83,6 +87,7 @@ public class Directory { return this; } + public Directory withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -95,13 +100,13 @@ public class Directory { return this; } + public Directory withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class Directory { } Directory other = (Directory) o; return - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - count, - key, - title); + return Utils.enhancedHash( + count, key, title); } @Override @@ -132,19 +135,21 @@ public class Directory { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional count = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder count(double count) { Utils.checkNotNull(count, "count"); this.count = Optional.ofNullable(count); @@ -157,6 +162,7 @@ public class Directory { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -169,6 +175,7 @@ public class Directory { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -180,12 +187,12 @@ public class Directory { this.title = title; return this; } - + public Directory build() { + return new Directory( - count, - key, - title); + count, key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Download.java b/src/main/java/dev/plexapi/sdk/models/operations/Download.java index 3f75382a..1861c2eb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Download.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Download.java @@ -19,7 +19,7 @@ public enum Download { @JsonValue private final long value; - private Download(long value) { + Download(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java index 6c67fd52..8231355d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.EnablePaperTrail; import java.lang.Exception; public class EnablePaperTrailRequestBuilder { - private final SDKMethodInterfaces.MethodCallEnablePaperTrail sdk; + private final SDKConfiguration sdkConfiguration; - public EnablePaperTrailRequestBuilder(SDKMethodInterfaces.MethodCallEnablePaperTrail sdk) { - this.sdk = sdk; + public EnablePaperTrailRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public EnablePaperTrailResponse call() throws Exception { + + RequestlessOperation operation + = new EnablePaperTrail.Sync(sdkConfiguration); - return sdk.enablePaperTrailDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailResponse.java index b27bbaa3..93e63ca5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/EnablePaperTrailResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class EnablePaperTrailResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class EnablePaperTrailResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class EnablePaperTrailResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class EnablePaperTrailResponse implements Response { } EnablePaperTrailResponse other = (EnablePaperTrailResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class EnablePaperTrailResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class EnablePaperTrailResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class EnablePaperTrailResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class EnablePaperTrailResponse implements Response { this.rawResponse = rawResponse; return this; } - + public EnablePaperTrailResponse build() { + return new EnablePaperTrailResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Extras.java b/src/main/java/dev/plexapi/sdk/models/operations/Extras.java index 5ca71985..52a7f9d7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Extras.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Extras.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class Extras { +public class Extras { /** * The size of the extras. */ @@ -43,9 +42,10 @@ public class Extras { return size; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The size of the extras. @@ -56,6 +56,7 @@ public class Extras { return this; } + /** * The size of the extras. */ @@ -65,7 +66,6 @@ public class Extras { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,12 +76,12 @@ public class Extras { } Extras other = (Extras) o; return - Objects.deepEquals(this.size, other.size); + Utils.enhancedDeepEquals(this.size, other.size); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( size); } @@ -90,15 +90,17 @@ public class Extras { return Utils.toString(Extras.class, "size", size); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The size of the extras. */ @@ -116,10 +118,12 @@ public class Extras { this.size = size; return this; } - + public Extras build() { + return new Extras( size); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Feature.java b/src/main/java/dev/plexapi/sdk/models/operations/Feature.java index 7649b66c..f0e1136f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Feature.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Feature.java @@ -13,34 +13,40 @@ 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 Feature { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonProperty("type") private String type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("flavor") private Optional flavor; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("scrobbleKey") private Optional scrobbleKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("unscrobbleKey") private Optional unscrobbleKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Directory") private Optional> directory; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Action") private Optional> action; @@ -72,7 +78,9 @@ public class Feature { public Feature( String type) { - this(Optional.empty(), type, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), type, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -112,9 +120,10 @@ public class Feature { return (Optional>) action; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Feature withKey(String key) { Utils.checkNotNull(key, "key"); @@ -122,6 +131,7 @@ public class Feature { return this; } + public Feature withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -140,6 +150,7 @@ public class Feature { return this; } + public Feature withFlavor(Optional flavor) { Utils.checkNotNull(flavor, "flavor"); this.flavor = flavor; @@ -152,6 +163,7 @@ public class Feature { return this; } + public Feature withScrobbleKey(Optional scrobbleKey) { Utils.checkNotNull(scrobbleKey, "scrobbleKey"); this.scrobbleKey = scrobbleKey; @@ -164,6 +176,7 @@ public class Feature { return this; } + public Feature withUnscrobbleKey(Optional unscrobbleKey) { Utils.checkNotNull(unscrobbleKey, "unscrobbleKey"); this.unscrobbleKey = unscrobbleKey; @@ -176,6 +189,7 @@ public class Feature { return this; } + public Feature withDirectory(Optional> directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; @@ -188,13 +202,13 @@ public class Feature { return this; } + public Feature withAction(Optional> action) { Utils.checkNotNull(action, "action"); this.action = action; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -205,24 +219,20 @@ public class Feature { } Feature other = (Feature) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.flavor, other.flavor) && - Objects.deepEquals(this.scrobbleKey, other.scrobbleKey) && - Objects.deepEquals(this.unscrobbleKey, other.unscrobbleKey) && - Objects.deepEquals(this.directory, other.directory) && - Objects.deepEquals(this.action, other.action); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.flavor, other.flavor) && + Utils.enhancedDeepEquals(this.scrobbleKey, other.scrobbleKey) && + Utils.enhancedDeepEquals(this.unscrobbleKey, other.unscrobbleKey) && + Utils.enhancedDeepEquals(this.directory, other.directory) && + Utils.enhancedDeepEquals(this.action, other.action); } @Override public int hashCode() { - return Objects.hash( - key, - type, - flavor, - scrobbleKey, - unscrobbleKey, - directory, + return Utils.enhancedHash( + key, type, flavor, + scrobbleKey, unscrobbleKey, directory, action); } @@ -237,27 +247,29 @@ public class Feature { "directory", directory, "action", action); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private String type; - + private Optional flavor = Optional.empty(); - + private Optional scrobbleKey = Optional.empty(); - + private Optional unscrobbleKey = Optional.empty(); - + private Optional> directory = Optional.empty(); - + private Optional> action = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -270,12 +282,14 @@ public class Feature { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder flavor(String flavor) { Utils.checkNotNull(flavor, "flavor"); this.flavor = Optional.ofNullable(flavor); @@ -288,6 +302,7 @@ public class Feature { return this; } + public Builder scrobbleKey(String scrobbleKey) { Utils.checkNotNull(scrobbleKey, "scrobbleKey"); this.scrobbleKey = Optional.ofNullable(scrobbleKey); @@ -300,6 +315,7 @@ public class Feature { return this; } + public Builder unscrobbleKey(String unscrobbleKey) { Utils.checkNotNull(unscrobbleKey, "unscrobbleKey"); this.unscrobbleKey = Optional.ofNullable(unscrobbleKey); @@ -312,6 +328,7 @@ public class Feature { return this; } + public Builder directory(List directory) { Utils.checkNotNull(directory, "directory"); this.directory = Optional.ofNullable(directory); @@ -324,6 +341,7 @@ public class Feature { return this; } + public Builder action(List action) { Utils.checkNotNull(action, "action"); this.action = Optional.ofNullable(action); @@ -335,16 +353,14 @@ public class Feature { this.action = action; return this; } - + public Feature build() { + return new Feature( - key, - type, - flavor, - scrobbleKey, - unscrobbleKey, - directory, + key, type, flavor, + scrobbleKey, unscrobbleKey, directory, action); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Field.java b/src/main/java/dev/plexapi/sdk/models/operations/Field.java index fbe170b1..2f865dc7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Field.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Field.java @@ -11,20 +11,23 @@ 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 Field { @JsonProperty("key") private String key; + @JsonProperty("title") private String title; + @JsonProperty("type") private String type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subType") private Optional subType; @@ -49,7 +52,8 @@ public class Field { String key, String title, String type) { - this(key, title, type, Optional.empty()); + this(key, title, type, + Optional.empty()); } @JsonIgnore @@ -72,9 +76,10 @@ public class Field { return subType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Field withKey(String key) { Utils.checkNotNull(key, "key"); @@ -100,13 +105,13 @@ public class Field { return this; } + public Field withSubType(Optional subType) { Utils.checkNotNull(subType, "subType"); this.subType = subType; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -117,18 +122,16 @@ public class Field { } Field other = (Field) 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subType, other.subType); } @Override public int hashCode() { - return Objects.hash( - key, - title, - type, + return Utils.enhancedHash( + key, title, type, subType); } @@ -140,39 +143,44 @@ public class Field { "type", type, "subType", subType); } - + + @SuppressWarnings("UnusedReturnValue") 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); @@ -184,13 +192,13 @@ public class Field { this.subType = subType; return this; } - + public Field build() { + return new Field( - key, - title, - type, + key, title, type, subType); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/FieldType.java b/src/main/java/dev/plexapi/sdk/models/operations/FieldType.java index 107351af..2d744294 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/FieldType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/FieldType.java @@ -10,13 +10,14 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; + public class FieldType { @JsonProperty("type") private String type; + @JsonProperty("Operator") private List operator; @@ -40,9 +41,10 @@ public class FieldType { return operator; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public FieldType withType(String type) { Utils.checkNotNull(type, "type"); @@ -56,7 +58,6 @@ public class FieldType { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,15 +68,14 @@ public class FieldType { } FieldType other = (FieldType) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.operator, other.operator); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.operator, other.operator); } @Override public int hashCode() { - return Objects.hash( - type, - operator); + return Utils.enhancedHash( + type, operator); } @Override @@ -84,33 +84,37 @@ public class FieldType { "type", type, "operator", operator); } - + + @SuppressWarnings("UnusedReturnValue") 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 FieldType build() { + return new FieldType( - type, - operator); + type, operator); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Force.java b/src/main/java/dev/plexapi/sdk/models/operations/Force.java index bd23fc30..2f042f3f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Force.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Force.java @@ -19,7 +19,7 @@ public enum Force { @JsonValue private final long value; - private Force(long value) { + Force(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Friend.java b/src/main/java/dev/plexapi/sdk/models/operations/Friend.java index aafd295f..d6bab4ef 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Friend.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Friend.java @@ -16,11 +16,10 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; -public class Friend { +public class Friend { /** * The account email address */ @@ -53,9 +52,11 @@ public class Friend { @JsonProperty("restricted") private Optional restricted; + @JsonProperty("sharedServers") private List sharedServers; + @JsonProperty("sharedSources") private List sharedSources; @@ -140,7 +141,10 @@ public class Friend { String title, String username, String uuid) { - this(email, Optional.empty(), home, id, Optional.empty(), sharedServers, sharedSources, status, thumb, title, username, uuid); + this(email, Optional.empty(), home, + id, Optional.empty(), sharedServers, + sharedSources, status, thumb, + title, username, uuid); } /** @@ -233,9 +237,10 @@ public class Friend { return uuid; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The account email address @@ -255,6 +260,7 @@ public class Friend { return this; } + /** * The account full name */ @@ -291,6 +297,7 @@ public class Friend { return this; } + /** * If the account is a Plex Home managed user */ @@ -357,7 +364,6 @@ public class Friend { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -368,35 +374,27 @@ public class Friend { } Friend other = (Friend) o; return - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.friendlyName, other.friendlyName) && - Objects.deepEquals(this.home, other.home) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.restricted, other.restricted) && - Objects.deepEquals(this.sharedServers, other.sharedServers) && - Objects.deepEquals(this.sharedSources, other.sharedSources) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.username, other.username) && - Objects.deepEquals(this.uuid, other.uuid); + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.friendlyName, other.friendlyName) && + Utils.enhancedDeepEquals(this.home, other.home) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.restricted, other.restricted) && + Utils.enhancedDeepEquals(this.sharedServers, other.sharedServers) && + Utils.enhancedDeepEquals(this.sharedSources, other.sharedSources) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.username, other.username) && + Utils.enhancedDeepEquals(this.uuid, other.uuid); } @Override public int hashCode() { - return Objects.hash( - email, - friendlyName, - home, - id, - restricted, - sharedServers, - sharedSources, - status, - thumb, - title, - username, - uuid); + return Utils.enhancedHash( + email, friendlyName, home, + id, restricted, sharedServers, + sharedSources, status, thumb, + title, username, uuid); } @Override @@ -415,37 +413,39 @@ public class Friend { "username", username, "uuid", uuid); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String email; - + private Optional friendlyName = Optional.empty(); - + private Boolean home; - + private Integer id; - + private Optional restricted; - + private List sharedServers; - + private List sharedSources; - + private Status status; - + private String thumb; - + private String title; - + private String username; - + private String uuid; - + private Builder() { // force use of static builder() method } + /** * The account email address */ @@ -455,6 +455,7 @@ public class Friend { return this; } + /** * The account full name */ @@ -473,6 +474,7 @@ public class Friend { return this; } + /** * If the account is a Plex Home user */ @@ -482,6 +484,7 @@ public class Friend { return this; } + /** * The Plex account ID */ @@ -491,6 +494,7 @@ public class Friend { return this; } + /** * If the account is a Plex Home managed user */ @@ -509,18 +513,21 @@ public class Friend { return this; } + public Builder sharedServers(List sharedServers) { Utils.checkNotNull(sharedServers, "sharedServers"); this.sharedServers = sharedServers; return this; } + public Builder sharedSources(List sharedSources) { Utils.checkNotNull(sharedSources, "sharedSources"); this.sharedSources = sharedSources; return this; } + /** * Current friend request status */ @@ -530,6 +537,7 @@ public class Friend { return this; } + /** * URL of the account thumbnail */ @@ -539,6 +547,7 @@ public class Friend { return this; } + /** * The title of the account (username or friendly name) */ @@ -548,6 +557,7 @@ public class Friend { return this; } + /** * The account username */ @@ -557,6 +567,7 @@ public class Friend { return this; } + /** * The account Universally Unique Identifier (UUID) */ @@ -565,26 +576,20 @@ public class Friend { this.uuid = uuid; return this; } - + public Friend build() { if (restricted == null) { restricted = _SINGLETON_VALUE_Restricted.value(); } + return new Friend( - email, - friendlyName, - home, - id, - restricted, - sharedServers, - sharedSources, - status, - thumb, - title, - username, - uuid); + email, friendlyName, home, + id, restricted, sharedServers, + sharedSources, status, thumb, + title, username, uuid); } + private static final LazySingletonValue> _SINGLETON_VALUE_Restricted = new LazySingletonValue<>( "restricted", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Genre.java b/src/main/java/dev/plexapi/sdk/models/operations/Genre.java index 0e4d94f4..61c32529 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Genre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Genre.java @@ -10,7 +10,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * Genre @@ -18,7 +17,6 @@ import java.util.Objects; *

The filter query string for similar items. */ public class Genre { - /** * The unique identifier for the genre. * NOTE: This is different for each Plex server and is not globally unique. @@ -26,6 +24,7 @@ public class Genre { @JsonProperty("id") private int id; + @JsonProperty("filter") private String filter; @@ -70,9 +69,10 @@ public class Genre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the genre. @@ -99,7 +99,6 @@ public class Genre { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class Genre { } Genre other = (Genre) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag); + return Utils.enhancedHash( + id, filter, tag); } @Override @@ -130,19 +127,21 @@ public class Genre { "filter", filter, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String filter; - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the genre. * NOTE: This is different for each Plex server and is not globally unique. @@ -153,12 +152,14 @@ public class Genre { return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } + /** * The genre name of this media-item */ @@ -167,12 +168,12 @@ public class Genre { this.tag = tag; return this; } - + public Genre build() { + return new Genre( - id, - filter, - tag); + id, filter, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GeoData.java b/src/main/java/dev/plexapi/sdk/models/operations/GeoData.java index 50302a4c..13046411 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GeoData.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GeoData.java @@ -14,7 +14,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -23,7 +22,6 @@ import java.util.Optional; *

Geo location data */ public class GeoData { - /** * The ISO 3166-1 alpha-2 code of the country. */ @@ -139,7 +137,10 @@ public class GeoData { String postalCode, String subdivisions, String coordinates) { - this(code, continentCode, country, city, Optional.empty(), timeZone, postalCode, Optional.empty(), Optional.empty(), subdivisions, coordinates); + this(code, continentCode, country, + city, Optional.empty(), timeZone, + postalCode, Optional.empty(), Optional.empty(), + subdivisions, coordinates); } /** @@ -230,9 +231,10 @@ public class GeoData { return coordinates; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The ISO 3166-1 alpha-2 code of the country. @@ -279,6 +281,7 @@ public class GeoData { return this; } + /** * Indicates if the country is a member of the European Union. */ @@ -315,6 +318,7 @@ public class GeoData { return this; } + /** * Indicates if the country has privacy restrictions. */ @@ -333,6 +337,7 @@ public class GeoData { return this; } + /** * Indicates if the region has privacy restrictions. */ @@ -360,7 +365,6 @@ public class GeoData { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -371,33 +375,26 @@ public class GeoData { } GeoData other = (GeoData) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.continentCode, other.continentCode) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.city, other.city) && - Objects.deepEquals(this.europeanUnionMember, other.europeanUnionMember) && - Objects.deepEquals(this.timeZone, other.timeZone) && - Objects.deepEquals(this.postalCode, other.postalCode) && - Objects.deepEquals(this.inPrivacyRestrictedCountry, other.inPrivacyRestrictedCountry) && - Objects.deepEquals(this.inPrivacyRestrictedRegion, other.inPrivacyRestrictedRegion) && - Objects.deepEquals(this.subdivisions, other.subdivisions) && - Objects.deepEquals(this.coordinates, other.coordinates); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.continentCode, other.continentCode) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.city, other.city) && + Utils.enhancedDeepEquals(this.europeanUnionMember, other.europeanUnionMember) && + Utils.enhancedDeepEquals(this.timeZone, other.timeZone) && + Utils.enhancedDeepEquals(this.postalCode, other.postalCode) && + Utils.enhancedDeepEquals(this.inPrivacyRestrictedCountry, other.inPrivacyRestrictedCountry) && + Utils.enhancedDeepEquals(this.inPrivacyRestrictedRegion, other.inPrivacyRestrictedRegion) && + Utils.enhancedDeepEquals(this.subdivisions, other.subdivisions) && + Utils.enhancedDeepEquals(this.coordinates, other.coordinates); } @Override public int hashCode() { - return Objects.hash( - code, - continentCode, - country, - city, - europeanUnionMember, - timeZone, - postalCode, - inPrivacyRestrictedCountry, - inPrivacyRestrictedRegion, - subdivisions, - coordinates); + return Utils.enhancedHash( + code, continentCode, country, + city, europeanUnionMember, timeZone, + postalCode, inPrivacyRestrictedCountry, inPrivacyRestrictedRegion, + subdivisions, coordinates); } @Override @@ -415,35 +412,37 @@ public class GeoData { "subdivisions", subdivisions, "coordinates", coordinates); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String code; - + private String continentCode; - + private String country; - + private String city; - + private Optional europeanUnionMember; - + private String timeZone; - + private String postalCode; - + private Optional inPrivacyRestrictedCountry; - + private Optional inPrivacyRestrictedRegion; - + private String subdivisions; - + private String coordinates; - + private Builder() { // force use of static builder() method } + /** * The ISO 3166-1 alpha-2 code of the country. */ @@ -453,6 +452,7 @@ public class GeoData { return this; } + /** * The continent code where the country is located. */ @@ -462,6 +462,7 @@ public class GeoData { return this; } + /** * The official name of the country. */ @@ -471,6 +472,7 @@ public class GeoData { return this; } + /** * The name of the city. */ @@ -480,6 +482,7 @@ public class GeoData { return this; } + /** * Indicates if the country is a member of the European Union. */ @@ -498,6 +501,7 @@ public class GeoData { return this; } + /** * The time zone of the country. */ @@ -507,6 +511,7 @@ public class GeoData { return this; } + /** * The postal code of the location. */ @@ -516,6 +521,7 @@ public class GeoData { return this; } + /** * Indicates if the country has privacy restrictions. */ @@ -534,6 +540,7 @@ public class GeoData { return this; } + /** * Indicates if the region has privacy restrictions. */ @@ -552,6 +559,7 @@ public class GeoData { return this; } + /** * The name of the primary administrative subdivision. */ @@ -561,6 +569,7 @@ public class GeoData { return this; } + /** * The geographical coordinates (latitude, longitude) of the location. */ @@ -569,7 +578,7 @@ public class GeoData { this.coordinates = coordinates; return this; } - + public GeoData build() { if (europeanUnionMember == null) { europeanUnionMember = _SINGLETON_VALUE_EuropeanUnionMember.value(); @@ -580,20 +589,15 @@ public class GeoData { if (inPrivacyRestrictedRegion == null) { inPrivacyRestrictedRegion = _SINGLETON_VALUE_InPrivacyRestrictedRegion.value(); } + return new GeoData( - code, - continentCode, - country, - city, - europeanUnionMember, - timeZone, - postalCode, - inPrivacyRestrictedCountry, - inPrivacyRestrictedRegion, - subdivisions, - coordinates); + code, continentCode, country, + city, europeanUnionMember, timeZone, + postalCode, inPrivacyRestrictedCountry, inPrivacyRestrictedRegion, + subdivisions, coordinates); } + private static final LazySingletonValue> _SINGLETON_VALUE_EuropeanUnionMember = new LazySingletonValue<>( "european_union_member", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryDirectory.java b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryDirectory.java index d3af09ac..0406cde7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryDirectory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryDirectory.java @@ -9,10 +9,9 @@ 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 GetActorsLibraryDirectory { - /** * A fast lookup key for the actor relative url. */ @@ -85,9 +84,10 @@ public class GetActorsLibraryDirectory { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * A fast lookup key for the actor relative url. @@ -125,7 +125,6 @@ public class GetActorsLibraryDirectory { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -136,18 +135,16 @@ public class GetActorsLibraryDirectory { } GetActorsLibraryDirectory other = (GetActorsLibraryDirectory) o; return - Objects.deepEquals(this.fastKey, other.fastKey) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.fastKey, other.fastKey) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - fastKey, - thumb, - key, + return Utils.enhancedHash( + fastKey, thumb, key, title); } @@ -159,21 +156,23 @@ public class GetActorsLibraryDirectory { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String fastKey; - + private String thumb; - + private String key; - + private String title; - + private Builder() { // force use of static builder() method } + /** * A fast lookup key for the actor relative url. */ @@ -183,6 +182,7 @@ public class GetActorsLibraryDirectory { return this; } + /** * URL for the thumbnail image of the actor. */ @@ -192,6 +192,7 @@ public class GetActorsLibraryDirectory { return this; } + /** * A unique key representing the actor. */ @@ -201,6 +202,7 @@ public class GetActorsLibraryDirectory { return this; } + /** * The name of the actor. */ @@ -209,13 +211,13 @@ public class GetActorsLibraryDirectory { this.title = title; return this; } - + public GetActorsLibraryDirectory build() { + return new GetActorsLibraryDirectory( - fastKey, - thumb, - key, + fastKey, thumb, key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryMediaContainer.java index 14f4edcd..22bb2c31 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryMediaContainer.java @@ -16,11 +16,10 @@ 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 GetActorsLibraryMediaContainer { +public class GetActorsLibraryMediaContainer { /** * Number of media items returned in this response. */ @@ -156,7 +155,11 @@ public class GetActorsLibraryMediaContainer { String title1, String title2, String viewGroup) { - this(size, allowSync, art, identifier, mediaTagPrefix, mediaTagVersion, nocache, thumb, title1, title2, viewGroup, Optional.empty(), Optional.empty()); + this(size, allowSync, art, + identifier, mediaTagPrefix, mediaTagVersion, + nocache, thumb, title1, + title2, viewGroup, Optional.empty(), + Optional.empty()); } /** @@ -264,9 +267,10 @@ public class GetActorsLibraryMediaContainer { return (Optional>) directory; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -376,6 +380,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * Identifier for the view mode. */ @@ -394,6 +399,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * An array of actor entries for media items. */ @@ -403,7 +409,6 @@ public class GetActorsLibraryMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -414,36 +419,28 @@ public class GetActorsLibraryMediaContainer { } GetActorsLibraryMediaContainer other = (GetActorsLibraryMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.nocache, other.nocache) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title1, other.title1) && - Objects.deepEquals(this.title2, other.title2) && - Objects.deepEquals(this.viewGroup, other.viewGroup) && - Objects.deepEquals(this.viewMode, other.viewMode) && - Objects.deepEquals(this.directory, other.directory); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.nocache, other.nocache) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title1, other.title1) && + Utils.enhancedDeepEquals(this.title2, other.title2) && + Utils.enhancedDeepEquals(this.viewGroup, other.viewGroup) && + Utils.enhancedDeepEquals(this.viewMode, other.viewMode) && + Utils.enhancedDeepEquals(this.directory, other.directory); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - art, - identifier, - mediaTagPrefix, - mediaTagVersion, - nocache, - thumb, - title1, - title2, - viewGroup, - viewMode, + return Utils.enhancedHash( + size, allowSync, art, + identifier, mediaTagPrefix, mediaTagVersion, + nocache, thumb, title1, + title2, viewGroup, viewMode, directory); } @@ -464,39 +461,41 @@ public class GetActorsLibraryMediaContainer { "viewMode", viewMode, "directory", directory); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Boolean allowSync; - + private String art; - + private String identifier; - + private String mediaTagPrefix; - + private Long mediaTagVersion; - + private Boolean nocache; - + private String thumb; - + private String title1; - + private String title2; - + private String viewGroup; - + private Optional viewMode = Optional.empty(); - + private Optional> directory = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -506,6 +505,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * Indicates whether syncing is allowed. */ @@ -515,6 +515,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * URL for the background artwork of the media container. */ @@ -524,6 +525,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -533,6 +535,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * The prefix used for media tag resource paths. */ @@ -542,6 +545,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * The version number for media tags. */ @@ -551,6 +555,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * Specifies whether caching is disabled. */ @@ -560,6 +565,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * URL for the thumbnail image of the media container. */ @@ -569,6 +575,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * The primary title of the media container. */ @@ -578,6 +585,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * The secondary title of the media container. */ @@ -587,6 +595,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * Identifier for the view group layout. */ @@ -596,6 +605,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * Identifier for the view mode. */ @@ -614,6 +624,7 @@ public class GetActorsLibraryMediaContainer { return this; } + /** * An array of actor entries for media items. */ @@ -631,22 +642,16 @@ public class GetActorsLibraryMediaContainer { this.directory = directory; return this; } - + public GetActorsLibraryMediaContainer build() { + return new GetActorsLibraryMediaContainer( - size, - allowSync, - art, - identifier, - mediaTagPrefix, - mediaTagVersion, - nocache, - thumb, - title1, - title2, - viewGroup, - viewMode, + size, allowSync, art, + identifier, mediaTagPrefix, mediaTagVersion, + nocache, thumb, title1, + title2, viewGroup, viewMode, directory); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryRequest.java index a4ffeeb0..7e419608 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetActorsLibraryRequest { - /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -64,9 +63,10 @@ public class GetActorsLibraryRequest { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique key of the Plex library. @@ -92,7 +92,6 @@ public class GetActorsLibraryRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -103,15 +102,14 @@ public class GetActorsLibraryRequest { } GetActorsLibraryRequest other = (GetActorsLibraryRequest) o; return - Objects.deepEquals(this.sectionKey, other.sectionKey) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.sectionKey, other.sectionKey) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - sectionKey, - type); + return Utils.enhancedHash( + sectionKey, type); } @Override @@ -120,17 +118,19 @@ public class GetActorsLibraryRequest { "sectionKey", sectionKey, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer sectionKey; - + private GetActorsLibraryQueryParamType type; - + private Builder() { // force use of static builder() method } + /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -141,6 +141,7 @@ public class GetActorsLibraryRequest { return this; } + /** * The type of media to retrieve or filter by. * 1 = movie @@ -154,11 +155,12 @@ public class GetActorsLibraryRequest { this.type = type; return this; } - + public GetActorsLibraryRequest build() { + return new GetActorsLibraryRequest( - sectionKey, - type); + sectionKey, type); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryRequestBuilder.java index fa7c9a00..abfbcbc9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetActorsLibrary; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Integer; @@ -11,10 +15,10 @@ public class GetActorsLibraryRequestBuilder { private Integer sectionKey; private GetActorsLibraryQueryParamType type; - private final SDKMethodInterfaces.MethodCallGetActorsLibrary sdk; + private final SDKConfiguration sdkConfiguration; - public GetActorsLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetActorsLibrary sdk) { - this.sdk = sdk; + public GetActorsLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetActorsLibraryRequestBuilder sectionKey(int sectionKey) { @@ -29,10 +33,21 @@ public class GetActorsLibraryRequestBuilder { return this; } - public GetActorsLibraryResponse call() throws Exception { - return sdk.getActorsLibrary( - sectionKey, + private GetActorsLibraryRequest buildRequest() { + + GetActorsLibraryRequest request = new GetActorsLibraryRequest(sectionKey, type); + + return request; + } + + public GetActorsLibraryResponse call() throws Exception { + + RequestOperation operation + = new GetActorsLibrary.Sync(sdkConfiguration); + GetActorsLibraryRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryResponse.java index 0172fff5..fbfcb086 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetActorsLibraryResponse implements Response { +public class GetActorsLibraryResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetActorsLibraryResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetActorsLibraryResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetActorsLibraryResponse implements Response { return this; } + /** * Successful response containing media container data. */ @@ -143,7 +145,6 @@ public class GetActorsLibraryResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetActorsLibraryResponse implements Response { } GetActorsLibraryResponse other = (GetActorsLibraryResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetActorsLibraryResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetActorsLibraryResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetActorsLibraryResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetActorsLibraryResponse implements Response { return this; } + /** * Successful response containing media container data. */ @@ -236,13 +240,13 @@ public class GetActorsLibraryResponse implements Response { this.object = object; return this; } - + public GetActorsLibraryResponse build() { + return new GetActorsLibraryResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryResponseBody.java index 537c9b7e..6e10ff91 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetActorsLibraryResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetActorsLibraryResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetActorsLibraryResponseBody withMediaContainer(GetActorsLibraryMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetActorsLibraryResponseBody { return this; } + public GetActorsLibraryResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetActorsLibraryResponseBody { } GetActorsLibraryResponseBody other = (GetActorsLibraryResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetActorsLibraryResponseBody { return Utils.toString(GetActorsLibraryResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetActorsLibraryMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetActorsLibraryResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetActorsLibraryResponseBody build() { + return new GetActorsLibraryResponseBody( mediaContainer); } + } } 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 2d33ebae..9d815bfd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetAllLibrariesDirectory.java @@ -17,11 +17,10 @@ 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 { +public class GetAllLibrariesDirectory { /** * Indicates whether syncing is allowed. */ @@ -64,6 +63,7 @@ public class GetAllLibrariesDirectory { @JsonProperty("key") private String key; + @JsonProperty("type") private GetAllLibrariesType type; @@ -103,6 +103,7 @@ public class GetAllLibrariesDirectory { @JsonProperty("updatedAt") private long updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("createdAt") private Optional createdAt; @@ -139,6 +140,7 @@ public class GetAllLibrariesDirectory { @JsonProperty("hidden") private Optional hidden; + @JsonProperty("Location") private List location; @@ -229,7 +231,13 @@ public class GetAllLibrariesDirectory { boolean directory, long contentChangedAt, List location) { - this(allowSync, art, composite, filters, refreshing, thumb, key, type, title, agent, scanner, language, uuid, updatedAt, Optional.empty(), scannedAt, content, directory, contentChangedAt, Optional.empty(), location); + this(allowSync, art, composite, + filters, refreshing, thumb, + key, type, title, + agent, scanner, language, + uuid, updatedAt, Optional.empty(), + scannedAt, content, directory, + contentChangedAt, Optional.empty(), location); } /** @@ -393,9 +401,10 @@ public class GetAllLibrariesDirectory { return location; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Indicates whether syncing is allowed. @@ -526,6 +535,7 @@ public class GetAllLibrariesDirectory { return this; } + public GetAllLibrariesDirectory withCreatedAt(Optional createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; @@ -578,6 +588,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * The Plex library visibility setting */ @@ -593,7 +604,6 @@ public class GetAllLibrariesDirectory { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -604,53 +614,39 @@ public class GetAllLibrariesDirectory { } GetAllLibrariesDirectory other = (GetAllLibrariesDirectory) o; return - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.composite, other.composite) && - Objects.deepEquals(this.filters, other.filters) && - Objects.deepEquals(this.refreshing, other.refreshing) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.agent, other.agent) && - Objects.deepEquals(this.scanner, other.scanner) && - Objects.deepEquals(this.language, other.language) && - Objects.deepEquals(this.uuid, other.uuid) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.scannedAt, other.scannedAt) && - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.directory, other.directory) && - Objects.deepEquals(this.contentChangedAt, other.contentChangedAt) && - Objects.deepEquals(this.hidden, other.hidden) && - Objects.deepEquals(this.location, other.location); + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.composite, other.composite) && + Utils.enhancedDeepEquals(this.filters, other.filters) && + Utils.enhancedDeepEquals(this.refreshing, other.refreshing) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.agent, other.agent) && + Utils.enhancedDeepEquals(this.scanner, other.scanner) && + Utils.enhancedDeepEquals(this.language, other.language) && + Utils.enhancedDeepEquals(this.uuid, other.uuid) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.scannedAt, other.scannedAt) && + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.directory, other.directory) && + Utils.enhancedDeepEquals(this.contentChangedAt, other.contentChangedAt) && + Utils.enhancedDeepEquals(this.hidden, other.hidden) && + Utils.enhancedDeepEquals(this.location, other.location); } @Override public int hashCode() { - return Objects.hash( - allowSync, - art, - composite, - filters, - refreshing, - thumb, - key, - type, - title, - agent, - scanner, - language, - uuid, - updatedAt, - createdAt, - scannedAt, - content, - directory, - contentChangedAt, - hidden, - location); + return Utils.enhancedHash( + allowSync, art, composite, + filters, refreshing, thumb, + key, type, title, + agent, scanner, language, + uuid, updatedAt, createdAt, + scannedAt, content, directory, + contentChangedAt, hidden, location); } @Override @@ -678,55 +674,57 @@ public class GetAllLibrariesDirectory { "hidden", hidden, "location", location); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Boolean allowSync; - + private String art; - + private String composite; - + private Boolean filters; - + private Boolean refreshing; - + private String thumb; - + private String key; - + private GetAllLibrariesType type; - + private String title; - + private String agent; - + private String scanner; - + private String language; - + private String uuid; - + private Long updatedAt; - + private Optional createdAt = Optional.empty(); - + private Long scannedAt; - + private Boolean content; - + private Boolean directory; - + private Long contentChangedAt; - + private Optional hidden; - + private List location; - + private Builder() { // force use of static builder() method } + /** * Indicates whether syncing is allowed. */ @@ -736,6 +734,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * URL for the background artwork of the media container. */ @@ -745,6 +744,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * The relative path to the composite media item. */ @@ -754,6 +754,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * UNKNOWN */ @@ -763,6 +764,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * Indicates whether the library is currently being refreshed or updated */ @@ -772,6 +774,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * URL for the thumbnail image of the media container. */ @@ -781,6 +784,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * The library key representing the unique identifier */ @@ -790,12 +794,14 @@ public class GetAllLibrariesDirectory { return this; } + public Builder type(GetAllLibrariesType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + /** * The title of the library */ @@ -805,6 +811,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * The Plex agent used to match and retrieve media metadata. */ @@ -814,6 +821,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * UNKNOWN */ @@ -823,6 +831,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * The Plex library language that has been set */ @@ -832,6 +841,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * The universally unique identifier for the library. */ @@ -841,6 +851,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * Unix epoch datetime in seconds */ @@ -850,6 +861,7 @@ public class GetAllLibrariesDirectory { return this; } + public Builder createdAt(long createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = Optional.ofNullable(createdAt); @@ -862,6 +874,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * Unix epoch datetime in seconds */ @@ -871,6 +884,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * UNKNOWN */ @@ -880,6 +894,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * UNKNOWN */ @@ -889,6 +904,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * Timestamp (in seconds) representing the last time the content was modified. * NOTE: Some Plex server have some absurd values for this field, like 8457612157633039800 so it should be int64 @@ -899,6 +915,7 @@ public class GetAllLibrariesDirectory { return this; } + /** * The Plex library visibility setting */ @@ -917,40 +934,29 @@ public class GetAllLibrariesDirectory { return this; } + public Builder location(List location) { Utils.checkNotNull(location, "location"); this.location = location; return this; } - + public GetAllLibrariesDirectory build() { if (hidden == null) { hidden = _SINGLETON_VALUE_Hidden.value(); } + return new GetAllLibrariesDirectory( - allowSync, - art, - composite, - filters, - refreshing, - thumb, - key, - type, - title, - agent, - scanner, - language, - uuid, - updatedAt, - createdAt, - scannedAt, - content, - directory, - contentChangedAt, - hidden, - location); + allowSync, art, composite, + filters, refreshing, thumb, + key, type, title, + agent, scanner, language, + uuid, updatedAt, createdAt, + scannedAt, content, directory, + contentChangedAt, hidden, location); } + private static final LazySingletonValue

Geo location data */ public class GetGeoDataGeoData { - /** * The ISO 3166-1 alpha-2 code of the country. */ @@ -139,7 +137,10 @@ public class GetGeoDataGeoData { String postalCode, String subdivisions, String coordinates) { - this(code, continentCode, country, city, Optional.empty(), timeZone, postalCode, Optional.empty(), Optional.empty(), subdivisions, coordinates); + this(code, continentCode, country, + city, Optional.empty(), timeZone, + postalCode, Optional.empty(), Optional.empty(), + subdivisions, coordinates); } /** @@ -230,9 +231,10 @@ public class GetGeoDataGeoData { return coordinates; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The ISO 3166-1 alpha-2 code of the country. @@ -279,6 +281,7 @@ public class GetGeoDataGeoData { return this; } + /** * Indicates if the country is a member of the European Union. */ @@ -315,6 +318,7 @@ public class GetGeoDataGeoData { return this; } + /** * Indicates if the country has privacy restrictions. */ @@ -333,6 +337,7 @@ public class GetGeoDataGeoData { return this; } + /** * Indicates if the region has privacy restrictions. */ @@ -360,7 +365,6 @@ public class GetGeoDataGeoData { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -371,33 +375,26 @@ public class GetGeoDataGeoData { } GetGeoDataGeoData other = (GetGeoDataGeoData) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.continentCode, other.continentCode) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.city, other.city) && - Objects.deepEquals(this.europeanUnionMember, other.europeanUnionMember) && - Objects.deepEquals(this.timeZone, other.timeZone) && - Objects.deepEquals(this.postalCode, other.postalCode) && - Objects.deepEquals(this.inPrivacyRestrictedCountry, other.inPrivacyRestrictedCountry) && - Objects.deepEquals(this.inPrivacyRestrictedRegion, other.inPrivacyRestrictedRegion) && - Objects.deepEquals(this.subdivisions, other.subdivisions) && - Objects.deepEquals(this.coordinates, other.coordinates); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.continentCode, other.continentCode) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.city, other.city) && + Utils.enhancedDeepEquals(this.europeanUnionMember, other.europeanUnionMember) && + Utils.enhancedDeepEquals(this.timeZone, other.timeZone) && + Utils.enhancedDeepEquals(this.postalCode, other.postalCode) && + Utils.enhancedDeepEquals(this.inPrivacyRestrictedCountry, other.inPrivacyRestrictedCountry) && + Utils.enhancedDeepEquals(this.inPrivacyRestrictedRegion, other.inPrivacyRestrictedRegion) && + Utils.enhancedDeepEquals(this.subdivisions, other.subdivisions) && + Utils.enhancedDeepEquals(this.coordinates, other.coordinates); } @Override public int hashCode() { - return Objects.hash( - code, - continentCode, - country, - city, - europeanUnionMember, - timeZone, - postalCode, - inPrivacyRestrictedCountry, - inPrivacyRestrictedRegion, - subdivisions, - coordinates); + return Utils.enhancedHash( + code, continentCode, country, + city, europeanUnionMember, timeZone, + postalCode, inPrivacyRestrictedCountry, inPrivacyRestrictedRegion, + subdivisions, coordinates); } @Override @@ -415,35 +412,37 @@ public class GetGeoDataGeoData { "subdivisions", subdivisions, "coordinates", coordinates); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String code; - + private String continentCode; - + private String country; - + private String city; - + private Optional europeanUnionMember; - + private String timeZone; - + private String postalCode; - + private Optional inPrivacyRestrictedCountry; - + private Optional inPrivacyRestrictedRegion; - + private String subdivisions; - + private String coordinates; - + private Builder() { // force use of static builder() method } + /** * The ISO 3166-1 alpha-2 code of the country. */ @@ -453,6 +452,7 @@ public class GetGeoDataGeoData { return this; } + /** * The continent code where the country is located. */ @@ -462,6 +462,7 @@ public class GetGeoDataGeoData { return this; } + /** * The official name of the country. */ @@ -471,6 +472,7 @@ public class GetGeoDataGeoData { return this; } + /** * The name of the city. */ @@ -480,6 +482,7 @@ public class GetGeoDataGeoData { return this; } + /** * Indicates if the country is a member of the European Union. */ @@ -498,6 +501,7 @@ public class GetGeoDataGeoData { return this; } + /** * The time zone of the country. */ @@ -507,6 +511,7 @@ public class GetGeoDataGeoData { return this; } + /** * The postal code of the location. */ @@ -516,6 +521,7 @@ public class GetGeoDataGeoData { return this; } + /** * Indicates if the country has privacy restrictions. */ @@ -534,6 +540,7 @@ public class GetGeoDataGeoData { return this; } + /** * Indicates if the region has privacy restrictions. */ @@ -552,6 +559,7 @@ public class GetGeoDataGeoData { return this; } + /** * The name of the primary administrative subdivision. */ @@ -561,6 +569,7 @@ public class GetGeoDataGeoData { return this; } + /** * The geographical coordinates (latitude, longitude) of the location. */ @@ -569,7 +578,7 @@ public class GetGeoDataGeoData { this.coordinates = coordinates; return this; } - + public GetGeoDataGeoData build() { if (europeanUnionMember == null) { europeanUnionMember = _SINGLETON_VALUE_EuropeanUnionMember.value(); @@ -580,20 +589,15 @@ public class GetGeoDataGeoData { if (inPrivacyRestrictedRegion == null) { inPrivacyRestrictedRegion = _SINGLETON_VALUE_InPrivacyRestrictedRegion.value(); } + return new GetGeoDataGeoData( - code, - continentCode, - country, - city, - europeanUnionMember, - timeZone, - postalCode, - inPrivacyRestrictedCountry, - inPrivacyRestrictedRegion, - subdivisions, - coordinates); + code, continentCode, country, + city, europeanUnionMember, timeZone, + postalCode, inPrivacyRestrictedCountry, inPrivacyRestrictedRegion, + subdivisions, coordinates); } + private static final LazySingletonValue> _SINGLETON_VALUE_EuropeanUnionMember = new LazySingletonValue<>( "european_union_member", 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 4bb62bf3..5353cecd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetGeoData; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -11,10 +15,10 @@ import java.util.Optional; public class GetGeoDataRequestBuilder { private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetGeoData sdk; + private final SDKConfiguration sdkConfiguration; - public GetGeoDataRequestBuilder(SDKMethodInterfaces.MethodCallGetGeoData sdk) { - this.sdk = sdk; + public GetGeoDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetGeoDataRequestBuilder serverURL(String serverURL) { @@ -30,8 +34,10 @@ public class GetGeoDataRequestBuilder { } public GetGeoDataResponse call() throws Exception { + + RequestlessOperation operation + = new GetGeoData.Sync(sdkConfiguration, serverURL); - return sdk.getGeoData( - serverURL); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataResponse.java index bc73c12b..d97c6b5a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGeoDataResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetGeoDataResponse implements Response { +public class GetGeoDataResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetGeoDataResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetGeoDataResponse implements Response { return (Optional) geoData; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetGeoDataResponse implements Response { return this; } + /** * Gets the geo location data of the user */ @@ -143,7 +145,6 @@ public class GetGeoDataResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetGeoDataResponse implements Response { } GetGeoDataResponse other = (GetGeoDataResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.geoData, other.geoData); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.geoData, other.geoData); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, geoData); } @@ -177,21 +176,23 @@ public class GetGeoDataResponse implements Response { "rawResponse", rawResponse, "geoData", geoData); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional geoData = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetGeoDataResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetGeoDataResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetGeoDataResponse implements Response { return this; } + /** * Gets the geo location data of the user */ @@ -236,13 +240,13 @@ public class GetGeoDataResponse implements Response { this.geoData = geoData; return this; } - + public GetGeoDataResponse build() { + return new GetGeoDataResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, geoData); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsMediaContainer.java index c33df250..c60055d0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsMediaContainer.java @@ -15,23 +15,26 @@ 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 GetGlobalHubsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Hub") private Optional> hub; @@ -53,7 +56,8 @@ public class GetGlobalHubsMediaContainer { } public GetGlobalHubsMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -77,9 +81,10 @@ public class GetGlobalHubsMediaContainer { return (Optional>) hub; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGlobalHubsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -87,6 +92,7 @@ public class GetGlobalHubsMediaContainer { return this; } + public GetGlobalHubsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -99,6 +105,7 @@ public class GetGlobalHubsMediaContainer { return this; } + public GetGlobalHubsMediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -111,6 +118,7 @@ public class GetGlobalHubsMediaContainer { return this; } + public GetGlobalHubsMediaContainer withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -123,13 +131,13 @@ public class GetGlobalHubsMediaContainer { return this; } + public GetGlobalHubsMediaContainer withHub(Optional> hub) { Utils.checkNotNull(hub, "hub"); this.hub = hub; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -140,18 +148,16 @@ public class GetGlobalHubsMediaContainer { } GetGlobalHubsMediaContainer other = (GetGlobalHubsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.hub, other.hub); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.hub, other.hub); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - identifier, + return Utils.enhancedHash( + size, allowSync, identifier, hub); } @@ -163,21 +169,23 @@ public class GetGlobalHubsMediaContainer { "identifier", identifier, "hub", hub); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional allowSync = Optional.empty(); - + private Optional identifier = Optional.empty(); - + private Optional> hub = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -190,6 +198,7 @@ public class GetGlobalHubsMediaContainer { return this; } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -202,6 +211,7 @@ public class GetGlobalHubsMediaContainer { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -214,6 +224,7 @@ public class GetGlobalHubsMediaContainer { return this; } + public Builder hub(List hub) { Utils.checkNotNull(hub, "hub"); this.hub = Optional.ofNullable(hub); @@ -225,13 +236,13 @@ public class GetGlobalHubsMediaContainer { this.hub = hub; return this; } - + public GetGlobalHubsMediaContainer build() { + return new GetGlobalHubsMediaContainer( - size, - allowSync, - identifier, + size, allowSync, identifier, hub); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsMetadata.java index 8a6a88ad..5839b593 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsMetadata.java @@ -13,75 +13,91 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetGlobalHubsMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("titleSort") private Optional titleSort; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("smart") private Optional smart; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("playlistType") private Optional playlistType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("composite") private Optional composite; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("icon") private Optional icon; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewCount") private Optional viewCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("lastViewedAt") private Optional lastViewedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; @@ -142,7 +158,12 @@ public class GetGlobalHubsMetadata { } public GetGlobalHubsMetadata() { - 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()); + 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()); } @JsonIgnore @@ -230,9 +251,10 @@ public class GetGlobalHubsMetadata { return updatedAt; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGlobalHubsMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -240,6 +262,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -252,6 +275,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -264,6 +288,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -276,6 +301,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -288,6 +314,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -300,6 +327,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withTitleSort(Optional titleSort) { Utils.checkNotNull(titleSort, "titleSort"); this.titleSort = titleSort; @@ -312,6 +340,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -324,6 +353,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withSmart(Optional smart) { Utils.checkNotNull(smart, "smart"); this.smart = smart; @@ -336,6 +366,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withPlaylistType(Optional playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = playlistType; @@ -348,6 +379,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withComposite(Optional composite) { Utils.checkNotNull(composite, "composite"); this.composite = composite; @@ -360,6 +392,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withIcon(Optional icon) { Utils.checkNotNull(icon, "icon"); this.icon = icon; @@ -372,6 +405,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withViewCount(Optional viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = viewCount; @@ -384,6 +418,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withLastViewedAt(Optional lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = lastViewedAt; @@ -396,6 +431,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -408,6 +444,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -420,6 +457,7 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -432,13 +470,13 @@ public class GetGlobalHubsMetadata { return this; } + public GetGlobalHubsMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -449,45 +487,34 @@ public class GetGlobalHubsMetadata { } GetGlobalHubsMetadata other = (GetGlobalHubsMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.titleSort, other.titleSort) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.smart, other.smart) && - Objects.deepEquals(this.playlistType, other.playlistType) && - Objects.deepEquals(this.composite, other.composite) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.titleSort, other.titleSort) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.smart, other.smart) && + Utils.enhancedDeepEquals(this.playlistType, other.playlistType) && + Utils.enhancedDeepEquals(this.composite, other.composite) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - type, - title, - titleSort, - summary, - smart, - playlistType, - composite, - icon, - viewCount, - lastViewedAt, - duration, - leafCount, - addedAt, - updatedAt); + return Utils.enhancedHash( + ratingKey, key, guid, + type, title, titleSort, + summary, smart, playlistType, + composite, icon, viewCount, + lastViewedAt, duration, leafCount, + addedAt, updatedAt); } @Override @@ -511,47 +538,49 @@ public class GetGlobalHubsMetadata { "addedAt", addedAt, "updatedAt", updatedAt); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional titleSort = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional smart = Optional.empty(); - + private Optional playlistType = Optional.empty(); - + private Optional composite = Optional.empty(); - + private Optional icon = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -564,6 +593,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -576,6 +606,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -588,6 +619,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -600,6 +632,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -612,6 +645,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder titleSort(String titleSort) { Utils.checkNotNull(titleSort, "titleSort"); this.titleSort = Optional.ofNullable(titleSort); @@ -624,6 +658,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -636,6 +671,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder smart(boolean smart) { Utils.checkNotNull(smart, "smart"); this.smart = Optional.ofNullable(smart); @@ -648,6 +684,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder playlistType(String playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = Optional.ofNullable(playlistType); @@ -660,6 +697,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder composite(String composite) { Utils.checkNotNull(composite, "composite"); this.composite = Optional.ofNullable(composite); @@ -672,6 +710,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder icon(String icon) { Utils.checkNotNull(icon, "icon"); this.icon = Optional.ofNullable(icon); @@ -684,6 +723,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder viewCount(int viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = Optional.ofNullable(viewCount); @@ -696,6 +736,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder lastViewedAt(int lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = Optional.ofNullable(lastViewedAt); @@ -708,6 +749,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -720,6 +762,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -732,6 +775,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -744,6 +788,7 @@ public class GetGlobalHubsMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -755,26 +800,17 @@ public class GetGlobalHubsMetadata { this.updatedAt = updatedAt; return this; } - + public GetGlobalHubsMetadata build() { + return new GetGlobalHubsMetadata( - ratingKey, - key, - guid, - type, - title, - titleSort, - summary, - smart, - playlistType, - composite, - icon, - viewCount, - lastViewedAt, - duration, - leafCount, - addedAt, - updatedAt); + ratingKey, key, guid, + type, title, titleSort, + summary, smart, playlistType, + composite, icon, viewCount, + lastViewedAt, duration, leafCount, + addedAt, updatedAt); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequest.java index 4e3e840c..8717409f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequest.java @@ -11,11 +11,10 @@ import java.lang.Double; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetGlobalHubsRequest { +public class GetGlobalHubsRequest { /** * The number of items to return with each hub. */ @@ -59,9 +58,10 @@ public class GetGlobalHubsRequest { return (Optional) onlyTransient; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The number of items to return with each hub. @@ -72,6 +72,7 @@ public class GetGlobalHubsRequest { return this; } + /** * The number of items to return with each hub. */ @@ -90,6 +91,7 @@ public class GetGlobalHubsRequest { return this; } + /** * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). */ @@ -99,7 +101,6 @@ public class GetGlobalHubsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,15 +111,14 @@ public class GetGlobalHubsRequest { } GetGlobalHubsRequest other = (GetGlobalHubsRequest) o; return - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.onlyTransient, other.onlyTransient); + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.onlyTransient, other.onlyTransient); } @Override public int hashCode() { - return Objects.hash( - count, - onlyTransient); + return Utils.enhancedHash( + count, onlyTransient); } @Override @@ -127,17 +127,19 @@ public class GetGlobalHubsRequest { "count", count, "onlyTransient", onlyTransient); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional count = Optional.empty(); - + private Optional onlyTransient = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The number of items to return with each hub. */ @@ -156,6 +158,7 @@ public class GetGlobalHubsRequest { return this; } + /** * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). */ @@ -173,11 +176,12 @@ public class GetGlobalHubsRequest { this.onlyTransient = onlyTransient; return this; } - + public GetGlobalHubsRequest build() { + return new GetGlobalHubsRequest( - count, - onlyTransient); + count, onlyTransient); } + } } 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 7007ed26..931e181b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetGlobalHubs; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -12,10 +16,10 @@ public class GetGlobalHubsRequestBuilder { private Optional count = Optional.empty(); private Optional onlyTransient = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetGlobalHubs sdk; + private final SDKConfiguration sdkConfiguration; - public GetGlobalHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetGlobalHubs sdk) { - this.sdk = sdk; + public GetGlobalHubsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetGlobalHubsRequestBuilder count(double count) { @@ -42,10 +46,21 @@ public class GetGlobalHubsRequestBuilder { return this; } - public GetGlobalHubsResponse call() throws Exception { - return sdk.getGlobalHubs( - count, + private GetGlobalHubsRequest buildRequest() { + + GetGlobalHubsRequest request = new GetGlobalHubsRequest(count, onlyTransient); + + return request; + } + + public GetGlobalHubsResponse call() throws Exception { + + RequestOperation operation + = new GetGlobalHubs.Sync(sdkConfiguration); + GetGlobalHubsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsResponse.java index 2bd13db6..244484db 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetGlobalHubsResponse implements Response { +public class GetGlobalHubsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetGlobalHubsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetGlobalHubsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetGlobalHubsResponse implements Response { return this; } + /** * returns global hubs */ @@ -143,7 +145,6 @@ public class GetGlobalHubsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetGlobalHubsResponse implements Response { } GetGlobalHubsResponse other = (GetGlobalHubsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetGlobalHubsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetGlobalHubsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetGlobalHubsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetGlobalHubsResponse implements Response { return this; } + /** * returns global hubs */ @@ -236,13 +240,13 @@ public class GetGlobalHubsResponse implements Response { this.object = object; return this; } - + public GetGlobalHubsResponse build() { + return new GetGlobalHubsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsResponseBody.java index 6719780a..721c5dfe 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetGlobalHubsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetGlobalHubsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetGlobalHubsResponseBody withMediaContainer(GetGlobalHubsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetGlobalHubsResponseBody { return this; } + public GetGlobalHubsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetGlobalHubsResponseBody { } GetGlobalHubsResponseBody other = (GetGlobalHubsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetGlobalHubsResponseBody { return Utils.toString(GetGlobalHubsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetGlobalHubsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetGlobalHubsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetGlobalHubsResponseBody build() { + return new GetGlobalHubsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataRequestBuilder.java index e0c9b07a..35267408 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetHomeData; import java.lang.Exception; public class GetHomeDataRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetHomeData sdk; + private final SDKConfiguration sdkConfiguration; - public GetHomeDataRequestBuilder(SDKMethodInterfaces.MethodCallGetHomeData sdk) { - this.sdk = sdk; + public GetHomeDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetHomeDataResponse call() throws Exception { + + RequestlessOperation operation + = new GetHomeData.Sync(sdkConfiguration); - return sdk.getHomeDataDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataResponse.java index fca97d2f..6a26a7a0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetHomeDataResponse implements Response { +public class GetHomeDataResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetHomeDataResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetHomeDataResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetHomeDataResponse implements Response { return this; } + /** * Home Data */ @@ -143,7 +145,6 @@ public class GetHomeDataResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetHomeDataResponse implements Response { } GetHomeDataResponse other = (GetHomeDataResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetHomeDataResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetHomeDataResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetHomeDataResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetHomeDataResponse implements Response { return this; } + /** * Home Data */ @@ -236,13 +240,13 @@ public class GetHomeDataResponse implements Response { this.object = object; return this; } - + public GetHomeDataResponse build() { + return new GetHomeDataResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataResponseBody.java index 88a12149..a197a9a8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetHomeDataResponseBody.java @@ -13,7 +13,6 @@ import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -27,22 +26,27 @@ public class GetHomeDataResponseBody { @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") private Optional name; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guestUserID") private Optional guestUserID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guestUserUUID") private Optional guestUserUUID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guestEnabled") private Optional guestEnabled; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subscription") private Optional subscription; @@ -70,7 +74,8 @@ public class GetHomeDataResponseBody { } public GetHomeDataResponseBody() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -103,9 +108,10 @@ public class GetHomeDataResponseBody { return subscription; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetHomeDataResponseBody withId(double id) { Utils.checkNotNull(id, "id"); @@ -113,6 +119,7 @@ public class GetHomeDataResponseBody { return this; } + public GetHomeDataResponseBody withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -125,6 +132,7 @@ public class GetHomeDataResponseBody { return this; } + public GetHomeDataResponseBody withName(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; @@ -137,6 +145,7 @@ public class GetHomeDataResponseBody { return this; } + public GetHomeDataResponseBody withGuestUserID(Optional guestUserID) { Utils.checkNotNull(guestUserID, "guestUserID"); this.guestUserID = guestUserID; @@ -149,6 +158,7 @@ public class GetHomeDataResponseBody { return this; } + public GetHomeDataResponseBody withGuestUserUUID(Optional guestUserUUID) { Utils.checkNotNull(guestUserUUID, "guestUserUUID"); this.guestUserUUID = guestUserUUID; @@ -161,6 +171,7 @@ public class GetHomeDataResponseBody { return this; } + public GetHomeDataResponseBody withGuestEnabled(Optional guestEnabled) { Utils.checkNotNull(guestEnabled, "guestEnabled"); this.guestEnabled = guestEnabled; @@ -173,13 +184,13 @@ public class GetHomeDataResponseBody { return this; } + public GetHomeDataResponseBody withSubscription(Optional subscription) { Utils.checkNotNull(subscription, "subscription"); this.subscription = subscription; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -190,23 +201,19 @@ public class GetHomeDataResponseBody { } GetHomeDataResponseBody other = (GetHomeDataResponseBody) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.guestUserID, other.guestUserID) && - Objects.deepEquals(this.guestUserUUID, other.guestUserUUID) && - Objects.deepEquals(this.guestEnabled, other.guestEnabled) && - Objects.deepEquals(this.subscription, other.subscription); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.guestUserID, other.guestUserID) && + Utils.enhancedDeepEquals(this.guestUserUUID, other.guestUserUUID) && + Utils.enhancedDeepEquals(this.guestEnabled, other.guestEnabled) && + Utils.enhancedDeepEquals(this.subscription, other.subscription); } @Override public int hashCode() { - return Objects.hash( - id, - name, - guestUserID, - guestUserUUID, - guestEnabled, - subscription); + return Utils.enhancedHash( + id, name, guestUserID, + guestUserUUID, guestEnabled, subscription); } @Override @@ -219,25 +226,27 @@ public class GetHomeDataResponseBody { "guestEnabled", guestEnabled, "subscription", subscription); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional name = Optional.empty(); - + private Optional guestUserID = Optional.empty(); - + private Optional guestUserUUID = Optional.empty(); - + private Optional guestEnabled = Optional.empty(); - + private Optional subscription = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(double id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -250,6 +259,7 @@ public class GetHomeDataResponseBody { return this; } + public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); @@ -262,6 +272,7 @@ public class GetHomeDataResponseBody { return this; } + public Builder guestUserID(double guestUserID) { Utils.checkNotNull(guestUserID, "guestUserID"); this.guestUserID = Optional.ofNullable(guestUserID); @@ -274,6 +285,7 @@ public class GetHomeDataResponseBody { return this; } + public Builder guestUserUUID(String guestUserUUID) { Utils.checkNotNull(guestUserUUID, "guestUserUUID"); this.guestUserUUID = Optional.ofNullable(guestUserUUID); @@ -286,6 +298,7 @@ public class GetHomeDataResponseBody { return this; } + public Builder guestEnabled(boolean guestEnabled) { Utils.checkNotNull(guestEnabled, "guestEnabled"); this.guestEnabled = Optional.ofNullable(guestEnabled); @@ -298,6 +311,7 @@ public class GetHomeDataResponseBody { return this; } + public Builder subscription(boolean subscription) { Utils.checkNotNull(subscription, "subscription"); this.subscription = Optional.ofNullable(subscription); @@ -309,15 +323,13 @@ public class GetHomeDataResponseBody { this.subscription = subscription; return this; } - + public GetHomeDataResponseBody build() { + return new GetHomeDataResponseBody( - id, - name, - guestUserID, - guestUserUUID, - guestEnabled, - subscription); + id, name, guestUserID, + guestUserUUID, guestEnabled, subscription); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsDirectory.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsDirectory.java index 23196ada..a816556e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsDirectory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsDirectory.java @@ -12,27 +12,31 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetLibraryDetailsDirectory { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("secondary") private Optional secondary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("prompt") private Optional prompt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("search") private Optional search; @@ -57,7 +61,8 @@ public class GetLibraryDetailsDirectory { } public GetLibraryDetailsDirectory() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -85,9 +90,10 @@ public class GetLibraryDetailsDirectory { return search; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsDirectory withKey(String key) { Utils.checkNotNull(key, "key"); @@ -95,6 +101,7 @@ public class GetLibraryDetailsDirectory { return this; } + public GetLibraryDetailsDirectory withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -107,6 +114,7 @@ public class GetLibraryDetailsDirectory { return this; } + public GetLibraryDetailsDirectory withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -119,6 +127,7 @@ public class GetLibraryDetailsDirectory { return this; } + public GetLibraryDetailsDirectory withSecondary(Optional secondary) { Utils.checkNotNull(secondary, "secondary"); this.secondary = secondary; @@ -131,6 +140,7 @@ public class GetLibraryDetailsDirectory { return this; } + public GetLibraryDetailsDirectory withPrompt(Optional prompt) { Utils.checkNotNull(prompt, "prompt"); this.prompt = prompt; @@ -143,13 +153,13 @@ public class GetLibraryDetailsDirectory { return this; } + public GetLibraryDetailsDirectory withSearch(Optional search) { Utils.checkNotNull(search, "search"); this.search = search; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,21 +170,18 @@ public class GetLibraryDetailsDirectory { } GetLibraryDetailsDirectory other = (GetLibraryDetailsDirectory) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.secondary, other.secondary) && - Objects.deepEquals(this.prompt, other.prompt) && - Objects.deepEquals(this.search, other.search); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.secondary, other.secondary) && + Utils.enhancedDeepEquals(this.prompt, other.prompt) && + Utils.enhancedDeepEquals(this.search, other.search); } @Override public int hashCode() { - return Objects.hash( - key, - title, - secondary, - prompt, - search); + return Utils.enhancedHash( + key, title, secondary, + prompt, search); } @Override @@ -186,23 +193,25 @@ public class GetLibraryDetailsDirectory { "prompt", prompt, "search", search); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional secondary = Optional.empty(); - + private Optional prompt = Optional.empty(); - + private Optional search = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -215,6 +224,7 @@ public class GetLibraryDetailsDirectory { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -227,6 +237,7 @@ public class GetLibraryDetailsDirectory { return this; } + public Builder secondary(boolean secondary) { Utils.checkNotNull(secondary, "secondary"); this.secondary = Optional.ofNullable(secondary); @@ -239,6 +250,7 @@ public class GetLibraryDetailsDirectory { return this; } + public Builder prompt(String prompt) { Utils.checkNotNull(prompt, "prompt"); this.prompt = Optional.ofNullable(prompt); @@ -251,6 +263,7 @@ public class GetLibraryDetailsDirectory { return this; } + public Builder search(boolean search) { Utils.checkNotNull(search, "search"); this.search = Optional.ofNullable(search); @@ -262,14 +275,13 @@ public class GetLibraryDetailsDirectory { this.search = search; return this; } - + public GetLibraryDetailsDirectory build() { + return new GetLibraryDetailsDirectory( - key, - title, - secondary, - prompt, - search); + key, title, secondary, + prompt, search); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsField.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsField.java index 6ae35fd4..e0d7018e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsField.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsField.java @@ -11,23 +11,26 @@ 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 GetLibraryDetailsField { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subType") private Optional subType; @@ -49,7 +52,8 @@ public class GetLibraryDetailsField { } public GetLibraryDetailsField() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -72,9 +76,10 @@ public class GetLibraryDetailsField { return subType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsField withKey(String key) { Utils.checkNotNull(key, "key"); @@ -82,6 +87,7 @@ public class GetLibraryDetailsField { return this; } + public GetLibraryDetailsField withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -94,6 +100,7 @@ public class GetLibraryDetailsField { return this; } + public GetLibraryDetailsField withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -106,6 +113,7 @@ public class GetLibraryDetailsField { return this; } + public GetLibraryDetailsField withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -118,13 +126,13 @@ public class GetLibraryDetailsField { return this; } + public GetLibraryDetailsField withSubType(Optional subType) { Utils.checkNotNull(subType, "subType"); this.subType = subType; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -135,18 +143,16 @@ public class GetLibraryDetailsField { } GetLibraryDetailsField other = (GetLibraryDetailsField) 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subType, other.subType); } @Override public int hashCode() { - return Objects.hash( - key, - title, - type, + return Utils.enhancedHash( + key, title, type, subType); } @@ -158,21 +164,23 @@ public class GetLibraryDetailsField { "type", type, "subType", subType); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional subType = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -185,6 +193,7 @@ public class GetLibraryDetailsField { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -197,6 +206,7 @@ public class GetLibraryDetailsField { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -209,6 +219,7 @@ public class GetLibraryDetailsField { return this; } + public Builder subType(String subType) { Utils.checkNotNull(subType, "subType"); this.subType = Optional.ofNullable(subType); @@ -220,13 +231,13 @@ public class GetLibraryDetailsField { this.subType = subType; return this; } - + public GetLibraryDetailsField build() { + return new GetLibraryDetailsField( - key, - title, - type, + key, title, type, subType); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsFieldType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsFieldType.java index fc350cb3..a4c8d89f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsFieldType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsFieldType.java @@ -13,15 +13,16 @@ 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 GetLibraryDetailsFieldType { @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Operator") private Optional> operator; @@ -51,9 +52,10 @@ public class GetLibraryDetailsFieldType { return (Optional>) operator; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsFieldType withType(String type) { Utils.checkNotNull(type, "type"); @@ -61,6 +63,7 @@ public class GetLibraryDetailsFieldType { return this; } + public GetLibraryDetailsFieldType withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -73,13 +76,13 @@ public class GetLibraryDetailsFieldType { return this; } + public GetLibraryDetailsFieldType withOperator(Optional> operator) { Utils.checkNotNull(operator, "operator"); this.operator = operator; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,15 +93,14 @@ public class GetLibraryDetailsFieldType { } GetLibraryDetailsFieldType other = (GetLibraryDetailsFieldType) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.operator, other.operator); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.operator, other.operator); } @Override public int hashCode() { - return Objects.hash( - type, - operator); + return Utils.enhancedHash( + type, operator); } @Override @@ -107,17 +109,19 @@ public class GetLibraryDetailsFieldType { "type", type, "operator", operator); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional type = Optional.empty(); - + private Optional> operator = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -130,6 +134,7 @@ public class GetLibraryDetailsFieldType { return this; } + public Builder operator(List operator) { Utils.checkNotNull(operator, "operator"); this.operator = Optional.ofNullable(operator); @@ -141,11 +146,12 @@ public class GetLibraryDetailsFieldType { this.operator = operator; return this; } - + public GetLibraryDetailsFieldType build() { + return new GetLibraryDetailsFieldType( - type, - operator); + type, operator); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsFilter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsFilter.java index baf01354..38a93d2f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsFilter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsFilter.java @@ -11,27 +11,31 @@ 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 GetLibraryDetailsFilter { @JsonInclude(Include.NON_ABSENT) @JsonProperty("filter") private Optional filter; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("filterType") private Optional filterType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; @@ -56,7 +60,8 @@ public class GetLibraryDetailsFilter { } public GetLibraryDetailsFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -84,9 +89,10 @@ public class GetLibraryDetailsFilter { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsFilter withFilter(String filter) { Utils.checkNotNull(filter, "filter"); @@ -94,6 +100,7 @@ public class GetLibraryDetailsFilter { return this; } + public GetLibraryDetailsFilter withFilter(Optional filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -106,6 +113,7 @@ public class GetLibraryDetailsFilter { return this; } + public GetLibraryDetailsFilter withFilterType(Optional filterType) { Utils.checkNotNull(filterType, "filterType"); this.filterType = filterType; @@ -118,6 +126,7 @@ public class GetLibraryDetailsFilter { return this; } + public GetLibraryDetailsFilter withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -130,6 +139,7 @@ public class GetLibraryDetailsFilter { return this; } + public GetLibraryDetailsFilter withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -142,13 +152,13 @@ public class GetLibraryDetailsFilter { return this; } + public GetLibraryDetailsFilter withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -159,21 +169,18 @@ public class GetLibraryDetailsFilter { } GetLibraryDetailsFilter other = (GetLibraryDetailsFilter) 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); + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.filterType, other.filterType) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - filter, - filterType, - key, - title, - type); + return Utils.enhancedHash( + filter, filterType, key, + title, type); } @Override @@ -185,23 +192,25 @@ public class GetLibraryDetailsFilter { "title", title, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional filter = Optional.empty(); - + private Optional filterType = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional type = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); @@ -214,6 +223,7 @@ public class GetLibraryDetailsFilter { return this; } + public Builder filterType(String filterType) { Utils.checkNotNull(filterType, "filterType"); this.filterType = Optional.ofNullable(filterType); @@ -226,6 +236,7 @@ public class GetLibraryDetailsFilter { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -238,6 +249,7 @@ public class GetLibraryDetailsFilter { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -250,6 +262,7 @@ public class GetLibraryDetailsFilter { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -261,14 +274,13 @@ public class GetLibraryDetailsFilter { this.type = type; return this; } - + public GetLibraryDetailsFilter build() { + return new GetLibraryDetailsFilter( - filter, - filterType, - key, - title, - type); + filter, filterType, key, + title, type); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsMediaContainer.java index 83c07f79..af4d1517 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsMediaContainer.java @@ -15,67 +15,81 @@ 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 GetLibraryDetailsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("content") private Optional content; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagPrefix") private Optional mediaTagPrefix; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagVersion") private Optional mediaTagVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title1") private Optional title1; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewGroup") private Optional viewGroup; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewMode") private Optional viewMode; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Directory") private Optional> directory; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Type") private Optional> type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("FieldType") private Optional> fieldType; @@ -130,7 +144,11 @@ public class GetLibraryDetailsMediaContainer { } public GetLibraryDetailsMediaContainer() { - 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()); + 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()); } @JsonIgnore @@ -211,9 +229,10 @@ public class GetLibraryDetailsMediaContainer { return (Optional>) fieldType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -221,6 +240,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -233,6 +253,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -245,6 +266,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -257,6 +279,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withContent(Optional content) { Utils.checkNotNull(content, "content"); this.content = content; @@ -269,6 +292,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -281,6 +305,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -293,6 +318,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withMediaTagPrefix(Optional mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = mediaTagPrefix; @@ -305,6 +331,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withMediaTagVersion(Optional mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = mediaTagVersion; @@ -317,6 +344,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -329,6 +357,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withTitle1(Optional title1) { Utils.checkNotNull(title1, "title1"); this.title1 = title1; @@ -341,6 +370,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withViewGroup(Optional viewGroup) { Utils.checkNotNull(viewGroup, "viewGroup"); this.viewGroup = viewGroup; @@ -353,6 +383,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withViewMode(Optional viewMode) { Utils.checkNotNull(viewMode, "viewMode"); this.viewMode = viewMode; @@ -365,6 +396,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withDirectory(Optional> directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; @@ -377,6 +409,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withType(Optional> type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -389,13 +422,13 @@ public class GetLibraryDetailsMediaContainer { return this; } + public GetLibraryDetailsMediaContainer withFieldType(Optional> fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = fieldType; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -406,41 +439,31 @@ public class GetLibraryDetailsMediaContainer { } GetLibraryDetailsMediaContainer other = (GetLibraryDetailsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title1, other.title1) && - Objects.deepEquals(this.viewGroup, other.viewGroup) && - Objects.deepEquals(this.viewMode, other.viewMode) && - Objects.deepEquals(this.directory, other.directory) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.fieldType, other.fieldType); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title1, other.title1) && + Utils.enhancedDeepEquals(this.viewGroup, other.viewGroup) && + Utils.enhancedDeepEquals(this.viewMode, other.viewMode) && + Utils.enhancedDeepEquals(this.directory, other.directory) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.fieldType, other.fieldType); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - art, - content, - identifier, - librarySectionID, - mediaTagPrefix, - mediaTagVersion, - thumb, - title1, - viewGroup, - viewMode, - directory, - type, - fieldType); + return Utils.enhancedHash( + size, allowSync, art, + content, identifier, librarySectionID, + mediaTagPrefix, mediaTagVersion, thumb, + title1, viewGroup, viewMode, + directory, type, fieldType); } @Override @@ -462,43 +485,45 @@ public class GetLibraryDetailsMediaContainer { "type", type, "fieldType", fieldType); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional allowSync = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional content = Optional.empty(); - + private Optional identifier = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional mediaTagPrefix = Optional.empty(); - + private Optional mediaTagVersion = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional title1 = Optional.empty(); - + private Optional viewGroup = Optional.empty(); - + private Optional viewMode = Optional.empty(); - + private Optional> directory = Optional.empty(); - + private Optional> type = Optional.empty(); - + private Optional> fieldType = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -511,6 +536,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -523,6 +549,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -535,6 +562,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder content(String content) { Utils.checkNotNull(content, "content"); this.content = Optional.ofNullable(content); @@ -547,6 +575,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -559,6 +588,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder librarySectionID(int librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -571,6 +601,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder mediaTagPrefix(String mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); @@ -583,6 +614,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder mediaTagVersion(int mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); @@ -595,6 +627,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -607,6 +640,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder title1(String title1) { Utils.checkNotNull(title1, "title1"); this.title1 = Optional.ofNullable(title1); @@ -619,6 +653,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder viewGroup(String viewGroup) { Utils.checkNotNull(viewGroup, "viewGroup"); this.viewGroup = Optional.ofNullable(viewGroup); @@ -631,6 +666,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder viewMode(int viewMode) { Utils.checkNotNull(viewMode, "viewMode"); this.viewMode = Optional.ofNullable(viewMode); @@ -643,6 +679,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder directory(List directory) { Utils.checkNotNull(directory, "directory"); this.directory = Optional.ofNullable(directory); @@ -655,6 +692,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder type(List type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -667,6 +705,7 @@ public class GetLibraryDetailsMediaContainer { return this; } + public Builder fieldType(List fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = Optional.ofNullable(fieldType); @@ -678,24 +717,16 @@ public class GetLibraryDetailsMediaContainer { this.fieldType = fieldType; return this; } - + public GetLibraryDetailsMediaContainer build() { + return new GetLibraryDetailsMediaContainer( - size, - allowSync, - art, - content, - identifier, - librarySectionID, - mediaTagPrefix, - mediaTagVersion, - thumb, - title1, - viewGroup, - viewMode, - directory, - type, - fieldType); + size, allowSync, art, + content, identifier, librarySectionID, + mediaTagPrefix, mediaTagVersion, thumb, + title1, viewGroup, viewMode, + directory, type, fieldType); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsOperator.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsOperator.java index a8bf87ff..5351b115 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsOperator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsOperator.java @@ -11,15 +11,16 @@ 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 GetLibraryDetailsOperator { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; @@ -48,9 +49,10 @@ public class GetLibraryDetailsOperator { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsOperator withKey(String key) { Utils.checkNotNull(key, "key"); @@ -58,6 +60,7 @@ public class GetLibraryDetailsOperator { return this; } + public GetLibraryDetailsOperator withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -70,13 +73,13 @@ public class GetLibraryDetailsOperator { return this; } + public GetLibraryDetailsOperator withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -87,15 +90,14 @@ public class GetLibraryDetailsOperator { } GetLibraryDetailsOperator other = (GetLibraryDetailsOperator) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - key, - title); + return Utils.enhancedHash( + key, title); } @Override @@ -104,17 +106,19 @@ public class GetLibraryDetailsOperator { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -127,6 +131,7 @@ public class GetLibraryDetailsOperator { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -138,11 +143,12 @@ public class GetLibraryDetailsOperator { this.title = title; return this; } - + public GetLibraryDetailsOperator build() { + return new GetLibraryDetailsOperator( - key, - title); + key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequest.java index 5ef68fba..324393fc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequest.java @@ -13,11 +13,10 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetLibraryDetailsRequest { +public class GetLibraryDetailsRequest { /** * Whether or not to include details for a section (types, filters, and sorts). * Only exists for backwards compatibility, media providers other than the server libraries have it on always. @@ -66,9 +65,10 @@ public class GetLibraryDetailsRequest { return sectionKey; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Whether or not to include details for a section (types, filters, and sorts). @@ -80,6 +80,7 @@ public class GetLibraryDetailsRequest { return this; } + /** * Whether or not to include details for a section (types, filters, and sorts). * Only exists for backwards compatibility, media providers other than the server libraries have it on always. @@ -100,7 +101,6 @@ public class GetLibraryDetailsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,15 +111,14 @@ public class GetLibraryDetailsRequest { } GetLibraryDetailsRequest other = (GetLibraryDetailsRequest) o; return - Objects.deepEquals(this.includeDetails, other.includeDetails) && - Objects.deepEquals(this.sectionKey, other.sectionKey); + Utils.enhancedDeepEquals(this.includeDetails, other.includeDetails) && + Utils.enhancedDeepEquals(this.sectionKey, other.sectionKey); } @Override public int hashCode() { - return Objects.hash( - includeDetails, - sectionKey); + return Utils.enhancedHash( + includeDetails, sectionKey); } @Override @@ -128,17 +127,19 @@ public class GetLibraryDetailsRequest { "includeDetails", includeDetails, "sectionKey", sectionKey); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional includeDetails; - + private Integer sectionKey; - + private Builder() { // force use of static builder() method } + /** * Whether or not to include details for a section (types, filters, and sorts). * Only exists for backwards compatibility, media providers other than the server libraries have it on always. @@ -159,6 +160,7 @@ public class GetLibraryDetailsRequest { return this; } + /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -168,16 +170,17 @@ public class GetLibraryDetailsRequest { this.sectionKey = sectionKey; return this; } - + public GetLibraryDetailsRequest build() { if (includeDetails == null) { includeDetails = _SINGLETON_VALUE_IncludeDetails.value(); } + return new GetLibraryDetailsRequest( - includeDetails, - sectionKey); + includeDetails, sectionKey); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeDetails = new LazySingletonValue<>( "includeDetails", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java index 9c5b31d4..68758ed8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsRequestBuilder.java @@ -3,7 +3,11 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetLibraryDetails; import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; @@ -17,10 +21,10 @@ public class GetLibraryDetailsRequestBuilder { "0", new TypeReference>() {}); private Integer sectionKey; - private final SDKMethodInterfaces.MethodCallGetLibraryDetails sdk; + private final SDKConfiguration sdkConfiguration; - public GetLibraryDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryDetails sdk) { - this.sdk = sdk; + public GetLibraryDetailsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetLibraryDetailsRequestBuilder includeDetails(IncludeDetails includeDetails) { @@ -41,13 +45,25 @@ public class GetLibraryDetailsRequestBuilder { return this; } - public GetLibraryDetailsResponse call() throws Exception { + + private GetLibraryDetailsRequest buildRequest() { if (includeDetails == null) { includeDetails = _SINGLETON_VALUE_IncludeDetails.value(); } - return sdk.getLibraryDetails( - includeDetails, + + GetLibraryDetailsRequest request = new GetLibraryDetailsRequest(includeDetails, sectionKey); + + return request; + } + + public GetLibraryDetailsResponse call() throws Exception { + + RequestOperation operation + = new GetLibraryDetails.Sync(sdkConfiguration); + GetLibraryDetailsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } private static final LazySingletonValue> _SINGLETON_VALUE_IncludeDetails = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsResponse.java index 417ee666..709895a1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetLibraryDetailsResponse implements Response { +public class GetLibraryDetailsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetLibraryDetailsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetLibraryDetailsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetLibraryDetailsResponse implements Response { return this; } + /** * The details of the library */ @@ -143,7 +145,6 @@ public class GetLibraryDetailsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetLibraryDetailsResponse implements Response { } GetLibraryDetailsResponse other = (GetLibraryDetailsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetLibraryDetailsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetLibraryDetailsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetLibraryDetailsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetLibraryDetailsResponse implements Response { return this; } + /** * The details of the library */ @@ -236,13 +240,13 @@ public class GetLibraryDetailsResponse implements Response { this.object = object; return this; } - + public GetLibraryDetailsResponse build() { + return new GetLibraryDetailsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsResponseBody.java index 73647909..e7daacb0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetLibraryDetailsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsResponseBody withMediaContainer(GetLibraryDetailsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetLibraryDetailsResponseBody { return this; } + public GetLibraryDetailsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetLibraryDetailsResponseBody { } GetLibraryDetailsResponseBody other = (GetLibraryDetailsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetLibraryDetailsResponseBody { return Utils.toString(GetLibraryDetailsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetLibraryDetailsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetLibraryDetailsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetLibraryDetailsResponseBody build() { + return new GetLibraryDetailsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsSort.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsSort.java index 9c065260..930f3621 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsSort.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsSort.java @@ -11,31 +11,36 @@ 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 GetLibraryDetailsSort { @JsonInclude(Include.NON_ABSENT) @JsonProperty("default") private Optional default_; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultDirection") private Optional defaultDirection; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("descKey") private Optional descKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("firstCharacterKey") private Optional firstCharacterKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; @@ -63,7 +68,8 @@ public class GetLibraryDetailsSort { } public GetLibraryDetailsSort() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -96,9 +102,10 @@ public class GetLibraryDetailsSort { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsSort withDefault(String default_) { Utils.checkNotNull(default_, "default_"); @@ -106,6 +113,7 @@ public class GetLibraryDetailsSort { return this; } + public GetLibraryDetailsSort withDefault(Optional default_) { Utils.checkNotNull(default_, "default_"); this.default_ = default_; @@ -118,6 +126,7 @@ public class GetLibraryDetailsSort { return this; } + public GetLibraryDetailsSort withDefaultDirection(Optional defaultDirection) { Utils.checkNotNull(defaultDirection, "defaultDirection"); this.defaultDirection = defaultDirection; @@ -130,6 +139,7 @@ public class GetLibraryDetailsSort { return this; } + public GetLibraryDetailsSort withDescKey(Optional descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = descKey; @@ -142,6 +152,7 @@ public class GetLibraryDetailsSort { return this; } + public GetLibraryDetailsSort withFirstCharacterKey(Optional firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = firstCharacterKey; @@ -154,6 +165,7 @@ public class GetLibraryDetailsSort { return this; } + public GetLibraryDetailsSort withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -166,13 +178,13 @@ public class GetLibraryDetailsSort { return this; } + public GetLibraryDetailsSort withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -183,23 +195,19 @@ public class GetLibraryDetailsSort { } GetLibraryDetailsSort other = (GetLibraryDetailsSort) 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); + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.defaultDirection, other.defaultDirection) && + Utils.enhancedDeepEquals(this.descKey, other.descKey) && + Utils.enhancedDeepEquals(this.firstCharacterKey, other.firstCharacterKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - default_, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + return Utils.enhancedHash( + default_, defaultDirection, descKey, + firstCharacterKey, key, title); } @Override @@ -212,25 +220,27 @@ public class GetLibraryDetailsSort { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional default_ = Optional.empty(); - + private Optional defaultDirection = Optional.empty(); - + private Optional descKey = Optional.empty(); - + private Optional firstCharacterKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder default_(String default_) { Utils.checkNotNull(default_, "default_"); this.default_ = Optional.ofNullable(default_); @@ -243,6 +253,7 @@ public class GetLibraryDetailsSort { return this; } + public Builder defaultDirection(String defaultDirection) { Utils.checkNotNull(defaultDirection, "defaultDirection"); this.defaultDirection = Optional.ofNullable(defaultDirection); @@ -255,6 +266,7 @@ public class GetLibraryDetailsSort { return this; } + public Builder descKey(String descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = Optional.ofNullable(descKey); @@ -267,6 +279,7 @@ public class GetLibraryDetailsSort { return this; } + public Builder firstCharacterKey(String firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = Optional.ofNullable(firstCharacterKey); @@ -279,6 +292,7 @@ public class GetLibraryDetailsSort { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -291,6 +305,7 @@ public class GetLibraryDetailsSort { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -302,15 +317,13 @@ public class GetLibraryDetailsSort { this.title = title; return this; } - + public GetLibraryDetailsSort build() { + return new GetLibraryDetailsSort( - default_, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + default_, defaultDirection, descKey, + firstCharacterKey, key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsType.java index f7028ea4..4a5d758f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryDetailsType.java @@ -14,35 +14,41 @@ 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 GetLibraryDetailsType { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("active") private Optional 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; @@ -73,7 +79,9 @@ public class GetLibraryDetailsType { } public GetLibraryDetailsType() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -114,9 +122,10 @@ public class GetLibraryDetailsType { return (Optional>) field; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryDetailsType withKey(String key) { Utils.checkNotNull(key, "key"); @@ -124,6 +133,7 @@ public class GetLibraryDetailsType { return this; } + public GetLibraryDetailsType withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -136,6 +146,7 @@ public class GetLibraryDetailsType { return this; } + public GetLibraryDetailsType withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -148,6 +159,7 @@ public class GetLibraryDetailsType { return this; } + public GetLibraryDetailsType withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -160,6 +172,7 @@ public class GetLibraryDetailsType { return this; } + public GetLibraryDetailsType withActive(Optional active) { Utils.checkNotNull(active, "active"); this.active = active; @@ -172,6 +185,7 @@ public class GetLibraryDetailsType { return this; } + public GetLibraryDetailsType withFilter(Optional> filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -184,6 +198,7 @@ public class GetLibraryDetailsType { return this; } + public GetLibraryDetailsType withSort(Optional> sort) { Utils.checkNotNull(sort, "sort"); this.sort = sort; @@ -196,13 +211,13 @@ public class GetLibraryDetailsType { return this; } + public GetLibraryDetailsType withField(Optional> field) { Utils.checkNotNull(field, "field"); this.field = field; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -213,24 +228,20 @@ public class GetLibraryDetailsType { } GetLibraryDetailsType other = (GetLibraryDetailsType) 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.field, other.field); } @Override public int hashCode() { - return Objects.hash( - key, - type, - title, - active, - filter, - sort, + return Utils.enhancedHash( + key, type, title, + active, filter, sort, field); } @@ -245,27 +256,29 @@ public class GetLibraryDetailsType { "sort", sort, "field", field); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional active = Optional.empty(); - + 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 = Optional.ofNullable(key); @@ -278,6 +291,7 @@ public class GetLibraryDetailsType { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -290,6 +304,7 @@ public class GetLibraryDetailsType { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -302,6 +317,7 @@ public class GetLibraryDetailsType { return this; } + public Builder active(boolean active) { Utils.checkNotNull(active, "active"); this.active = Optional.ofNullable(active); @@ -314,6 +330,7 @@ public class GetLibraryDetailsType { return this; } + public Builder filter(List filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); @@ -326,6 +343,7 @@ public class GetLibraryDetailsType { return this; } + public Builder sort(List sort) { Utils.checkNotNull(sort, "sort"); this.sort = Optional.ofNullable(sort); @@ -338,6 +356,7 @@ public class GetLibraryDetailsType { return this; } + public Builder field(List field) { Utils.checkNotNull(field, "field"); this.field = Optional.ofNullable(field); @@ -349,16 +368,14 @@ public class GetLibraryDetailsType { this.field = field; return this; } - + public GetLibraryDetailsType build() { + return new GetLibraryDetailsType( - key, - type, - title, - active, - filter, - sort, + key, type, title, + active, filter, sort, field); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsCountry.java index c44ab25a..2481e5eb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsCountry.java @@ -11,9 +11,9 @@ 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 GetLibraryHubsCountry { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetLibraryHubsCountry { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsCountry withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetLibraryHubsCountry { return this; } + public GetLibraryHubsCountry withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetLibraryHubsCountry { } GetLibraryHubsCountry other = (GetLibraryHubsCountry) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetLibraryHubsCountry { return Utils.toString(GetLibraryHubsCountry.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetLibraryHubsCountry { this.tag = tag; return this; } - + public GetLibraryHubsCountry build() { + return new GetLibraryHubsCountry( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsDirector.java index 0ac2ea74..0e232faf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsDirector.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsDirector.java @@ -11,9 +11,9 @@ 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 GetLibraryHubsDirector { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetLibraryHubsDirector { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsDirector withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetLibraryHubsDirector { return this; } + public GetLibraryHubsDirector withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetLibraryHubsDirector { } GetLibraryHubsDirector other = (GetLibraryHubsDirector) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetLibraryHubsDirector { return Utils.toString(GetLibraryHubsDirector.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetLibraryHubsDirector { this.tag = tag; return this; } - + public GetLibraryHubsDirector build() { + return new GetLibraryHubsDirector( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsGenre.java index 564a0899..24025f44 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsGenre.java @@ -11,9 +11,9 @@ 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 GetLibraryHubsGenre { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetLibraryHubsGenre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsGenre withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetLibraryHubsGenre { return this; } + public GetLibraryHubsGenre withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetLibraryHubsGenre { } GetLibraryHubsGenre other = (GetLibraryHubsGenre) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetLibraryHubsGenre { return Utils.toString(GetLibraryHubsGenre.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetLibraryHubsGenre { this.tag = tag; return this; } - + public GetLibraryHubsGenre build() { + return new GetLibraryHubsGenre( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsHub.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsHub.java index 397caddb..8d0cc8c4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsHub.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsHub.java @@ -15,55 +15,66 @@ 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 GetLibraryHubsHub { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hubIdentifier") private Optional hubIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("context") private Optional context; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("more") private Optional more; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("style") private Optional style; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hubKey") private Optional hubKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("promoted") private Optional promoted; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("random") private Optional random; @@ -109,7 +120,10 @@ public class GetLibraryHubsHub { } public GetLibraryHubsHub() { - 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()); + 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()); } @JsonIgnore @@ -173,9 +187,10 @@ public class GetLibraryHubsHub { return random; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsHub withKey(String key) { Utils.checkNotNull(key, "key"); @@ -183,6 +198,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -195,6 +211,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -207,6 +224,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -219,6 +237,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withHubIdentifier(Optional hubIdentifier) { Utils.checkNotNull(hubIdentifier, "hubIdentifier"); this.hubIdentifier = hubIdentifier; @@ -231,6 +250,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withContext(Optional context) { Utils.checkNotNull(context, "context"); this.context = context; @@ -243,6 +263,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -255,6 +276,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withMore(Optional more) { Utils.checkNotNull(more, "more"); this.more = more; @@ -267,6 +289,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withStyle(Optional style) { Utils.checkNotNull(style, "style"); this.style = style; @@ -279,6 +302,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withHubKey(Optional hubKey) { Utils.checkNotNull(hubKey, "hubKey"); this.hubKey = hubKey; @@ -291,6 +315,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; @@ -303,6 +328,7 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withPromoted(Optional promoted) { Utils.checkNotNull(promoted, "promoted"); this.promoted = promoted; @@ -315,13 +341,13 @@ public class GetLibraryHubsHub { return this; } + public GetLibraryHubsHub withRandom(Optional random) { Utils.checkNotNull(random, "random"); this.random = random; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -332,35 +358,27 @@ public class GetLibraryHubsHub { } GetLibraryHubsHub other = (GetLibraryHubsHub) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.hubIdentifier, other.hubIdentifier) && - Objects.deepEquals(this.context, other.context) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.more, other.more) && - Objects.deepEquals(this.style, other.style) && - Objects.deepEquals(this.hubKey, other.hubKey) && - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.promoted, other.promoted) && - Objects.deepEquals(this.random, other.random); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.hubIdentifier, other.hubIdentifier) && + Utils.enhancedDeepEquals(this.context, other.context) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.more, other.more) && + Utils.enhancedDeepEquals(this.style, other.style) && + Utils.enhancedDeepEquals(this.hubKey, other.hubKey) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.promoted, other.promoted) && + Utils.enhancedDeepEquals(this.random, other.random); } @Override public int hashCode() { - return Objects.hash( - key, - title, - type, - hubIdentifier, - context, - size, - more, - style, - hubKey, - metadata, - promoted, - random); + return Utils.enhancedHash( + key, title, type, + hubIdentifier, context, size, + more, style, hubKey, + metadata, promoted, random); } @Override @@ -379,37 +397,39 @@ public class GetLibraryHubsHub { "promoted", promoted, "random", random); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional hubIdentifier = Optional.empty(); - + private Optional context = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional more = Optional.empty(); - + private Optional style = Optional.empty(); - + private Optional hubKey = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Optional promoted = Optional.empty(); - + private Optional random = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -422,6 +442,7 @@ public class GetLibraryHubsHub { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -434,6 +455,7 @@ public class GetLibraryHubsHub { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -446,6 +468,7 @@ public class GetLibraryHubsHub { return this; } + public Builder hubIdentifier(String hubIdentifier) { Utils.checkNotNull(hubIdentifier, "hubIdentifier"); this.hubIdentifier = Optional.ofNullable(hubIdentifier); @@ -458,6 +481,7 @@ public class GetLibraryHubsHub { return this; } + public Builder context(String context) { Utils.checkNotNull(context, "context"); this.context = Optional.ofNullable(context); @@ -470,6 +494,7 @@ public class GetLibraryHubsHub { return this; } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -482,6 +507,7 @@ public class GetLibraryHubsHub { return this; } + public Builder more(boolean more) { Utils.checkNotNull(more, "more"); this.more = Optional.ofNullable(more); @@ -494,6 +520,7 @@ public class GetLibraryHubsHub { return this; } + public Builder style(String style) { Utils.checkNotNull(style, "style"); this.style = Optional.ofNullable(style); @@ -506,6 +533,7 @@ public class GetLibraryHubsHub { return this; } + public Builder hubKey(String hubKey) { Utils.checkNotNull(hubKey, "hubKey"); this.hubKey = Optional.ofNullable(hubKey); @@ -518,6 +546,7 @@ public class GetLibraryHubsHub { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -530,6 +559,7 @@ public class GetLibraryHubsHub { return this; } + public Builder promoted(boolean promoted) { Utils.checkNotNull(promoted, "promoted"); this.promoted = Optional.ofNullable(promoted); @@ -542,6 +572,7 @@ public class GetLibraryHubsHub { return this; } + public Builder random(boolean random) { Utils.checkNotNull(random, "random"); this.random = Optional.ofNullable(random); @@ -553,21 +584,15 @@ public class GetLibraryHubsHub { this.random = random; return this; } - + public GetLibraryHubsHub build() { + return new GetLibraryHubsHub( - key, - title, - type, - hubIdentifier, - context, - size, - more, - style, - hubKey, - metadata, - promoted, - random); + key, title, type, + hubIdentifier, context, size, + more, style, hubKey, + metadata, promoted, random); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMedia.java index 0ccad794..68bbdd95 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMedia.java @@ -16,75 +16,91 @@ 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 GetLibraryHubsMedia { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") private Optional bitrate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("width") private Optional width; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("height") private Optional height; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("aspectRatio") private Optional aspectRatio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") private Optional audioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoCodec") private Optional videoCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoResolution") private Optional videoResolution; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoFrameRate") private Optional videoFrameRate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Part") private Optional> part; @@ -145,7 +161,12 @@ public class GetLibraryHubsMedia { } public GetLibraryHubsMedia() { - 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()); + 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()); } @JsonIgnore @@ -234,9 +255,10 @@ public class GetLibraryHubsMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsMedia withId(int id) { Utils.checkNotNull(id, "id"); @@ -244,6 +266,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -256,6 +279,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -268,6 +292,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; @@ -280,6 +305,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withWidth(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; @@ -292,6 +318,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withHeight(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; @@ -304,6 +331,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withAspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; @@ -316,6 +344,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; @@ -328,6 +357,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; @@ -340,6 +370,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withVideoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; @@ -352,6 +383,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withVideoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; @@ -364,6 +396,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -376,6 +409,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withVideoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; @@ -388,6 +422,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withOptimizedForStreaming(Optional optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = optimizedForStreaming; @@ -400,6 +435,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withAudioProfile(Optional audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = audioProfile; @@ -412,6 +448,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -424,6 +461,7 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; @@ -436,13 +474,13 @@ public class GetLibraryHubsMedia { return this; } + public GetLibraryHubsMedia withPart(Optional> part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -453,45 +491,34 @@ public class GetLibraryHubsMedia { } GetLibraryHubsMedia other = (GetLibraryHubsMedia) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - optimizedForStreaming, - audioProfile, - has64bitOffsets, - videoProfile, - part); + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, audioCodec, videoCodec, + videoResolution, container, videoFrameRate, + optimizedForStreaming, audioProfile, has64bitOffsets, + videoProfile, part); } @Override @@ -515,47 +542,49 @@ public class GetLibraryHubsMedia { "videoProfile", videoProfile, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -568,6 +597,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -580,6 +610,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder bitrate(int bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = Optional.ofNullable(bitrate); @@ -592,6 +623,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder width(int width) { Utils.checkNotNull(width, "width"); this.width = Optional.ofNullable(width); @@ -604,6 +636,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder height(int height) { Utils.checkNotNull(height, "height"); this.height = Optional.ofNullable(height); @@ -616,6 +649,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder aspectRatio(double aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = Optional.ofNullable(aspectRatio); @@ -628,6 +662,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder audioChannels(int audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = Optional.ofNullable(audioChannels); @@ -640,6 +675,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder audioCodec(String audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = Optional.ofNullable(audioCodec); @@ -652,6 +688,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder videoCodec(String videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = Optional.ofNullable(videoCodec); @@ -664,6 +701,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder videoResolution(String videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = Optional.ofNullable(videoResolution); @@ -676,6 +714,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -688,6 +727,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder videoFrameRate(String videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = Optional.ofNullable(videoFrameRate); @@ -700,6 +740,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder optimizedForStreaming(int optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); @@ -712,6 +753,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder audioProfile(String audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = Optional.ofNullable(audioProfile); @@ -724,6 +766,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -736,6 +779,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); @@ -748,6 +792,7 @@ public class GetLibraryHubsMedia { return this; } + public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = Optional.ofNullable(part); @@ -759,26 +804,17 @@ public class GetLibraryHubsMedia { this.part = part; return this; } - + public GetLibraryHubsMedia build() { + return new GetLibraryHubsMedia( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - optimizedForStreaming, - audioProfile, - has64bitOffsets, - videoProfile, - part); + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, audioCodec, videoCodec, + videoResolution, container, videoFrameRate, + optimizedForStreaming, audioProfile, has64bitOffsets, + videoProfile, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMediaContainer.java index 9244a05f..c8bd8e48 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMediaContainer.java @@ -15,35 +15,41 @@ 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 GetLibraryHubsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionUUID") private Optional librarySectionUUID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Hub") private Optional> hub; @@ -74,7 +80,9 @@ public class GetLibraryHubsMediaContainer { } public GetLibraryHubsMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -113,9 +121,10 @@ public class GetLibraryHubsMediaContainer { return (Optional>) hub; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -123,6 +132,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public GetLibraryHubsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -135,6 +145,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public GetLibraryHubsMediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -147,6 +158,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public GetLibraryHubsMediaContainer withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -159,6 +171,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public GetLibraryHubsMediaContainer withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -171,6 +184,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public GetLibraryHubsMediaContainer withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -183,6 +197,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public GetLibraryHubsMediaContainer withLibrarySectionUUID(Optional librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = librarySectionUUID; @@ -195,13 +210,13 @@ public class GetLibraryHubsMediaContainer { return this; } + public GetLibraryHubsMediaContainer withHub(Optional> hub) { Utils.checkNotNull(hub, "hub"); this.hub = hub; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -212,24 +227,20 @@ public class GetLibraryHubsMediaContainer { } GetLibraryHubsMediaContainer other = (GetLibraryHubsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - Objects.deepEquals(this.hub, other.hub); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionUUID, other.librarySectionUUID) && + Utils.enhancedDeepEquals(this.hub, other.hub); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, + return Utils.enhancedHash( + size, allowSync, identifier, + librarySectionID, librarySectionTitle, librarySectionUUID, hub); } @@ -244,27 +255,29 @@ public class GetLibraryHubsMediaContainer { "librarySectionUUID", librarySectionUUID, "hub", hub); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional allowSync = Optional.empty(); - + private Optional identifier = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionUUID = Optional.empty(); - + private Optional> hub = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -277,6 +290,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -289,6 +303,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -301,6 +316,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public Builder librarySectionID(int librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -313,6 +329,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -325,6 +342,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public Builder librarySectionUUID(String librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); @@ -337,6 +355,7 @@ public class GetLibraryHubsMediaContainer { return this; } + public Builder hub(List hub) { Utils.checkNotNull(hub, "hub"); this.hub = Optional.ofNullable(hub); @@ -348,16 +367,14 @@ public class GetLibraryHubsMediaContainer { this.hub = hub; return this; } - + public GetLibraryHubsMediaContainer build() { + return new GetLibraryHubsMediaContainer( - size, - allowSync, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, + size, allowSync, identifier, + librarySectionID, librarySectionTitle, librarySectionUUID, hub); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMetadata.java index 9279e016..cc88ed68 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsMetadata.java @@ -16,143 +16,176 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; + public class GetLibraryHubsMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("studio") private Optional studio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionKey") private Optional librarySectionKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentRating") private Optional contentRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("rating") private Optional rating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRating") private Optional audienceRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewCount") private Optional viewCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("lastViewedAt") private Optional lastViewedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("year") private Optional year; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagline") private Optional tagline; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRatingImage") private Optional audienceRatingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("primaryExtraKey") private Optional primaryExtraKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingImage") private Optional ratingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("skipCount") private Optional skipCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("chapterSource") private Optional chapterSource; @@ -264,7 +297,18 @@ public class GetLibraryHubsMetadata { } public GetLibraryHubsMetadata() { - 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()); + 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()); } @JsonIgnore @@ -443,9 +487,10 @@ public class GetLibraryHubsMetadata { return chapterSource; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -453,6 +498,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -465,6 +511,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -477,6 +524,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -489,6 +537,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withStudio(Optional studio) { Utils.checkNotNull(studio, "studio"); this.studio = studio; @@ -501,6 +550,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -513,6 +563,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -525,6 +576,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -537,6 +589,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -549,6 +602,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withLibrarySectionKey(Optional librarySectionKey) { Utils.checkNotNull(librarySectionKey, "librarySectionKey"); this.librarySectionKey = librarySectionKey; @@ -561,6 +615,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withContentRating(Optional contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = contentRating; @@ -573,6 +628,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -585,6 +641,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withRating(Optional rating) { Utils.checkNotNull(rating, "rating"); this.rating = rating; @@ -597,6 +654,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withAudienceRating(Optional audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = audienceRating; @@ -609,6 +667,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withViewCount(Optional viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = viewCount; @@ -621,6 +680,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withLastViewedAt(Optional lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = lastViewedAt; @@ -633,6 +693,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withYear(Optional year) { Utils.checkNotNull(year, "year"); this.year = year; @@ -645,6 +706,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withTagline(Optional tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = tagline; @@ -657,6 +719,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -669,6 +732,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -681,6 +745,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -693,6 +758,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = originallyAvailableAt; @@ -705,6 +771,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -717,6 +784,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -729,6 +797,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withAudienceRatingImage(Optional audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = audienceRatingImage; @@ -741,6 +810,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withPrimaryExtraKey(Optional primaryExtraKey) { Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); this.primaryExtraKey = primaryExtraKey; @@ -753,6 +823,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withRatingImage(Optional ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = ratingImage; @@ -765,6 +836,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -777,6 +849,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -789,6 +862,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -801,6 +875,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -813,6 +888,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; @@ -825,6 +901,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -837,6 +914,7 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withSkipCount(Optional skipCount) { Utils.checkNotNull(skipCount, "skipCount"); this.skipCount = skipCount; @@ -849,13 +927,13 @@ public class GetLibraryHubsMetadata { return this; } + public GetLibraryHubsMetadata withChapterSource(Optional chapterSource) { Utils.checkNotNull(chapterSource, "chapterSource"); this.chapterSource = chapterSource; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -866,78 +944,56 @@ public class GetLibraryHubsMetadata { } GetLibraryHubsMetadata other = (GetLibraryHubsMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.skipCount, other.skipCount) && - Objects.deepEquals(this.chapterSource, other.chapterSource); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.skipCount, other.skipCount) && + Utils.enhancedDeepEquals(this.chapterSource, other.chapterSource); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - studio, - type, - title, - librarySectionTitle, - librarySectionID, - librarySectionKey, - contentRating, - summary, - rating, - audienceRating, - viewCount, - lastViewedAt, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - primaryExtraKey, - ratingImage, - media, - genre, - country, - director, - role, - writer, - skipCount, + return Utils.enhancedHash( + ratingKey, key, guid, + studio, type, title, + librarySectionTitle, librarySectionID, librarySectionKey, + contentRating, summary, rating, + audienceRating, viewCount, lastViewedAt, + year, tagline, thumb, + art, duration, originallyAvailableAt, + addedAt, updatedAt, audienceRatingImage, + primaryExtraKey, ratingImage, media, + genre, country, director, + role, writer, skipCount, chapterSource); } @@ -979,81 +1035,83 @@ public class GetLibraryHubsMetadata { "skipCount", skipCount, "chapterSource", chapterSource); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional studio = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionKey = Optional.empty(); - + private Optional contentRating = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional rating = Optional.empty(); - + private Optional audienceRating = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional year = Optional.empty(); - + private Optional tagline = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional originallyAvailableAt = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional primaryExtraKey = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional skipCount = Optional.empty(); - + private Optional chapterSource = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -1066,6 +1124,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -1078,6 +1137,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -1090,6 +1150,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder studio(String studio) { Utils.checkNotNull(studio, "studio"); this.studio = Optional.ofNullable(studio); @@ -1102,6 +1163,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -1114,6 +1176,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -1126,6 +1189,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -1138,6 +1202,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder librarySectionID(int librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -1150,6 +1215,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder librarySectionKey(String librarySectionKey) { Utils.checkNotNull(librarySectionKey, "librarySectionKey"); this.librarySectionKey = Optional.ofNullable(librarySectionKey); @@ -1162,6 +1228,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder contentRating(String contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = Optional.ofNullable(contentRating); @@ -1174,6 +1241,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -1186,6 +1254,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder rating(double rating) { Utils.checkNotNull(rating, "rating"); this.rating = Optional.ofNullable(rating); @@ -1198,6 +1267,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder audienceRating(double audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = Optional.ofNullable(audienceRating); @@ -1210,6 +1280,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder viewCount(int viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = Optional.ofNullable(viewCount); @@ -1222,6 +1293,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder lastViewedAt(int lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = Optional.ofNullable(lastViewedAt); @@ -1234,6 +1306,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder year(int year) { Utils.checkNotNull(year, "year"); this.year = Optional.ofNullable(year); @@ -1246,6 +1319,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder tagline(String tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = Optional.ofNullable(tagline); @@ -1258,6 +1332,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -1270,6 +1345,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -1282,6 +1358,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -1294,6 +1371,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder originallyAvailableAt(LocalDate originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); @@ -1306,6 +1384,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -1318,6 +1397,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -1330,6 +1410,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder audienceRatingImage(String audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); @@ -1342,6 +1423,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder primaryExtraKey(String primaryExtraKey) { Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); @@ -1354,6 +1436,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder ratingImage(String ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = Optional.ofNullable(ratingImage); @@ -1366,6 +1449,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -1378,6 +1462,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -1390,6 +1475,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -1402,6 +1488,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -1414,6 +1501,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -1426,6 +1514,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -1438,6 +1527,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder skipCount(int skipCount) { Utils.checkNotNull(skipCount, "skipCount"); this.skipCount = Optional.ofNullable(skipCount); @@ -1450,6 +1540,7 @@ public class GetLibraryHubsMetadata { return this; } + public Builder chapterSource(String chapterSource) { Utils.checkNotNull(chapterSource, "chapterSource"); this.chapterSource = Optional.ofNullable(chapterSource); @@ -1461,43 +1552,23 @@ public class GetLibraryHubsMetadata { this.chapterSource = chapterSource; return this; } - + public GetLibraryHubsMetadata build() { + return new GetLibraryHubsMetadata( - ratingKey, - key, - guid, - studio, - type, - title, - librarySectionTitle, - librarySectionID, - librarySectionKey, - contentRating, - summary, - rating, - audienceRating, - viewCount, - lastViewedAt, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - primaryExtraKey, - ratingImage, - media, - genre, - country, - director, - role, - writer, - skipCount, + ratingKey, key, guid, + studio, type, title, + librarySectionTitle, librarySectionID, librarySectionKey, + contentRating, summary, rating, + audienceRating, viewCount, lastViewedAt, + year, tagline, thumb, + art, duration, originallyAvailableAt, + addedAt, updatedAt, audienceRatingImage, + primaryExtraKey, ratingImage, media, + genre, country, director, + role, writer, skipCount, chapterSource); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsPart.java index 0f7fb7c0..46bdc747 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsPart.java @@ -13,47 +13,56 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetLibraryHubsPart { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("file") private Optional file; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; @@ -93,7 +102,10 @@ public class GetLibraryHubsPart { } public GetLibraryHubsPart() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -146,9 +158,10 @@ public class GetLibraryHubsPart { return videoProfile; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsPart withId(int id) { Utils.checkNotNull(id, "id"); @@ -156,6 +169,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -168,6 +182,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -180,6 +195,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -192,6 +208,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withFile(Optional file) { Utils.checkNotNull(file, "file"); this.file = file; @@ -204,6 +221,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -216,6 +234,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withAudioProfile(Optional audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = audioProfile; @@ -228,6 +247,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -240,6 +260,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -252,6 +273,7 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withOptimizedForStreaming(Optional optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = optimizedForStreaming; @@ -264,13 +286,13 @@ public class GetLibraryHubsPart { return this; } + public GetLibraryHubsPart withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -281,30 +303,24 @@ public class GetLibraryHubsPart { } GetLibraryHubsPart other = (GetLibraryHubsPart) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.videoProfile, other.videoProfile); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile); } @Override public int hashCode() { - return Objects.hash( - id, - key, - duration, - file, - size, - audioProfile, - container, - has64bitOffsets, - optimizedForStreaming, + return Utils.enhancedHash( + id, key, duration, + file, size, audioProfile, + container, has64bitOffsets, optimizedForStreaming, videoProfile); } @@ -322,33 +338,35 @@ public class GetLibraryHubsPart { "optimizedForStreaming", optimizedForStreaming, "videoProfile", videoProfile); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional file = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -361,6 +379,7 @@ public class GetLibraryHubsPart { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -373,6 +392,7 @@ public class GetLibraryHubsPart { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -385,6 +405,7 @@ public class GetLibraryHubsPart { return this; } + public Builder file(String file) { Utils.checkNotNull(file, "file"); this.file = Optional.ofNullable(file); @@ -397,6 +418,7 @@ public class GetLibraryHubsPart { return this; } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -409,6 +431,7 @@ public class GetLibraryHubsPart { return this; } + public Builder audioProfile(String audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = Optional.ofNullable(audioProfile); @@ -421,6 +444,7 @@ public class GetLibraryHubsPart { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -433,6 +457,7 @@ public class GetLibraryHubsPart { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -445,6 +470,7 @@ public class GetLibraryHubsPart { return this; } + public Builder optimizedForStreaming(boolean optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); @@ -457,6 +483,7 @@ public class GetLibraryHubsPart { return this; } + public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); @@ -468,19 +495,15 @@ public class GetLibraryHubsPart { this.videoProfile = videoProfile; return this; } - + public GetLibraryHubsPart build() { + return new GetLibraryHubsPart( - id, - key, - duration, - file, - size, - audioProfile, - container, - has64bitOffsets, - optimizedForStreaming, + id, key, duration, + file, size, audioProfile, + container, has64bitOffsets, optimizedForStreaming, videoProfile); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequest.java index 005c456d..3bcc68e7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequest.java @@ -11,11 +11,10 @@ import java.lang.Double; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetLibraryHubsRequest { +public class GetLibraryHubsRequest { /** * the Id of the library to query */ @@ -77,9 +76,10 @@ public class GetLibraryHubsRequest { return (Optional) onlyTransient; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the Id of the library to query @@ -99,6 +99,7 @@ public class GetLibraryHubsRequest { return this; } + /** * The number of items to return with each hub. */ @@ -117,6 +118,7 @@ public class GetLibraryHubsRequest { return this; } + /** * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). */ @@ -126,7 +128,6 @@ public class GetLibraryHubsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,17 +138,15 @@ public class GetLibraryHubsRequest { } GetLibraryHubsRequest other = (GetLibraryHubsRequest) o; return - Objects.deepEquals(this.sectionId, other.sectionId) && - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.onlyTransient, other.onlyTransient); + Utils.enhancedDeepEquals(this.sectionId, other.sectionId) && + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.onlyTransient, other.onlyTransient); } @Override public int hashCode() { - return Objects.hash( - sectionId, - count, - onlyTransient); + return Utils.enhancedHash( + sectionId, count, onlyTransient); } @Override @@ -157,19 +156,21 @@ public class GetLibraryHubsRequest { "count", count, "onlyTransient", onlyTransient); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double sectionId; - + private Optional count = Optional.empty(); - + private Optional onlyTransient = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * the Id of the library to query */ @@ -179,6 +180,7 @@ public class GetLibraryHubsRequest { return this; } + /** * The number of items to return with each hub. */ @@ -197,6 +199,7 @@ public class GetLibraryHubsRequest { return this; } + /** * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). */ @@ -214,12 +217,12 @@ public class GetLibraryHubsRequest { this.onlyTransient = onlyTransient; return this; } - + public GetLibraryHubsRequest build() { + return new GetLibraryHubsRequest( - sectionId, - count, - onlyTransient); + sectionId, count, onlyTransient); } + } } 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 6907f04c..11cd5c31 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetLibraryHubs; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -13,10 +17,10 @@ public class GetLibraryHubsRequestBuilder { private Double sectionId; private Optional count = Optional.empty(); private Optional onlyTransient = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetLibraryHubs sdk; + private final SDKConfiguration sdkConfiguration; - public GetLibraryHubsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryHubs sdk) { - this.sdk = sdk; + public GetLibraryHubsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetLibraryHubsRequestBuilder sectionId(double sectionId) { @@ -49,11 +53,22 @@ public class GetLibraryHubsRequestBuilder { return this; } - public GetLibraryHubsResponse call() throws Exception { - return sdk.getLibraryHubs( - sectionId, + private GetLibraryHubsRequest buildRequest() { + + GetLibraryHubsRequest request = new GetLibraryHubsRequest(sectionId, count, onlyTransient); + + return request; + } + + public GetLibraryHubsResponse call() throws Exception { + + RequestOperation operation + = new GetLibraryHubs.Sync(sdkConfiguration); + GetLibraryHubsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsResponse.java index 1b13b510..23d92bab 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetLibraryHubsResponse implements Response { +public class GetLibraryHubsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetLibraryHubsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetLibraryHubsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetLibraryHubsResponse implements Response { return this; } + /** * The hubs specific to the library */ @@ -143,7 +145,6 @@ public class GetLibraryHubsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetLibraryHubsResponse implements Response { } GetLibraryHubsResponse other = (GetLibraryHubsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetLibraryHubsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetLibraryHubsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetLibraryHubsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetLibraryHubsResponse implements Response { return this; } + /** * The hubs specific to the library */ @@ -236,13 +240,13 @@ public class GetLibraryHubsResponse implements Response { this.object = object; return this; } - + public GetLibraryHubsResponse build() { + return new GetLibraryHubsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsResponseBody.java index e8fc6467..5ec8a45d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetLibraryHubsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsResponseBody withMediaContainer(GetLibraryHubsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetLibraryHubsResponseBody { return this; } + public GetLibraryHubsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetLibraryHubsResponseBody { } GetLibraryHubsResponseBody other = (GetLibraryHubsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetLibraryHubsResponseBody { return Utils.toString(GetLibraryHubsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetLibraryHubsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetLibraryHubsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetLibraryHubsResponseBody build() { + return new GetLibraryHubsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRole.java index f4d14192..15587e69 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsRole.java @@ -11,9 +11,9 @@ 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 GetLibraryHubsRole { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetLibraryHubsRole { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsRole withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetLibraryHubsRole { return this; } + public GetLibraryHubsRole withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetLibraryHubsRole { } GetLibraryHubsRole other = (GetLibraryHubsRole) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetLibraryHubsRole { return Utils.toString(GetLibraryHubsRole.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetLibraryHubsRole { this.tag = tag; return this; } - + public GetLibraryHubsRole build() { + return new GetLibraryHubsRole( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsWriter.java index 6c40ce53..d5d912c1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsWriter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryHubsWriter.java @@ -11,9 +11,9 @@ 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 GetLibraryHubsWriter { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetLibraryHubsWriter { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryHubsWriter withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetLibraryHubsWriter { return this; } + public GetLibraryHubsWriter withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetLibraryHubsWriter { } GetLibraryHubsWriter other = (GetLibraryHubsWriter) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetLibraryHubsWriter { return Utils.toString(GetLibraryHubsWriter.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetLibraryHubsWriter { this.tag = tag; return this; } - + public GetLibraryHubsWriter build() { + return new GetLibraryHubsWriter( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsActiveDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsActiveDirection.java index 0fd4f19c..080cbbc5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsActiveDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsActiveDirection.java @@ -20,7 +20,7 @@ public enum GetLibraryItemsActiveDirection { @JsonValue private final String value; - private GetLibraryItemsActiveDirection(String value) { + GetLibraryItemsActiveDirection(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCollection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCollection.java index 2108205f..cd4abdd7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCollection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCollection.java @@ -9,10 +9,9 @@ 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 GetLibraryItemsCollection { - /** * The user-made collection this media item belongs to */ @@ -34,9 +33,10 @@ public class GetLibraryItemsCollection { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The user-made collection this media item belongs to @@ -47,7 +47,6 @@ public class GetLibraryItemsCollection { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibraryItemsCollection { } GetLibraryItemsCollection other = (GetLibraryItemsCollection) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -72,15 +71,17 @@ public class GetLibraryItemsCollection { return Utils.toString(GetLibraryItemsCollection.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The user-made collection this media item belongs to */ @@ -89,10 +90,12 @@ public class GetLibraryItemsCollection { this.tag = tag; return this; } - + public GetLibraryItemsCollection build() { + return new GetLibraryItemsCollection( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCountry.java index af998bf5..f6d4dd73 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsCountry.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetLibraryItemsCountry { - /** * The unique identifier for the country. * NOTE: This is different for each Plex server and is not globally unique. @@ -54,9 +53,10 @@ public class GetLibraryItemsCountry { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the country. @@ -77,7 +77,6 @@ public class GetLibraryItemsCountry { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,15 +87,14 @@ public class GetLibraryItemsCountry { } GetLibraryItemsCountry other = (GetLibraryItemsCountry) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - tag); + return Utils.enhancedHash( + id, tag); } @Override @@ -105,17 +103,19 @@ public class GetLibraryItemsCountry { "id", id, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the country. * NOTE: This is different for each Plex server and is not globally unique. @@ -126,6 +126,7 @@ public class GetLibraryItemsCountry { return this; } + /** * The country of origin of this media item */ @@ -134,11 +135,12 @@ public class GetLibraryItemsCountry { this.tag = tag; return this; } - + public GetLibraryItemsCountry build() { + return new GetLibraryItemsCountry( - id, - tag); + id, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDefaultDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDefaultDirection.java index 24d9fe51..c0057b25 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDefaultDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDefaultDirection.java @@ -20,7 +20,7 @@ public enum GetLibraryItemsDefaultDirection { @JsonValue private final String value; - private GetLibraryItemsDefaultDirection(String value) { + GetLibraryItemsDefaultDirection(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDirector.java index 5f80985b..62da3b66 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDirector.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsDirector.java @@ -12,11 +12,10 @@ 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 GetLibraryItemsDirector { +public class GetLibraryItemsDirector { /** * Unique identifier for the director. */ @@ -79,9 +78,10 @@ public class GetLibraryItemsDirector { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the director. @@ -110,6 +110,7 @@ public class GetLibraryItemsDirector { return this; } + /** * The absolute URL of the thumbnail image for the director. */ @@ -119,7 +120,6 @@ public class GetLibraryItemsDirector { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -130,17 +130,15 @@ public class GetLibraryItemsDirector { } GetLibraryItemsDirector other = (GetLibraryItemsDirector) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - thumb); + return Utils.enhancedHash( + id, tag, thumb); } @Override @@ -150,19 +148,21 @@ public class GetLibraryItemsDirector { "tag", tag, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the director. */ @@ -172,6 +172,7 @@ public class GetLibraryItemsDirector { return this; } + /** * The role of Director */ @@ -181,6 +182,7 @@ public class GetLibraryItemsDirector { return this; } + /** * The absolute URL of the thumbnail image for the director. */ @@ -198,12 +200,12 @@ public class GetLibraryItemsDirector { this.thumb = thumb; return this; } - + public GetLibraryItemsDirector build() { + return new GetLibraryItemsDirector( - id, - tag, - thumb); + id, tag, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsField.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsField.java index b62fb838..9e48336c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsField.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsField.java @@ -11,20 +11,23 @@ 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; @@ -49,7 +52,8 @@ public class GetLibraryItemsField { String key, String title, String type) { - this(key, title, type, Optional.empty()); + this(key, title, type, + Optional.empty()); } @JsonIgnore @@ -72,9 +76,10 @@ public class GetLibraryItemsField { return subType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsField withKey(String key) { Utils.checkNotNull(key, "key"); @@ -100,13 +105,13 @@ public class GetLibraryItemsField { 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) { @@ -117,18 +122,16 @@ public class GetLibraryItemsField { } 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subType, other.subType); } @Override public int hashCode() { - return Objects.hash( - key, - title, - type, + return Utils.enhancedHash( + key, title, type, subType); } @@ -140,39 +143,44 @@ public class GetLibraryItemsField { "type", type, "subType", subType); } - + + @SuppressWarnings("UnusedReturnValue") 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); @@ -184,13 +192,13 @@ public class GetLibraryItemsField { this.subType = subType; return this; } - + public GetLibraryItemsField build() { + return new GetLibraryItemsField( - key, - title, - type, + 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 index 6194670b..cdaac4dd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFieldType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFieldType.java @@ -10,13 +10,14 @@ 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; @@ -40,9 +41,10 @@ public class GetLibraryItemsFieldType { return operator; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsFieldType withType(String type) { Utils.checkNotNull(type, "type"); @@ -56,7 +58,6 @@ public class GetLibraryItemsFieldType { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,15 +68,14 @@ public class GetLibraryItemsFieldType { } GetLibraryItemsFieldType other = (GetLibraryItemsFieldType) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.operator, other.operator); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.operator, other.operator); } @Override public int hashCode() { - return Objects.hash( - type, - operator); + return Utils.enhancedHash( + type, operator); } @Override @@ -84,33 +84,37 @@ public class GetLibraryItemsFieldType { "type", type, "operator", operator); } - + + @SuppressWarnings("UnusedReturnValue") 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); + 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 index 938d5860..9153391d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFilter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsFilter.java @@ -9,22 +9,26 @@ 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; @@ -72,9 +76,10 @@ public class GetLibraryItemsFilter { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsFilter withFilter(String filter) { Utils.checkNotNull(filter, "filter"); @@ -106,7 +111,6 @@ public class GetLibraryItemsFilter { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -117,21 +121,18 @@ public class GetLibraryItemsFilter { } 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); + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.filterType, other.filterType) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - filter, - filterType, - key, - title, - type); + return Utils.enhancedHash( + filter, filterType, key, + title, type); } @Override @@ -143,60 +144,65 @@ public class GetLibraryItemsFilter { "title", title, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") 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); + filter, filterType, key, + title, type); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGenre.java index 139a629d..bc4c7c9d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGenre.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetLibraryItemsGenre { - /** * The unique identifier for the genre. * NOTE: This is different for each Plex server and is not globally unique. @@ -54,9 +53,10 @@ public class GetLibraryItemsGenre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the genre. @@ -77,7 +77,6 @@ public class GetLibraryItemsGenre { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,15 +87,14 @@ public class GetLibraryItemsGenre { } GetLibraryItemsGenre other = (GetLibraryItemsGenre) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - tag); + return Utils.enhancedHash( + id, tag); } @Override @@ -105,17 +103,19 @@ public class GetLibraryItemsGenre { "id", id, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the genre. * NOTE: This is different for each Plex server and is not globally unique. @@ -126,6 +126,7 @@ public class GetLibraryItemsGenre { return this; } + /** * The genre name of this media-item */ @@ -134,11 +135,12 @@ public class GetLibraryItemsGenre { this.tag = tag; return this; } - + public GetLibraryItemsGenre build() { + return new GetLibraryItemsGenre( - id, - tag); + id, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGuids.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGuids.java index cca3c22f..b7bc7fa8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsGuids.java @@ -9,10 +9,9 @@ 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 GetLibraryItemsGuids { - /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -34,9 +33,10 @@ public class GetLibraryItemsGuids { return id; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// @@ -47,7 +47,6 @@ public class GetLibraryItemsGuids { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibraryItemsGuids { } GetLibraryItemsGuids other = (GetLibraryItemsGuids) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } @@ -72,15 +71,17 @@ public class GetLibraryItemsGuids { return Utils.toString(GetLibraryItemsGuids.class, "id", id); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String id; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -89,10 +90,12 @@ public class GetLibraryItemsGuids { this.id = id; return this; } - + public GetLibraryItemsGuids build() { + return new GetLibraryItemsGuids( id); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsHasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsHasThumbnail.java index 1bc92777..fa389c2e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsHasThumbnail.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsHasThumbnail.java @@ -20,7 +20,7 @@ public enum GetLibraryItemsHasThumbnail { @JsonValue private final String value; - private GetLibraryItemsHasThumbnail(String value) { + GetLibraryItemsHasThumbnail(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsImage.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsImage.java index f6b31848..20964ea2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsImage.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsImage.java @@ -9,16 +9,18 @@ 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 GetLibraryItemsImage { @JsonProperty("alt") private String alt; + @JsonProperty("type") private GetLibraryItemsLibraryResponseType type; + @JsonProperty("url") private String url; @@ -50,9 +52,10 @@ public class GetLibraryItemsImage { return url; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsImage withAlt(String alt) { Utils.checkNotNull(alt, "alt"); @@ -72,7 +75,6 @@ public class GetLibraryItemsImage { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -83,17 +85,15 @@ public class GetLibraryItemsImage { } GetLibraryItemsImage other = (GetLibraryItemsImage) o; return - Objects.deepEquals(this.alt, other.alt) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.alt, other.alt) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( - alt, - type, - url); + return Utils.enhancedHash( + alt, type, url); } @Override @@ -103,42 +103,46 @@ public class GetLibraryItemsImage { "type", type, "url", url); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String alt; - + private GetLibraryItemsLibraryResponseType type; - + private String url; - + private Builder() { // force use of static builder() method } + public Builder alt(String alt) { Utils.checkNotNull(alt, "alt"); this.alt = alt; return this; } + public Builder type(GetLibraryItemsLibraryResponseType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder url(String url) { Utils.checkNotNull(url, "url"); this.url = url; return this; } - + public GetLibraryItemsImage build() { + return new GetLibraryItemsImage( - alt, - type, - url); + alt, type, url); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryOptimizedForStreaming.java index 6b4373f5..9e940f6f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetLibraryItemsLibraryOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetLibraryItemsLibraryOptimizedForStreaming { return false; } GetLibraryItemsLibraryOptimizedForStreaming other = (GetLibraryItemsLibraryOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java index 67e59eb3..e9ddfc39 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLibraryType.java @@ -14,31 +14,37 @@ 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 GetLibraryItemsLibraryType { @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; @@ -73,7 +79,9 @@ public class GetLibraryItemsLibraryType { String type, String title, boolean active) { - this(key, type, title, active, Optional.empty(), Optional.empty(), Optional.empty()); + this(key, type, title, + active, Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -114,9 +122,10 @@ public class GetLibraryItemsLibraryType { return (Optional>) field; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsLibraryType withKey(String key) { Utils.checkNotNull(key, "key"); @@ -148,6 +157,7 @@ public class GetLibraryItemsLibraryType { return this; } + public GetLibraryItemsLibraryType withFilter(Optional> filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -160,6 +170,7 @@ public class GetLibraryItemsLibraryType { return this; } + public GetLibraryItemsLibraryType withSort(Optional> sort) { Utils.checkNotNull(sort, "sort"); this.sort = sort; @@ -172,13 +183,13 @@ public class GetLibraryItemsLibraryType { return this; } + public GetLibraryItemsLibraryType withField(Optional> field) { Utils.checkNotNull(field, "field"); this.field = field; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -189,24 +200,20 @@ public class GetLibraryItemsLibraryType { } GetLibraryItemsLibraryType other = (GetLibraryItemsLibraryType) 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.field, other.field); } @Override public int hashCode() { - return Objects.hash( - key, - type, - title, - active, - filter, - sort, + return Utils.enhancedHash( + key, type, title, + active, filter, sort, field); } @@ -221,51 +228,57 @@ public class GetLibraryItemsLibraryType { "sort", sort, "field", field); } - + + @SuppressWarnings("UnusedReturnValue") 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); @@ -278,6 +291,7 @@ public class GetLibraryItemsLibraryType { return this; } + public Builder sort(List sort) { Utils.checkNotNull(sort, "sort"); this.sort = Optional.ofNullable(sort); @@ -290,6 +304,7 @@ public class GetLibraryItemsLibraryType { return this; } + public Builder field(List field) { Utils.checkNotNull(field, "field"); this.field = Optional.ofNullable(field); @@ -301,16 +316,14 @@ public class GetLibraryItemsLibraryType { this.field = field; return this; } - + public GetLibraryItemsLibraryType build() { + return new GetLibraryItemsLibraryType( - key, - type, - title, - active, - filter, - sort, + key, type, title, + active, filter, sort, field); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLocation.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLocation.java index a6d7794b..2e1d33ff 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLocation.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsLocation.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetLibraryItemsLocation @@ -33,9 +32,10 @@ public class GetLibraryItemsLocation { return path; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsLocation withPath(String path) { Utils.checkNotNull(path, "path"); @@ -43,7 +43,6 @@ public class GetLibraryItemsLocation { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -54,12 +53,12 @@ public class GetLibraryItemsLocation { } GetLibraryItemsLocation other = (GetLibraryItemsLocation) o; return - Objects.deepEquals(this.path, other.path); + Utils.enhancedDeepEquals(this.path, other.path); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( path); } @@ -68,24 +67,28 @@ public class GetLibraryItemsLocation { return Utils.toString(GetLibraryItemsLocation.class, "path", path); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String path; - + private Builder() { // force use of static builder() method } + public Builder path(String path) { Utils.checkNotNull(path, "path"); this.path = path; return this; } - + public GetLibraryItemsLocation build() { + return new GetLibraryItemsLocation( path); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java index 224b999f..298aa3e0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMedia.java @@ -17,11 +17,10 @@ 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 GetLibraryItemsMedia { +public class GetLibraryItemsMedia { /** * Unique media identifier. */ @@ -70,6 +69,7 @@ public class GetLibraryItemsMedia { @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("displayOffset") private Optional displayOffset; @@ -145,6 +145,7 @@ public class GetLibraryItemsMedia { @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Part") private Optional> part; @@ -212,7 +213,13 @@ public class GetLibraryItemsMedia { public GetLibraryItemsMedia( long id) { - this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -364,9 +371,10 @@ public class GetLibraryItemsMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique media identifier. @@ -386,6 +394,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Duration of the media in milliseconds. */ @@ -404,6 +413,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Bitrate in bits per second. */ @@ -422,6 +432,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video width in pixels. */ @@ -440,6 +451,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video height in pixels. */ @@ -458,6 +470,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Aspect ratio of the video. */ @@ -476,6 +489,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Number of audio channels. */ @@ -491,6 +505,7 @@ public class GetLibraryItemsMedia { return this; } + public GetLibraryItemsMedia withDisplayOffset(Optional displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = displayOffset; @@ -506,6 +521,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Audio codec used. */ @@ -524,6 +540,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video codec used. */ @@ -542,6 +559,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video resolution (e.g., 4k). */ @@ -560,6 +578,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Container format of the media. */ @@ -578,6 +597,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -596,6 +616,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video profile (e.g., main 10). */ @@ -614,6 +635,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Indicates whether voice activity is detected. */ @@ -632,6 +654,7 @@ public class GetLibraryItemsMedia { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -650,6 +673,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -669,6 +693,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Indicates whether the media has 64-bit offsets. * This is relevant for media files that may require larger offsets than what 32-bit integers can provide. @@ -685,13 +710,13 @@ public class GetLibraryItemsMedia { return this; } + public GetLibraryItemsMedia withPart(Optional> part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -702,48 +727,36 @@ public class GetLibraryItemsMedia { } GetLibraryItemsMedia other = (GetLibraryItemsMedia) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.displayOffset, other.displayOffset) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.displayOffset, other.displayOffset) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } @@ -770,51 +783,53 @@ public class GetLibraryItemsMedia { "has64bitOffsets", has64bitOffsets, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional displayOffset = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional hasVoiceActivity = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique media identifier. */ @@ -824,6 +839,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Duration of the media in milliseconds. */ @@ -842,6 +858,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Bitrate in bits per second. */ @@ -860,6 +877,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video width in pixels. */ @@ -878,6 +896,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video height in pixels. */ @@ -896,6 +915,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Aspect ratio of the video. */ @@ -914,6 +934,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Number of audio channels. */ @@ -932,6 +953,7 @@ public class GetLibraryItemsMedia { return this; } + public Builder displayOffset(int displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = Optional.ofNullable(displayOffset); @@ -944,6 +966,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Audio codec used. */ @@ -962,6 +985,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video codec used. */ @@ -980,6 +1004,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video resolution (e.g., 4k). */ @@ -998,6 +1023,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Container format of the media. */ @@ -1016,6 +1042,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -1034,6 +1061,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Video profile (e.g., main 10). */ @@ -1052,6 +1080,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Indicates whether voice activity is detected. */ @@ -1070,6 +1099,7 @@ public class GetLibraryItemsMedia { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -1088,6 +1118,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -1106,6 +1137,7 @@ public class GetLibraryItemsMedia { return this; } + /** * Indicates whether the media has 64-bit offsets. * This is relevant for media files that may require larger offsets than what 32-bit integers can provide. @@ -1126,6 +1158,7 @@ public class GetLibraryItemsMedia { return this; } + public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = Optional.ofNullable(part); @@ -1137,28 +1170,18 @@ public class GetLibraryItemsMedia { this.part = part; return this; } - + public GetLibraryItemsMedia build() { + return new GetLibraryItemsMedia( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } + } } 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 1bb84d77..12f69ccc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMediaContainer.java @@ -16,11 +16,10 @@ 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 GetLibraryItemsMediaContainer { +public class GetLibraryItemsMediaContainer { /** * Number of media items returned in this response. */ @@ -236,7 +235,13 @@ public class GetLibraryItemsMediaContainer { String title2, String viewGroup, List metadata) { - this(size, totalSize, offset, content, allowSync, nocache, art, identifier, Optional.empty(), Optional.empty(), Optional.empty(), mediaTagPrefix, mediaTagVersion, thumb, title1, title2, viewGroup, Optional.empty(), Optional.empty(), metadata, Optional.empty()); + this(size, totalSize, offset, + content, allowSync, nocache, + art, identifier, Optional.empty(), + Optional.empty(), Optional.empty(), mediaTagPrefix, + mediaTagVersion, thumb, title1, + title2, viewGroup, Optional.empty(), + Optional.empty(), metadata, Optional.empty()); } /** @@ -408,9 +413,10 @@ public class GetLibraryItemsMediaContainer { return (Optional) meta; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -493,6 +499,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The unique identifier for the library section. */ @@ -511,6 +518,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The title of the library section. */ @@ -529,6 +537,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The universally unique identifier for the library section. */ @@ -601,6 +610,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Identifier for the view mode. */ @@ -619,6 +629,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Indicates if the media container has mixed parents. */ @@ -646,6 +657,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. */ @@ -655,7 +667,6 @@ public class GetLibraryItemsMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -666,53 +677,39 @@ public class GetLibraryItemsMediaContainer { } GetLibraryItemsMediaContainer other = (GetLibraryItemsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.totalSize, other.totalSize) && - Objects.deepEquals(this.offset, other.offset) && - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.nocache, other.nocache) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title1, other.title1) && - Objects.deepEquals(this.title2, other.title2) && - 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.meta, other.meta); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.totalSize, other.totalSize) && + Utils.enhancedDeepEquals(this.offset, other.offset) && + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.nocache, other.nocache) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionUUID, other.librarySectionUUID) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title1, other.title1) && + Utils.enhancedDeepEquals(this.title2, other.title2) && + Utils.enhancedDeepEquals(this.viewGroup, other.viewGroup) && + Utils.enhancedDeepEquals(this.viewMode, other.viewMode) && + Utils.enhancedDeepEquals(this.mixedParents, other.mixedParents) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.meta, other.meta); } @Override public int hashCode() { - return Objects.hash( - size, - totalSize, - offset, - content, - allowSync, - nocache, - art, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - thumb, - title1, - title2, - viewGroup, - viewMode, - mixedParents, - metadata, - meta); + return Utils.enhancedHash( + size, totalSize, offset, + content, allowSync, nocache, + art, identifier, librarySectionID, + librarySectionTitle, librarySectionUUID, mediaTagPrefix, + mediaTagVersion, thumb, title1, + title2, viewGroup, viewMode, + mixedParents, metadata, meta); } @Override @@ -740,55 +737,57 @@ public class GetLibraryItemsMediaContainer { "metadata", metadata, "meta", meta); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Integer totalSize; - + private Long offset; - + private String content; - + private Boolean allowSync; - + private Boolean nocache; - + private String art; - + private String identifier; - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionUUID = Optional.empty(); - + private String mediaTagPrefix; - + private Long mediaTagVersion; - + private String thumb; - + private String title1; - + private String title2; - + private String viewGroup; - + private Optional viewMode = Optional.empty(); - + private Optional mixedParents = Optional.empty(); - + private List metadata; - + private Optional meta = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -798,6 +797,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Total number of media items in the library. */ @@ -807,6 +807,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Offset value for pagination. */ @@ -816,6 +817,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The content type or mode. */ @@ -825,6 +827,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Indicates whether syncing is allowed. */ @@ -834,6 +837,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Specifies whether caching is disabled. */ @@ -843,6 +847,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * URL for the background artwork of the media container. */ @@ -852,6 +857,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -861,6 +867,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The unique identifier for the library section. */ @@ -879,6 +886,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The title of the library section. */ @@ -897,6 +905,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The universally unique identifier for the library section. */ @@ -915,6 +924,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The prefix used for media tag resource paths. */ @@ -924,6 +934,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The version number for media tags. */ @@ -933,6 +944,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * URL for the thumbnail image of the media container. */ @@ -942,6 +954,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The primary title of the media container. */ @@ -951,6 +964,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The secondary title of the media container. */ @@ -960,6 +974,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Identifier for the view group layout. */ @@ -969,6 +984,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Identifier for the view mode. */ @@ -987,6 +1003,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * Indicates if the media container has mixed parents. */ @@ -1005,6 +1022,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * An array of metadata items. */ @@ -1014,6 +1032,7 @@ public class GetLibraryItemsMediaContainer { return this; } + /** * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. */ @@ -1031,30 +1050,18 @@ public class GetLibraryItemsMediaContainer { this.meta = meta; return this; } - + public GetLibraryItemsMediaContainer build() { + return new GetLibraryItemsMediaContainer( - size, - totalSize, - offset, - content, - allowSync, - nocache, - art, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - thumb, - title1, - title2, - viewGroup, - viewMode, - mixedParents, - metadata, - meta); + size, totalSize, offset, + content, allowSync, nocache, + art, identifier, librarySectionID, + librarySectionTitle, librarySectionUUID, mediaTagPrefix, + mediaTagVersion, thumb, title1, + title2, viewGroup, viewMode, + mixedParents, metadata, meta); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMeta.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMeta.java index 473e70cc..fa07966f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMeta.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -27,6 +26,7 @@ public class GetLibraryItemsMeta { @JsonProperty("Type") private Optional> type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("FieldType") private Optional> fieldType; @@ -57,9 +57,10 @@ public class GetLibraryItemsMeta { return (Optional>) fieldType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsMeta withType(List type) { Utils.checkNotNull(type, "type"); @@ -67,6 +68,7 @@ public class GetLibraryItemsMeta { return this; } + public GetLibraryItemsMeta withType(Optional> type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -79,13 +81,13 @@ public class GetLibraryItemsMeta { return this; } + public GetLibraryItemsMeta withFieldType(Optional> fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = fieldType; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -96,15 +98,14 @@ public class GetLibraryItemsMeta { } GetLibraryItemsMeta other = (GetLibraryItemsMeta) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.fieldType, other.fieldType); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.fieldType, other.fieldType); } @Override public int hashCode() { - return Objects.hash( - type, - fieldType); + return Utils.enhancedHash( + type, fieldType); } @Override @@ -113,17 +114,19 @@ public class GetLibraryItemsMeta { "type", type, "fieldType", fieldType); } - + + @SuppressWarnings("UnusedReturnValue") 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); @@ -136,6 +139,7 @@ public class GetLibraryItemsMeta { return this; } + public Builder fieldType(List fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = Optional.ofNullable(fieldType); @@ -147,11 +151,12 @@ public class GetLibraryItemsMeta { this.fieldType = fieldType; return this; } - + public GetLibraryItemsMeta build() { + return new GetLibraryItemsMeta( - type, - fieldType); + type, fieldType); } + } } 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 1f85f48a..1f7de875 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsMetadata.java @@ -19,7 +19,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -28,7 +27,6 @@ import java.util.Optional; *

Unknown */ public class GetLibraryItemsMetadata { - /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -60,6 +58,7 @@ public class GetLibraryItemsMetadata { @JsonProperty("studio") private Optional studio; + @JsonProperty("type") private GetLibraryItemsType type; @@ -182,6 +181,7 @@ public class GetLibraryItemsMetadata { @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonProperty("addedAt") private long addedAt; @@ -388,14 +388,17 @@ public class GetLibraryItemsMetadata { @JsonProperty("userRating") private Optional userRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Image") private Optional> image; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("UltraBlurColors") private Optional ultraBlurColors; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Guid") private Optional> guids; @@ -448,58 +451,72 @@ public class GetLibraryItemsMetadata { @JsonProperty("skipChildren") private Optional skipChildren; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Producer") private Optional> producer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Collection") private Optional> collection; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Rating") private Optional> ratings; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Similar") private Optional> similar; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Location") private Optional> location; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Chapter") private Optional> chapter; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Marker") private Optional> marker; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Extras") private Optional extras; @@ -763,7 +780,32 @@ public class GetLibraryItemsMetadata { int seasonCount, int duration, long addedAt) { - this(ratingKey, key, guid, slug, Optional.empty(), type, title, banner, titleSort, Optional.empty(), summary, rating, audienceRating, Optional.empty(), tagline, thumb, art, theme, index, Optional.empty(), Optional.empty(), childCount, seasonCount, duration, Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(ratingKey, key, guid, + slug, Optional.empty(), type, + title, banner, titleSort, + Optional.empty(), summary, rating, + audienceRating, Optional.empty(), tagline, + thumb, art, theme, + index, Optional.empty(), Optional.empty(), + childCount, seasonCount, duration, + Optional.empty(), addedAt, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -1358,9 +1400,10 @@ public class GetLibraryItemsMetadata { return (Optional) extras; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. @@ -1407,6 +1450,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The studio that produced the media item. */ @@ -1458,6 +1502,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The content rating for the media item. */ @@ -1503,6 +1548,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The release year of the media item. */ @@ -1566,6 +1612,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -1584,6 +1631,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -1629,6 +1677,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The original release date of the media item. */ @@ -1653,6 +1702,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Unix epoch datetime in seconds */ @@ -1671,6 +1721,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -1689,6 +1740,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -1707,6 +1759,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -1725,6 +1778,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -1743,6 +1797,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -1761,6 +1816,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -1779,6 +1835,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -1797,6 +1854,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -1815,6 +1873,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -1833,6 +1892,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -1851,6 +1911,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The key of the parent media item. */ @@ -1869,6 +1930,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -1887,6 +1949,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -1905,6 +1968,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -1923,6 +1987,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -1941,6 +2006,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The title of the parent media item. */ @@ -1959,6 +2025,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The index position of the parent media item. */ @@ -1977,6 +2044,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -1995,6 +2063,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The URL for the rating image. */ @@ -2013,6 +2082,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -2031,6 +2101,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -2049,6 +2120,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -2067,6 +2139,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -2085,6 +2158,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -2103,6 +2177,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -2121,6 +2196,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -2139,6 +2215,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -2157,6 +2234,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -2172,6 +2250,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withImage(Optional> image) { Utils.checkNotNull(image, "image"); this.image = image; @@ -2184,6 +2263,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withUltraBlurColors(Optional ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = ultraBlurColors; @@ -2196,6 +2276,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withGuids(Optional> guids) { Utils.checkNotNull(guids, "guids"); this.guids = guids; @@ -2211,6 +2292,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The identifier for the library section. */ @@ -2229,6 +2311,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The title of the library section. */ @@ -2247,6 +2330,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The key corresponding to the library section. */ @@ -2271,6 +2355,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Setting that indicates the episode ordering for the show. * Options: @@ -2295,6 +2380,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). */ @@ -2313,6 +2399,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Indicates whether child items should be skipped. */ @@ -2328,6 +2415,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -2340,6 +2428,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -2352,6 +2441,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -2364,6 +2454,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -2376,6 +2467,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -2388,6 +2480,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withProducer(Optional> producer) { Utils.checkNotNull(producer, "producer"); this.producer = producer; @@ -2400,6 +2493,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withCollection(Optional> collection) { Utils.checkNotNull(collection, "collection"); this.collection = collection; @@ -2412,6 +2506,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; @@ -2424,6 +2519,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withRatings(Optional> ratings) { Utils.checkNotNull(ratings, "ratings"); this.ratings = ratings; @@ -2436,6 +2532,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withSimilar(Optional> similar) { Utils.checkNotNull(similar, "similar"); this.similar = similar; @@ -2448,6 +2545,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withLocation(Optional> location) { Utils.checkNotNull(location, "location"); this.location = location; @@ -2460,6 +2558,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withChapter(Optional> chapter) { Utils.checkNotNull(chapter, "chapter"); this.chapter = chapter; @@ -2472,6 +2571,7 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withMarker(Optional> marker) { Utils.checkNotNull(marker, "marker"); this.marker = marker; @@ -2484,13 +2584,13 @@ public class GetLibraryItemsMetadata { return this; } + public GetLibraryItemsMetadata withExtras(Optional extras) { Utils.checkNotNull(extras, "extras"); this.extras = extras; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -2501,167 +2601,115 @@ public class GetLibraryItemsMetadata { } GetLibraryItemsMetadata other = (GetLibraryItemsMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.slug, other.slug) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.banner, other.banner) && - Objects.deepEquals(this.titleSort, other.titleSort) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.theme, other.theme) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.seasonCount, other.seasonCount) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.chapterSource, other.chapterSource) && - Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && - Objects.deepEquals(this.originalTitle, other.originalTitle) && - Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && - Objects.deepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && - Objects.deepEquals(this.parentGuid, other.parentGuid) && - Objects.deepEquals(this.grandparentGuid, other.grandparentGuid) && - Objects.deepEquals(this.grandparentSlug, other.grandparentSlug) && - Objects.deepEquals(this.grandparentKey, other.grandparentKey) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && - Objects.deepEquals(this.grandparentThumb, other.grandparentThumb) && - Objects.deepEquals(this.grandparentTheme, other.grandparentTheme) && - Objects.deepEquals(this.grandparentArt, other.grandparentArt) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.viewOffset, other.viewOffset) && - Objects.deepEquals(this.skipCount, other.skipCount) && - Objects.deepEquals(this.subtype, other.subtype) && - Objects.deepEquals(this.lastRatedAt, other.lastRatedAt) && - Objects.deepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && - Objects.deepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.userRating, other.userRating) && - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) && - Objects.deepEquals(this.guids, other.guids) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.showOrdering, other.showOrdering) && - Objects.deepEquals(this.flattenSeasons, other.flattenSeasons) && - Objects.deepEquals(this.skipChildren, other.skipChildren) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.producer, other.producer) && - Objects.deepEquals(this.collection, other.collection) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.ratings, other.ratings) && - Objects.deepEquals(this.similar, other.similar) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.chapter, other.chapter) && - Objects.deepEquals(this.marker, other.marker) && - Objects.deepEquals(this.extras, other.extras); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.slug, other.slug) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.banner, other.banner) && + Utils.enhancedDeepEquals(this.titleSort, other.titleSort) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.theme, other.theme) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.seasonCount, other.seasonCount) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.chapterSource, other.chapterSource) && + Utils.enhancedDeepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Utils.enhancedDeepEquals(this.originalTitle, other.originalTitle) && + Utils.enhancedDeepEquals(this.parentRatingKey, other.parentRatingKey) && + Utils.enhancedDeepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && + Utils.enhancedDeepEquals(this.parentGuid, other.parentGuid) && + Utils.enhancedDeepEquals(this.grandparentGuid, other.grandparentGuid) && + Utils.enhancedDeepEquals(this.grandparentSlug, other.grandparentSlug) && + Utils.enhancedDeepEquals(this.grandparentKey, other.grandparentKey) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.grandparentTitle, other.grandparentTitle) && + Utils.enhancedDeepEquals(this.grandparentThumb, other.grandparentThumb) && + Utils.enhancedDeepEquals(this.grandparentTheme, other.grandparentTheme) && + Utils.enhancedDeepEquals(this.grandparentArt, other.grandparentArt) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.viewOffset, other.viewOffset) && + Utils.enhancedDeepEquals(this.skipCount, other.skipCount) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.lastRatedAt, other.lastRatedAt) && + Utils.enhancedDeepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && + Utils.enhancedDeepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.userRating, other.userRating) && + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.ultraBlurColors, other.ultraBlurColors) && + Utils.enhancedDeepEquals(this.guids, other.guids) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.showOrdering, other.showOrdering) && + Utils.enhancedDeepEquals(this.flattenSeasons, other.flattenSeasons) && + Utils.enhancedDeepEquals(this.skipChildren, other.skipChildren) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.producer, other.producer) && + Utils.enhancedDeepEquals(this.collection, other.collection) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.ratings, other.ratings) && + Utils.enhancedDeepEquals(this.similar, other.similar) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.chapter, other.chapter) && + Utils.enhancedDeepEquals(this.marker, other.marker) && + Utils.enhancedDeepEquals(this.extras, other.extras); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - banner, - titleSort, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - theme, - index, - leafCount, - viewedLeafCount, - childCount, - seasonCount, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - originalTitle, - parentRatingKey, - grandparentRatingKey, - parentGuid, - grandparentGuid, - grandparentSlug, - grandparentKey, - parentKey, - grandparentTitle, - grandparentThumb, - grandparentTheme, - grandparentArt, - parentTitle, - parentIndex, - parentThumb, - ratingImage, - viewCount, - viewOffset, - skipCount, - subtype, - lastRatedAt, - createdAtAccuracy, - createdAtTZOffset, - lastViewedAt, - userRating, - image, - ultraBlurColors, - guids, - librarySectionID, - librarySectionTitle, - librarySectionKey, - showOrdering, - flattenSeasons, - skipChildren, - media, - genre, - country, - director, - writer, - producer, - collection, - role, - ratings, - similar, - location, - chapter, - marker, - extras); + return Utils.enhancedHash( + ratingKey, key, guid, + slug, studio, type, + title, banner, titleSort, + contentRating, summary, rating, + audienceRating, year, tagline, + thumb, art, theme, + index, leafCount, viewedLeafCount, + childCount, seasonCount, duration, + originallyAvailableAt, addedAt, updatedAt, + audienceRatingImage, chapterSource, primaryExtraKey, + originalTitle, parentRatingKey, grandparentRatingKey, + parentGuid, grandparentGuid, grandparentSlug, + grandparentKey, parentKey, grandparentTitle, + grandparentThumb, grandparentTheme, grandparentArt, + parentTitle, parentIndex, parentThumb, + ratingImage, viewCount, viewOffset, + skipCount, subtype, lastRatedAt, + createdAtAccuracy, createdAtTZOffset, lastViewedAt, + userRating, image, ultraBlurColors, + guids, librarySectionID, librarySectionTitle, + librarySectionKey, showOrdering, flattenSeasons, + skipChildren, media, genre, + country, director, writer, + producer, collection, role, + ratings, similar, location, + chapter, marker, extras); } @Override @@ -2746,169 +2794,171 @@ public class GetLibraryItemsMetadata { "marker", marker, "extras", extras); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String ratingKey; - + private String key; - + private String guid; - + private String slug; - + private Optional studio = Optional.empty(); - + private GetLibraryItemsType type; - + private String title; - + private String banner; - + private String titleSort; - + private Optional contentRating = Optional.empty(); - + private String summary; - + private Float rating; - + private Double audienceRating; - + private Optional year = Optional.empty(); - + private String tagline; - + private String thumb; - + private String art; - + private String theme; - + private Integer index; - + private Optional leafCount = Optional.empty(); - + private Optional viewedLeafCount = Optional.empty(); - + private Integer childCount; - + private Integer seasonCount; - + private Integer duration; - + private Optional originallyAvailableAt = Optional.empty(); - + private Long addedAt; - + private Optional updatedAt = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional chapterSource = Optional.empty(); - + private Optional primaryExtraKey = Optional.empty(); - + private Optional originalTitle = Optional.empty(); - + private Optional parentRatingKey = Optional.empty(); - + private Optional grandparentRatingKey = Optional.empty(); - + private Optional parentGuid = Optional.empty(); - + private Optional grandparentGuid = Optional.empty(); - + private Optional grandparentSlug = Optional.empty(); - + private Optional grandparentKey = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional grandparentTitle = Optional.empty(); - + private Optional grandparentThumb = Optional.empty(); - + private Optional grandparentTheme = Optional.empty(); - + private Optional grandparentArt = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional parentThumb = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional viewOffset = Optional.empty(); - + private Optional skipCount = Optional.empty(); - + private Optional subtype = Optional.empty(); - + private Optional lastRatedAt = Optional.empty(); - + private Optional createdAtAccuracy = Optional.empty(); - + private Optional createdAtTZOffset = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional userRating = Optional.empty(); - + private Optional> image = Optional.empty(); - + private Optional ultraBlurColors = Optional.empty(); - + private Optional> guids = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionKey = Optional.empty(); - + private Optional showOrdering = Optional.empty(); - + private Optional flattenSeasons = Optional.empty(); - + private Optional skipChildren = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional> producer = Optional.empty(); - + private Optional> collection = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Optional> ratings = Optional.empty(); - + private Optional> similar = Optional.empty(); - + private Optional> location = Optional.empty(); - + private Optional> chapter = Optional.empty(); - + private Optional> marker = Optional.empty(); - + private Optional extras = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -2918,6 +2968,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The unique key for the media item. */ @@ -2927,6 +2978,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The globally unique identifier for the media item. */ @@ -2936,6 +2988,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * A URL‐friendly version of the media title. */ @@ -2945,6 +2998,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The studio that produced the media item. */ @@ -2963,12 +3017,14 @@ public class GetLibraryItemsMetadata { return this; } + public Builder type(GetLibraryItemsType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + /** * The title of the media item. */ @@ -2978,6 +3034,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The banner image URL for the media item. */ @@ -2987,6 +3044,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The sort title used for ordering media items. */ @@ -2996,6 +3054,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The content rating for the media item. */ @@ -3014,6 +3073,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * A synopsis of the media item. */ @@ -3023,6 +3083,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The critic rating for the media item. */ @@ -3032,6 +3093,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The audience rating for the media item. */ @@ -3041,6 +3103,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The release year of the media item. */ @@ -3059,6 +3122,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * A brief tagline for the media item. */ @@ -3068,6 +3132,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The thumbnail image URL for the media item. */ @@ -3077,6 +3142,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The art image URL for the media item. */ @@ -3086,6 +3152,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The theme URL for the media item. */ @@ -3095,6 +3162,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The index position of the media item. */ @@ -3104,6 +3172,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -3122,6 +3191,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -3140,6 +3210,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of child items associated with this media item. */ @@ -3149,6 +3220,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The total number of seasons (for TV shows). */ @@ -3158,6 +3230,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The duration of the media item in milliseconds. */ @@ -3167,6 +3240,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The original release date of the media item. */ @@ -3185,12 +3259,14 @@ public class GetLibraryItemsMetadata { return this; } + public Builder addedAt(long addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; return this; } + /** * Unix epoch datetime in seconds */ @@ -3209,6 +3285,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -3227,6 +3304,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -3245,6 +3323,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -3263,6 +3342,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -3281,6 +3361,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -3299,6 +3380,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -3317,6 +3399,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -3335,6 +3418,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -3353,6 +3437,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -3371,6 +3456,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -3389,6 +3475,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The key of the parent media item. */ @@ -3407,6 +3494,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -3425,6 +3513,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -3443,6 +3532,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -3461,6 +3551,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -3479,6 +3570,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The title of the parent media item. */ @@ -3497,6 +3589,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The index position of the parent media item. */ @@ -3515,6 +3608,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -3533,6 +3627,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The URL for the rating image. */ @@ -3551,6 +3646,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -3569,6 +3665,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -3587,6 +3684,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -3605,6 +3703,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -3623,6 +3722,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -3641,6 +3741,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -3659,6 +3760,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -3677,6 +3779,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -3695,6 +3798,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -3713,6 +3817,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder image(List image) { Utils.checkNotNull(image, "image"); this.image = Optional.ofNullable(image); @@ -3725,6 +3830,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder ultraBlurColors(GetLibraryItemsUltraBlurColors ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = Optional.ofNullable(ultraBlurColors); @@ -3737,6 +3843,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder guids(List guids) { Utils.checkNotNull(guids, "guids"); this.guids = Optional.ofNullable(guids); @@ -3749,6 +3856,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The identifier for the library section. */ @@ -3767,6 +3875,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The title of the library section. */ @@ -3785,6 +3894,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * The key corresponding to the library section. */ @@ -3803,6 +3913,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Setting that indicates the episode ordering for the show. * Options: @@ -3833,6 +3944,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). */ @@ -3851,6 +3963,7 @@ public class GetLibraryItemsMetadata { return this; } + /** * Indicates whether child items should be skipped. */ @@ -3869,6 +3982,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -3881,6 +3995,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -3893,6 +4008,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -3905,6 +4021,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -3917,6 +4034,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -3929,6 +4047,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder producer(List producer) { Utils.checkNotNull(producer, "producer"); this.producer = Optional.ofNullable(producer); @@ -3941,6 +4060,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder collection(List collection) { Utils.checkNotNull(collection, "collection"); this.collection = Optional.ofNullable(collection); @@ -3953,6 +4073,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -3965,6 +4086,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder ratings(List ratings) { Utils.checkNotNull(ratings, "ratings"); this.ratings = Optional.ofNullable(ratings); @@ -3977,6 +4099,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder similar(List similar) { Utils.checkNotNull(similar, "similar"); this.similar = Optional.ofNullable(similar); @@ -3989,6 +4112,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder location(List location) { Utils.checkNotNull(location, "location"); this.location = Optional.ofNullable(location); @@ -4001,6 +4125,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder chapter(List chapter) { Utils.checkNotNull(chapter, "chapter"); this.chapter = Optional.ofNullable(chapter); @@ -4013,6 +4138,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder marker(List marker) { Utils.checkNotNull(marker, "marker"); this.marker = Optional.ofNullable(marker); @@ -4025,6 +4151,7 @@ public class GetLibraryItemsMetadata { return this; } + public Builder extras(Extras extras) { Utils.checkNotNull(extras, "extras"); this.extras = Optional.ofNullable(extras); @@ -4036,87 +4163,37 @@ public class GetLibraryItemsMetadata { this.extras = extras; return this; } - + public GetLibraryItemsMetadata build() { + return new GetLibraryItemsMetadata( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - banner, - titleSort, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - theme, - index, - leafCount, - viewedLeafCount, - childCount, - seasonCount, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - originalTitle, - parentRatingKey, - grandparentRatingKey, - parentGuid, - grandparentGuid, - grandparentSlug, - grandparentKey, - parentKey, - grandparentTitle, - grandparentThumb, - grandparentTheme, - grandparentArt, - parentTitle, - parentIndex, - parentThumb, - ratingImage, - viewCount, - viewOffset, - skipCount, - subtype, - lastRatedAt, - createdAtAccuracy, - createdAtTZOffset, - lastViewedAt, - userRating, - image, - ultraBlurColors, - guids, - librarySectionID, - librarySectionTitle, - librarySectionKey, - showOrdering, - flattenSeasons, - skipChildren, - media, - genre, - country, - director, - writer, - producer, - collection, - role, - ratings, - similar, - location, - chapter, - marker, - extras); + ratingKey, key, guid, + slug, studio, type, + title, banner, titleSort, + contentRating, summary, rating, + audienceRating, year, tagline, + thumb, art, theme, + index, leafCount, viewedLeafCount, + childCount, seasonCount, duration, + originallyAvailableAt, addedAt, updatedAt, + audienceRatingImage, chapterSource, primaryExtraKey, + originalTitle, parentRatingKey, grandparentRatingKey, + parentGuid, grandparentGuid, grandparentSlug, + grandparentKey, parentKey, grandparentTitle, + grandparentThumb, grandparentTheme, grandparentArt, + parentTitle, parentIndex, parentThumb, + ratingImage, viewCount, viewOffset, + skipCount, subtype, lastRatedAt, + createdAtAccuracy, createdAtTZOffset, lastViewedAt, + userRating, image, ultraBlurColors, + guids, librarySectionID, librarySectionTitle, + librarySectionKey, showOrdering, flattenSeasons, + skipChildren, media, genre, + country, director, writer, + producer, collection, role, + ratings, similar, location, + chapter, marker, extras); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOperator.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOperator.java index b01d058c..170da5a2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOperator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOperator.java @@ -9,13 +9,14 @@ 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; @@ -39,9 +40,10 @@ public class GetLibraryItemsOperator { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsOperator withKey(String key) { Utils.checkNotNull(key, "key"); @@ -55,7 +57,6 @@ public class GetLibraryItemsOperator { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,15 +67,14 @@ public class GetLibraryItemsOperator { } GetLibraryItemsOperator other = (GetLibraryItemsOperator) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - key, - title); + return Utils.enhancedHash( + key, title); } @Override @@ -83,33 +83,37 @@ public class GetLibraryItemsOperator { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") 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); + key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming.java index 3bedc304..aaf12bb5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetLibraryItemsOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetLibraryItemsOptimizedForStreaming { return false; } GetLibraryItemsOptimizedForStreaming other = (GetLibraryItemsOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming1.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming1.java index e122fe9c..7a0c278d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsOptimizedForStreaming1.java @@ -14,7 +14,7 @@ public enum GetLibraryItemsOptimizedForStreaming1 { @JsonValue private final int value; - private GetLibraryItemsOptimizedForStreaming1(int value) { + GetLibraryItemsOptimizedForStreaming1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java index c29ba79e..3f935457 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsPart.java @@ -17,11 +17,10 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetLibraryItemsPart { +public class GetLibraryItemsPart { /** * Indicates if the part is accessible. */ @@ -49,6 +48,7 @@ public class GetLibraryItemsPart { @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("indexes") private Optional indexes; @@ -74,6 +74,7 @@ public class GetLibraryItemsPart { @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("packetLength") private Optional packetLength; @@ -99,6 +100,7 @@ public class GetLibraryItemsPart { @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; @@ -110,6 +112,7 @@ public class GetLibraryItemsPart { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasThumbnail") private Optional hasThumbnail; @@ -165,7 +168,11 @@ public class GetLibraryItemsPart { public GetLibraryItemsPart( long id) { - this(Optional.empty(), Optional.empty(), id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), id, + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -278,9 +285,10 @@ public class GetLibraryItemsPart { return (Optional) hasThumbnail; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Indicates if the part is accessible. @@ -291,6 +299,7 @@ public class GetLibraryItemsPart { return this; } + /** * Indicates if the part is accessible. */ @@ -309,6 +318,7 @@ public class GetLibraryItemsPart { return this; } + /** * Indicates if the part exists. */ @@ -336,6 +346,7 @@ public class GetLibraryItemsPart { return this; } + /** * Key to access this part. */ @@ -351,6 +362,7 @@ public class GetLibraryItemsPart { return this; } + public GetLibraryItemsPart withIndexes(Optional indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = indexes; @@ -366,6 +378,7 @@ public class GetLibraryItemsPart { return this; } + /** * Duration of the part in milliseconds. */ @@ -384,6 +397,7 @@ public class GetLibraryItemsPart { return this; } + /** * File path for the part. */ @@ -402,6 +416,7 @@ public class GetLibraryItemsPart { return this; } + /** * File size in bytes. */ @@ -417,6 +432,7 @@ public class GetLibraryItemsPart { return this; } + public GetLibraryItemsPart withPacketLength(Optional packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = packetLength; @@ -432,6 +448,7 @@ public class GetLibraryItemsPart { return this; } + /** * Container format of the part. */ @@ -450,6 +467,7 @@ public class GetLibraryItemsPart { return this; } + /** * Video profile for the part. */ @@ -468,6 +486,7 @@ public class GetLibraryItemsPart { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -483,6 +502,7 @@ public class GetLibraryItemsPart { return this; } + public GetLibraryItemsPart withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -498,6 +518,7 @@ public class GetLibraryItemsPart { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -513,13 +534,13 @@ public class GetLibraryItemsPart { return this; } + public GetLibraryItemsPart withHasThumbnail(Optional hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = hasThumbnail; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -530,41 +551,31 @@ public class GetLibraryItemsPart { } GetLibraryItemsPart other = (GetLibraryItemsPart) o; return - Objects.deepEquals(this.accessible, other.accessible) && - Objects.deepEquals(this.exists, other.exists) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.indexes, other.indexes) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.packetLength, other.packetLength) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.hasThumbnail, other.hasThumbnail); + Utils.enhancedDeepEquals(this.accessible, other.accessible) && + Utils.enhancedDeepEquals(this.exists, other.exists) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.indexes, other.indexes) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.packetLength, other.packetLength) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.hasThumbnail, other.hasThumbnail); } @Override public int hashCode() { - return Objects.hash( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail); + return Utils.enhancedHash( + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail); } @Override @@ -586,43 +597,45 @@ public class GetLibraryItemsPart { "optimizedForStreaming", optimizedForStreaming, "hasThumbnail", hasThumbnail); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional accessible = Optional.empty(); - + private Optional exists = Optional.empty(); - + private Long id; - + private Optional key = Optional.empty(); - + private Optional indexes = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional file = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional packetLength = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional hasThumbnail; - + private Builder() { // force use of static builder() method } + /** * Indicates if the part is accessible. */ @@ -641,6 +654,7 @@ public class GetLibraryItemsPart { return this; } + /** * Indicates if the part exists. */ @@ -659,6 +673,7 @@ public class GetLibraryItemsPart { return this; } + /** * Unique part identifier. */ @@ -668,6 +683,7 @@ public class GetLibraryItemsPart { return this; } + /** * Key to access this part. */ @@ -686,6 +702,7 @@ public class GetLibraryItemsPart { return this; } + public Builder indexes(String indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = Optional.ofNullable(indexes); @@ -698,6 +715,7 @@ public class GetLibraryItemsPart { return this; } + /** * Duration of the part in milliseconds. */ @@ -716,6 +734,7 @@ public class GetLibraryItemsPart { return this; } + /** * File path for the part. */ @@ -734,6 +753,7 @@ public class GetLibraryItemsPart { return this; } + /** * File size in bytes. */ @@ -752,6 +772,7 @@ public class GetLibraryItemsPart { return this; } + public Builder packetLength(int packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = Optional.ofNullable(packetLength); @@ -764,6 +785,7 @@ public class GetLibraryItemsPart { return this; } + /** * Container format of the part. */ @@ -782,6 +804,7 @@ public class GetLibraryItemsPart { return this; } + /** * Video profile for the part. */ @@ -800,6 +823,7 @@ public class GetLibraryItemsPart { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -818,6 +842,7 @@ public class GetLibraryItemsPart { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -830,6 +855,7 @@ public class GetLibraryItemsPart { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -848,6 +874,7 @@ public class GetLibraryItemsPart { return this; } + public Builder hasThumbnail(GetLibraryItemsHasThumbnail hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = Optional.ofNullable(hasThumbnail); @@ -859,29 +886,21 @@ public class GetLibraryItemsPart { this.hasThumbnail = hasThumbnail; return this; } - + public GetLibraryItemsPart build() { if (hasThumbnail == null) { hasThumbnail = _SINGLETON_VALUE_HasThumbnail.value(); } + return new GetLibraryItemsPart( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail); + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail); } + private static final LazySingletonValue> _SINGLETON_VALUE_HasThumbnail = new LazySingletonValue<>( "hasThumbnail", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsProducer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsProducer.java index f8139843..313fbb82 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsProducer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsProducer.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetLibraryItemsProducer { +public class GetLibraryItemsProducer { /** * The unique role identifier. */ @@ -82,7 +81,8 @@ public class GetLibraryItemsProducer { String filter, String tag, String tagKey) { - this(id, filter, tag, tagKey, Optional.empty(), Optional.empty()); + this(id, filter, tag, + tagKey, Optional.empty(), Optional.empty()); } /** @@ -133,9 +133,10 @@ public class GetLibraryItemsProducer { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique role identifier. @@ -182,6 +183,7 @@ public class GetLibraryItemsProducer { return this; } + /** * The character name or role. */ @@ -200,6 +202,7 @@ public class GetLibraryItemsProducer { return this; } + /** * URL for the role thumbnail image. */ @@ -209,7 +212,6 @@ public class GetLibraryItemsProducer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,23 +222,19 @@ public class GetLibraryItemsProducer { } GetLibraryItemsProducer other = (GetLibraryItemsProducer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag, - tagKey, - role, - thumb); + return Utils.enhancedHash( + id, filter, tag, + tagKey, role, thumb); } @Override @@ -249,25 +247,27 @@ public class GetLibraryItemsProducer { "role", role, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String filter; - + private String tag; - + private String tagKey; - + private Optional role = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The unique role identifier. */ @@ -277,6 +277,7 @@ public class GetLibraryItemsProducer { return this; } + /** * The filter string for the role. */ @@ -286,6 +287,7 @@ public class GetLibraryItemsProducer { return this; } + /** * The actor's name. */ @@ -295,6 +297,7 @@ public class GetLibraryItemsProducer { return this; } + /** * A key associated with the actor tag. */ @@ -304,6 +307,7 @@ public class GetLibraryItemsProducer { return this; } + /** * The character name or role. */ @@ -322,6 +326,7 @@ public class GetLibraryItemsProducer { return this; } + /** * URL for the role thumbnail image. */ @@ -339,15 +344,13 @@ public class GetLibraryItemsProducer { this.thumb = thumb; return this; } - + public GetLibraryItemsProducer build() { + return new GetLibraryItemsProducer( - id, - filter, - tag, - tagKey, - role, - thumb); + id, filter, tag, + tagKey, role, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamIncludeMeta.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamIncludeMeta.java index 32dacb25..2c7b9815 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamIncludeMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsQueryParamIncludeMeta.java @@ -19,7 +19,7 @@ public enum GetLibraryItemsQueryParamIncludeMeta { @JsonValue private final int value; - private GetLibraryItemsQueryParamIncludeMeta(int value) { + GetLibraryItemsQueryParamIncludeMeta(int value) { this.value = value; } 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 28a9071b..cbf1fee1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequest.java @@ -13,11 +13,10 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetLibraryItemsRequest { +public class GetLibraryItemsRequest { /** * A key representing a specific tag within the section. */ @@ -99,7 +98,9 @@ public class GetLibraryItemsRequest { Tag tag, GetLibraryItemsQueryParamType type, int sectionKey) { - this(tag, Optional.empty(), type, sectionKey, Optional.empty(), Optional.empty(), Optional.empty()); + this(tag, Optional.empty(), type, + sectionKey, Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -170,9 +171,10 @@ public class GetLibraryItemsRequest { return xPlexContainerSize; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * A key representing a specific tag within the section. @@ -192,6 +194,7 @@ public class GetLibraryItemsRequest { return this; } + /** * Adds the Guids object to the response */ @@ -234,6 +237,7 @@ public class GetLibraryItemsRequest { return this; } + /** * Adds the Meta object to the response */ @@ -254,6 +258,7 @@ public class GetLibraryItemsRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -276,6 +281,7 @@ public class GetLibraryItemsRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -287,7 +293,6 @@ public class GetLibraryItemsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -298,24 +303,20 @@ public class GetLibraryItemsRequest { } GetLibraryItemsRequest other = (GetLibraryItemsRequest) o; return - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.includeGuids, other.includeGuids) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.sectionKey, other.sectionKey) && - Objects.deepEquals(this.includeMeta, other.includeMeta) && - Objects.deepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && - Objects.deepEquals(this.xPlexContainerSize, other.xPlexContainerSize); + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.includeGuids, other.includeGuids) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.sectionKey, other.sectionKey) && + Utils.enhancedDeepEquals(this.includeMeta, other.includeMeta) && + Utils.enhancedDeepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && + Utils.enhancedDeepEquals(this.xPlexContainerSize, other.xPlexContainerSize); } @Override public int hashCode() { - return Objects.hash( - tag, - includeGuids, - type, - sectionKey, - includeMeta, - xPlexContainerStart, + return Utils.enhancedHash( + tag, includeGuids, type, + sectionKey, includeMeta, xPlexContainerStart, xPlexContainerSize); } @@ -330,27 +331,29 @@ public class GetLibraryItemsRequest { "xPlexContainerStart", xPlexContainerStart, "xPlexContainerSize", xPlexContainerSize); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Tag tag; - + private Optional includeGuids; - + private GetLibraryItemsQueryParamType type; - + private Integer sectionKey; - + private Optional includeMeta; - + private Optional xPlexContainerStart; - + private Optional xPlexContainerSize; - + private Builder() { // force use of static builder() method } + /** * A key representing a specific tag within the section. */ @@ -360,6 +363,7 @@ public class GetLibraryItemsRequest { return this; } + /** * Adds the Guids object to the response */ @@ -378,6 +382,7 @@ public class GetLibraryItemsRequest { return this; } + /** * The type of media to retrieve or filter by. * 1 = movie @@ -392,6 +397,7 @@ public class GetLibraryItemsRequest { return this; } + /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -402,6 +408,7 @@ public class GetLibraryItemsRequest { return this; } + /** * Adds the Meta object to the response */ @@ -420,6 +427,7 @@ public class GetLibraryItemsRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -442,6 +450,7 @@ public class GetLibraryItemsRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -463,7 +472,7 @@ public class GetLibraryItemsRequest { this.xPlexContainerSize = xPlexContainerSize; return this; } - + public GetLibraryItemsRequest build() { if (includeGuids == null) { includeGuids = _SINGLETON_VALUE_IncludeGuids.value(); @@ -477,16 +486,14 @@ public class GetLibraryItemsRequest { if (xPlexContainerSize == null) { xPlexContainerSize = _SINGLETON_VALUE_XPlexContainerSize.value(); } + return new GetLibraryItemsRequest( - tag, - includeGuids, - type, - sectionKey, - includeMeta, - xPlexContainerStart, + tag, includeGuids, type, + sectionKey, includeMeta, xPlexContainerStart, xPlexContainerSize); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeGuids = new LazySingletonValue<>( "includeGuids", 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 193ab642..351f58c2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetLibraryItems; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetLibraryItemsRequestBuilder { private GetLibraryItemsRequest request; - private final SDKMethodInterfaces.MethodCallGetLibraryItems sdk; + private final SDKConfiguration sdkConfiguration; - public GetLibraryItemsRequestBuilder(SDKMethodInterfaces.MethodCallGetLibraryItems sdk) { - this.sdk = sdk; + public GetLibraryItemsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetLibraryItemsRequestBuilder request(GetLibraryItemsRequest request) { @@ -22,8 +26,10 @@ public class GetLibraryItemsRequestBuilder { } public GetLibraryItemsResponse call() throws Exception { + + RequestOperation operation + = new GetLibraryItems.Sync(sdkConfiguration); - return sdk.getLibraryItems( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponse.java index c131a686..f15fa323 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetLibraryItemsResponse implements Response { +public class GetLibraryItemsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetLibraryItemsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetLibraryItemsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetLibraryItemsResponse implements Response { return this; } + /** * The contents of the library by section and tag */ @@ -143,7 +145,6 @@ public class GetLibraryItemsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetLibraryItemsResponse implements Response { } GetLibraryItemsResponse other = (GetLibraryItemsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetLibraryItemsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetLibraryItemsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetLibraryItemsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetLibraryItemsResponse implements Response { return this; } + /** * The contents of the library by section and tag */ @@ -236,13 +240,13 @@ public class GetLibraryItemsResponse implements Response { this.object = object; return this; } - + public GetLibraryItemsResponse build() { + return new GetLibraryItemsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponseBody.java index 4b0c6a29..a2c82c54 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetLibraryItemsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsResponseBody withMediaContainer(GetLibraryItemsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetLibraryItemsResponseBody { return this; } + public GetLibraryItemsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetLibraryItemsResponseBody { } GetLibraryItemsResponseBody other = (GetLibraryItemsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetLibraryItemsResponseBody { return Utils.toString(GetLibraryItemsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetLibraryItemsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetLibraryItemsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetLibraryItemsResponseBody build() { + return new GetLibraryItemsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRole.java index 2445b477..276ddc4c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsRole.java @@ -12,11 +12,10 @@ 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 GetLibraryItemsRole { +public class GetLibraryItemsRole { /** * The unique identifier for the role. * NOTE: This is different for each Plex server and is not globally unique. @@ -63,7 +62,8 @@ public class GetLibraryItemsRole { public GetLibraryItemsRole( int id, String tag) { - this(id, tag, Optional.empty(), Optional.empty()); + this(id, tag, Optional.empty(), + Optional.empty()); } /** @@ -99,9 +99,10 @@ public class GetLibraryItemsRole { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the role. @@ -131,6 +132,7 @@ public class GetLibraryItemsRole { return this; } + /** * The role played by the actor in the media item. */ @@ -149,6 +151,7 @@ public class GetLibraryItemsRole { return this; } + /** * The absolute URL of the thumbnail image for the actor. */ @@ -158,7 +161,6 @@ public class GetLibraryItemsRole { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -169,18 +171,16 @@ public class GetLibraryItemsRole { } GetLibraryItemsRole other = (GetLibraryItemsRole) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - role, + return Utils.enhancedHash( + id, tag, role, thumb); } @@ -192,21 +192,23 @@ public class GetLibraryItemsRole { "role", role, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Optional role = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the role. * NOTE: This is different for each Plex server and is not globally unique. @@ -217,6 +219,7 @@ public class GetLibraryItemsRole { return this; } + /** * The display tag for the actor (typically the actor's name). */ @@ -226,6 +229,7 @@ public class GetLibraryItemsRole { return this; } + /** * The role played by the actor in the media item. */ @@ -244,6 +248,7 @@ public class GetLibraryItemsRole { return this; } + /** * The absolute URL of the thumbnail image for the actor. */ @@ -261,13 +266,13 @@ public class GetLibraryItemsRole { this.thumb = thumb; return this; } - + public GetLibraryItemsRole build() { + return new GetLibraryItemsRole( - id, - tag, - role, + id, tag, role, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSimilar.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSimilar.java index 8eb13128..c9742da0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSimilar.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSimilar.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetLibraryItemsSimilar { - /** * The unique similar item identifier. */ @@ -69,9 +68,10 @@ public class GetLibraryItemsSimilar { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique similar item identifier. @@ -100,7 +100,6 @@ public class GetLibraryItemsSimilar { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,17 +110,15 @@ public class GetLibraryItemsSimilar { } GetLibraryItemsSimilar other = (GetLibraryItemsSimilar) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag); + return Utils.enhancedHash( + id, filter, tag); } @Override @@ -131,19 +128,21 @@ public class GetLibraryItemsSimilar { "filter", filter, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String filter; - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The unique similar item identifier. */ @@ -153,6 +152,7 @@ public class GetLibraryItemsSimilar { return this; } + /** * The filter string for similar items. */ @@ -162,6 +162,7 @@ public class GetLibraryItemsSimilar { return this; } + /** * The tag or title of the similar content. */ @@ -170,12 +171,12 @@ public class GetLibraryItemsSimilar { this.tag = tag; return this; } - + public GetLibraryItemsSimilar build() { + return new GetLibraryItemsSimilar( - id, - filter, - tag); + id, filter, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSort.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSort.java index 284aef36..a63767fb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSort.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsSort.java @@ -15,15 +15,16 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; + public class GetLibraryItemsSort { @JsonInclude(Include.NON_ABSENT) @JsonProperty("default") private Optional default_; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("active") private Optional active; @@ -42,17 +43,21 @@ public class GetLibraryItemsSort { @JsonProperty("defaultDirection") private Optional 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; @@ -87,7 +92,9 @@ public class GetLibraryItemsSort { public GetLibraryItemsSort( String key, String title) { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), key, title); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + key, title); } @JsonIgnore @@ -138,9 +145,10 @@ public class GetLibraryItemsSort { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsSort withDefault(String default_) { Utils.checkNotNull(default_, "default_"); @@ -148,6 +156,7 @@ public class GetLibraryItemsSort { return this; } + public GetLibraryItemsSort withDefault(Optional default_) { Utils.checkNotNull(default_, "default_"); this.default_ = default_; @@ -160,6 +169,7 @@ public class GetLibraryItemsSort { return this; } + public GetLibraryItemsSort withActive(Optional active) { Utils.checkNotNull(active, "active"); this.active = active; @@ -175,6 +185,7 @@ public class GetLibraryItemsSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -193,6 +204,7 @@ public class GetLibraryItemsSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -208,6 +220,7 @@ public class GetLibraryItemsSort { return this; } + public GetLibraryItemsSort withDescKey(Optional descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = descKey; @@ -220,6 +233,7 @@ public class GetLibraryItemsSort { return this; } + public GetLibraryItemsSort withFirstCharacterKey(Optional firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = firstCharacterKey; @@ -238,7 +252,6 @@ public class GetLibraryItemsSort { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -249,27 +262,22 @@ public class GetLibraryItemsSort { } GetLibraryItemsSort other = (GetLibraryItemsSort) o; return - Objects.deepEquals(this.default_, other.default_) && - Objects.deepEquals(this.active, other.active) && - Objects.deepEquals(this.activeDirection, other.activeDirection) && - 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); + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.activeDirection, other.activeDirection) && + Utils.enhancedDeepEquals(this.defaultDirection, other.defaultDirection) && + Utils.enhancedDeepEquals(this.descKey, other.descKey) && + Utils.enhancedDeepEquals(this.firstCharacterKey, other.firstCharacterKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - default_, - active, - activeDirection, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + return Utils.enhancedHash( + default_, active, activeDirection, + defaultDirection, descKey, firstCharacterKey, + key, title); } @Override @@ -284,29 +292,31 @@ public class GetLibraryItemsSort { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional default_ = Optional.empty(); - + private Optional active = Optional.empty(); - + private Optional activeDirection; - + private Optional 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_); @@ -319,6 +329,7 @@ public class GetLibraryItemsSort { return this; } + public Builder active(boolean active) { Utils.checkNotNull(active, "active"); this.active = Optional.ofNullable(active); @@ -331,6 +342,7 @@ public class GetLibraryItemsSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -349,6 +361,7 @@ public class GetLibraryItemsSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -367,6 +380,7 @@ public class GetLibraryItemsSort { return this; } + public Builder descKey(String descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = Optional.ofNullable(descKey); @@ -379,6 +393,7 @@ public class GetLibraryItemsSort { return this; } + public Builder firstCharacterKey(String firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = Optional.ofNullable(firstCharacterKey); @@ -391,18 +406,20 @@ public class GetLibraryItemsSort { 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() { if (activeDirection == null) { activeDirection = _SINGLETON_VALUE_ActiveDirection.value(); @@ -410,17 +427,14 @@ public class GetLibraryItemsSort { if (defaultDirection == null) { defaultDirection = _SINGLETON_VALUE_DefaultDirection.value(); } + return new GetLibraryItemsSort( - default_, - active, - activeDirection, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + default_, active, activeDirection, + defaultDirection, descKey, firstCharacterKey, + key, title); } + private static final LazySingletonValue> _SINGLETON_VALUE_ActiveDirection = new LazySingletonValue<>( "activeDirection", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsUltraBlurColors.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsUltraBlurColors.java index 44d8556c..65ee96b2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsUltraBlurColors.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsUltraBlurColors.java @@ -9,19 +9,22 @@ 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 GetLibraryItemsUltraBlurColors { @JsonProperty("topLeft") private String topLeft; + @JsonProperty("topRight") private String topRight; + @JsonProperty("bottomRight") private String bottomRight; + @JsonProperty("bottomLeft") private String bottomLeft; @@ -61,9 +64,10 @@ public class GetLibraryItemsUltraBlurColors { return bottomLeft; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibraryItemsUltraBlurColors withTopLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); @@ -89,7 +93,6 @@ public class GetLibraryItemsUltraBlurColors { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -100,18 +103,16 @@ public class GetLibraryItemsUltraBlurColors { } GetLibraryItemsUltraBlurColors other = (GetLibraryItemsUltraBlurColors) o; return - Objects.deepEquals(this.topLeft, other.topLeft) && - Objects.deepEquals(this.topRight, other.topRight) && - Objects.deepEquals(this.bottomRight, other.bottomRight) && - Objects.deepEquals(this.bottomLeft, other.bottomLeft); + Utils.enhancedDeepEquals(this.topLeft, other.topLeft) && + Utils.enhancedDeepEquals(this.topRight, other.topRight) && + Utils.enhancedDeepEquals(this.bottomRight, other.bottomRight) && + Utils.enhancedDeepEquals(this.bottomLeft, other.bottomLeft); } @Override public int hashCode() { - return Objects.hash( - topLeft, - topRight, - bottomRight, + return Utils.enhancedHash( + topLeft, topRight, bottomRight, bottomLeft); } @@ -123,51 +124,56 @@ public class GetLibraryItemsUltraBlurColors { "bottomRight", bottomRight, "bottomLeft", bottomLeft); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String topLeft; - + private String topRight; - + private String bottomRight; - + private String bottomLeft; - + private Builder() { // force use of static builder() method } + public Builder topLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); this.topLeft = topLeft; return this; } + public Builder topRight(String topRight) { Utils.checkNotNull(topRight, "topRight"); this.topRight = topRight; return this; } + public Builder bottomRight(String bottomRight) { Utils.checkNotNull(bottomRight, "bottomRight"); this.bottomRight = bottomRight; return this; } + public Builder bottomLeft(String bottomLeft) { Utils.checkNotNull(bottomLeft, "bottomLeft"); this.bottomLeft = bottomLeft; return this; } - + public GetLibraryItemsUltraBlurColors build() { + return new GetLibraryItemsUltraBlurColors( - topLeft, - topRight, - bottomRight, + topLeft, topRight, bottomRight, bottomLeft); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsWriter.java index 5c4d5256..0488d74b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsWriter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibraryItemsWriter.java @@ -12,11 +12,10 @@ 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 GetLibraryItemsWriter { +public class GetLibraryItemsWriter { /** * Unique identifier for the writer. */ @@ -79,9 +78,10 @@ public class GetLibraryItemsWriter { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the writer. @@ -110,6 +110,7 @@ public class GetLibraryItemsWriter { return this; } + /** * The absolute URL of the thumbnail image for the writer. */ @@ -119,7 +120,6 @@ public class GetLibraryItemsWriter { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -130,17 +130,15 @@ public class GetLibraryItemsWriter { } GetLibraryItemsWriter other = (GetLibraryItemsWriter) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - thumb); + return Utils.enhancedHash( + id, tag, thumb); } @Override @@ -150,19 +148,21 @@ public class GetLibraryItemsWriter { "tag", tag, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the writer. */ @@ -172,6 +172,7 @@ public class GetLibraryItemsWriter { return this; } + /** * The role of Writer */ @@ -181,6 +182,7 @@ public class GetLibraryItemsWriter { return this; } + /** * The absolute URL of the thumbnail image for the writer. */ @@ -198,12 +200,12 @@ public class GetLibraryItemsWriter { this.thumb = thumb; return this; } - + public GetLibraryItemsWriter build() { + return new GetLibraryItemsWriter( - id, - tag, - thumb); + id, tag, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllActiveDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllActiveDirection.java index a70b179c..14a29aff 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllActiveDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllActiveDirection.java @@ -20,7 +20,7 @@ public enum GetLibrarySectionsAllActiveDirection { @JsonValue private final String value; - private GetLibrarySectionsAllActiveDirection(String value) { + GetLibrarySectionsAllActiveDirection(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllCollection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllCollection.java index 30fbc123..46c599d1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllCollection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllCollection.java @@ -9,10 +9,9 @@ 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 GetLibrarySectionsAllCollection { - /** * The user-made collection this media item belongs to */ @@ -34,9 +33,10 @@ public class GetLibrarySectionsAllCollection { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The user-made collection this media item belongs to @@ -47,7 +47,6 @@ public class GetLibrarySectionsAllCollection { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibrarySectionsAllCollection { } GetLibrarySectionsAllCollection other = (GetLibrarySectionsAllCollection) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -72,15 +71,17 @@ public class GetLibrarySectionsAllCollection { return Utils.toString(GetLibrarySectionsAllCollection.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The user-made collection this media item belongs to */ @@ -89,10 +90,12 @@ public class GetLibrarySectionsAllCollection { this.tag = tag; return this; } - + public GetLibrarySectionsAllCollection build() { + return new GetLibrarySectionsAllCollection( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllCountry.java index 1a985f29..01031981 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllCountry.java @@ -9,10 +9,9 @@ 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 GetLibrarySectionsAllCountry { - /** * The country of origin of this media item */ @@ -34,9 +33,10 @@ public class GetLibrarySectionsAllCountry { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The country of origin of this media item @@ -47,7 +47,6 @@ public class GetLibrarySectionsAllCountry { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibrarySectionsAllCountry { } GetLibrarySectionsAllCountry other = (GetLibrarySectionsAllCountry) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -72,15 +71,17 @@ public class GetLibrarySectionsAllCountry { return Utils.toString(GetLibrarySectionsAllCountry.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The country of origin of this media item */ @@ -89,10 +90,12 @@ public class GetLibrarySectionsAllCountry { this.tag = tag; return this; } - + public GetLibrarySectionsAllCountry build() { + return new GetLibrarySectionsAllCountry( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllDefaultDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllDefaultDirection.java index 2b135d4e..4b7773eb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllDefaultDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllDefaultDirection.java @@ -20,7 +20,7 @@ public enum GetLibrarySectionsAllDefaultDirection { @JsonValue private final String value; - private GetLibrarySectionsAllDefaultDirection(String value) { + GetLibrarySectionsAllDefaultDirection(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllDirector.java index 64992f0f..756854a4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllDirector.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllDirector.java @@ -9,10 +9,9 @@ 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 GetLibrarySectionsAllDirector { - /** * The role of Director */ @@ -34,9 +33,10 @@ public class GetLibrarySectionsAllDirector { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The role of Director @@ -47,7 +47,6 @@ public class GetLibrarySectionsAllDirector { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibrarySectionsAllDirector { } GetLibrarySectionsAllDirector other = (GetLibrarySectionsAllDirector) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -72,15 +71,17 @@ public class GetLibrarySectionsAllDirector { return Utils.toString(GetLibrarySectionsAllDirector.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The role of Director */ @@ -89,10 +90,12 @@ public class GetLibrarySectionsAllDirector { this.tag = tag; return this; } - + public GetLibrarySectionsAllDirector build() { + return new GetLibrarySectionsAllDirector( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllField.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllField.java index 85193397..ccd9f7d5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllField.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllField.java @@ -11,20 +11,23 @@ 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 GetLibrarySectionsAllField { @JsonProperty("key") private String key; + @JsonProperty("title") private String title; + @JsonProperty("type") private String type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subType") private Optional subType; @@ -49,7 +52,8 @@ public class GetLibrarySectionsAllField { String key, String title, String type) { - this(key, title, type, Optional.empty()); + this(key, title, type, + Optional.empty()); } @JsonIgnore @@ -72,9 +76,10 @@ public class GetLibrarySectionsAllField { return subType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllField withKey(String key) { Utils.checkNotNull(key, "key"); @@ -100,13 +105,13 @@ public class GetLibrarySectionsAllField { return this; } + public GetLibrarySectionsAllField withSubType(Optional subType) { Utils.checkNotNull(subType, "subType"); this.subType = subType; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -117,18 +122,16 @@ public class GetLibrarySectionsAllField { } GetLibrarySectionsAllField other = (GetLibrarySectionsAllField) 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subType, other.subType); } @Override public int hashCode() { - return Objects.hash( - key, - title, - type, + return Utils.enhancedHash( + key, title, type, subType); } @@ -140,39 +143,44 @@ public class GetLibrarySectionsAllField { "type", type, "subType", subType); } - + + @SuppressWarnings("UnusedReturnValue") 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); @@ -184,13 +192,13 @@ public class GetLibrarySectionsAllField { this.subType = subType; return this; } - + public GetLibrarySectionsAllField build() { + return new GetLibrarySectionsAllField( - key, - title, - type, + key, title, type, subType); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllFieldType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllFieldType.java index 8228797a..e77f7e73 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllFieldType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllFieldType.java @@ -10,13 +10,14 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; + public class GetLibrarySectionsAllFieldType { @JsonProperty("type") private String type; + @JsonProperty("Operator") private List operator; @@ -40,9 +41,10 @@ public class GetLibrarySectionsAllFieldType { return operator; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllFieldType withType(String type) { Utils.checkNotNull(type, "type"); @@ -56,7 +58,6 @@ public class GetLibrarySectionsAllFieldType { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,15 +68,14 @@ public class GetLibrarySectionsAllFieldType { } GetLibrarySectionsAllFieldType other = (GetLibrarySectionsAllFieldType) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.operator, other.operator); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.operator, other.operator); } @Override public int hashCode() { - return Objects.hash( - type, - operator); + return Utils.enhancedHash( + type, operator); } @Override @@ -84,33 +84,37 @@ public class GetLibrarySectionsAllFieldType { "type", type, "operator", operator); } - + + @SuppressWarnings("UnusedReturnValue") 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 GetLibrarySectionsAllFieldType build() { + return new GetLibrarySectionsAllFieldType( - type, - operator); + type, operator); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllFilter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllFilter.java index fcca2f5b..b8f84c54 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllFilter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllFilter.java @@ -12,26 +12,31 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetLibrarySectionsAllFilter { @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; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("advanced") private Optional advanced; @@ -64,7 +69,8 @@ public class GetLibrarySectionsAllFilter { String key, String title, String type) { - this(filter, filterType, key, title, type, Optional.empty()); + this(filter, filterType, key, + title, type, Optional.empty()); } @JsonIgnore @@ -97,9 +103,10 @@ public class GetLibrarySectionsAllFilter { return advanced; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllFilter withFilter(String filter) { Utils.checkNotNull(filter, "filter"); @@ -137,13 +144,13 @@ public class GetLibrarySectionsAllFilter { return this; } + public GetLibrarySectionsAllFilter withAdvanced(Optional advanced) { Utils.checkNotNull(advanced, "advanced"); this.advanced = advanced; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,23 +161,19 @@ public class GetLibrarySectionsAllFilter { } GetLibrarySectionsAllFilter other = (GetLibrarySectionsAllFilter) 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) && - Objects.deepEquals(this.advanced, other.advanced); + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.filterType, other.filterType) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.advanced, other.advanced); } @Override public int hashCode() { - return Objects.hash( - filter, - filterType, - key, - title, - type, - advanced); + return Utils.enhancedHash( + filter, filterType, key, + title, type, advanced); } @Override @@ -183,55 +186,62 @@ public class GetLibrarySectionsAllFilter { "type", type, "advanced", advanced); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String filter; - + private String filterType; - + private String key; - + private String title; - + private String type; - + private Optional advanced = Optional.empty(); - + 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 Builder advanced(boolean advanced) { Utils.checkNotNull(advanced, "advanced"); this.advanced = Optional.ofNullable(advanced); @@ -243,15 +253,13 @@ public class GetLibrarySectionsAllFilter { this.advanced = advanced; return this; } - + public GetLibrarySectionsAllFilter build() { + return new GetLibrarySectionsAllFilter( - filter, - filterType, - key, - title, - type, - advanced); + filter, filterType, key, + title, type, advanced); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllGenre.java index 57a05e1f..cdf6cd96 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllGenre.java @@ -9,10 +9,9 @@ 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 GetLibrarySectionsAllGenre { - /** * The genre name of this media-item */ @@ -34,9 +33,10 @@ public class GetLibrarySectionsAllGenre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The genre name of this media-item @@ -47,7 +47,6 @@ public class GetLibrarySectionsAllGenre { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibrarySectionsAllGenre { } GetLibrarySectionsAllGenre other = (GetLibrarySectionsAllGenre) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -72,15 +71,17 @@ public class GetLibrarySectionsAllGenre { return Utils.toString(GetLibrarySectionsAllGenre.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The genre name of this media-item */ @@ -89,10 +90,12 @@ public class GetLibrarySectionsAllGenre { this.tag = tag; return this; } - + public GetLibrarySectionsAllGenre build() { + return new GetLibrarySectionsAllGenre( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllGuids.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllGuids.java index 60c0e2b5..41a0d88b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllGuids.java @@ -9,10 +9,9 @@ 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 GetLibrarySectionsAllGuids { - /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -34,9 +33,10 @@ public class GetLibrarySectionsAllGuids { return id; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// @@ -47,7 +47,6 @@ public class GetLibrarySectionsAllGuids { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibrarySectionsAllGuids { } GetLibrarySectionsAllGuids other = (GetLibrarySectionsAllGuids) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } @@ -72,15 +71,17 @@ public class GetLibrarySectionsAllGuids { return Utils.toString(GetLibrarySectionsAllGuids.class, "id", id); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String id; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -89,10 +90,12 @@ public class GetLibrarySectionsAllGuids { this.id = id; return this; } - + public GetLibrarySectionsAllGuids build() { + return new GetLibrarySectionsAllGuids( id); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllHasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllHasThumbnail.java index 8120a03b..fd7854a2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllHasThumbnail.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllHasThumbnail.java @@ -20,7 +20,7 @@ public enum GetLibrarySectionsAllHasThumbnail { @JsonValue private final String value; - private GetLibrarySectionsAllHasThumbnail(String value) { + GetLibrarySectionsAllHasThumbnail(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllImage.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllImage.java index 3fffc810..3695bb85 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllImage.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllImage.java @@ -9,16 +9,18 @@ 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 GetLibrarySectionsAllImage { @JsonProperty("alt") private String alt; + @JsonProperty("type") private GetLibrarySectionsAllLibraryResponseType type; + @JsonProperty("url") private String url; @@ -50,9 +52,10 @@ public class GetLibrarySectionsAllImage { return url; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllImage withAlt(String alt) { Utils.checkNotNull(alt, "alt"); @@ -72,7 +75,6 @@ public class GetLibrarySectionsAllImage { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -83,17 +85,15 @@ public class GetLibrarySectionsAllImage { } GetLibrarySectionsAllImage other = (GetLibrarySectionsAllImage) o; return - Objects.deepEquals(this.alt, other.alt) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.alt, other.alt) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( - alt, - type, - url); + return Utils.enhancedHash( + alt, type, url); } @Override @@ -103,42 +103,46 @@ public class GetLibrarySectionsAllImage { "type", type, "url", url); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String alt; - + private GetLibrarySectionsAllLibraryResponseType type; - + private String url; - + private Builder() { // force use of static builder() method } + public Builder alt(String alt) { Utils.checkNotNull(alt, "alt"); this.alt = alt; return this; } + public Builder type(GetLibrarySectionsAllLibraryResponseType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder url(String url) { Utils.checkNotNull(url, "url"); this.url = url; return this; } - + public GetLibrarySectionsAllImage build() { + return new GetLibrarySectionsAllImage( - alt, - type, - url); + alt, type, url); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllLibraryOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllLibraryOptimizedForStreaming.java index 0e51f584..3405c6ff 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllLibraryOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllLibraryOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetLibrarySectionsAllLibraryOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetLibrarySectionsAllLibraryOptimizedForStreaming { return false; } GetLibrarySectionsAllLibraryOptimizedForStreaming other = (GetLibrarySectionsAllLibraryOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMedia.java index 9e814421..648c3853 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMedia.java @@ -17,11 +17,10 @@ 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 GetLibrarySectionsAllMedia { +public class GetLibrarySectionsAllMedia { /** * Unique media identifier. */ @@ -70,6 +69,7 @@ public class GetLibrarySectionsAllMedia { @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("displayOffset") private Optional displayOffset; @@ -137,6 +137,7 @@ public class GetLibrarySectionsAllMedia { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; @@ -211,7 +212,13 @@ public class GetLibrarySectionsAllMedia { public GetLibrarySectionsAllMedia( long id) { - this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -362,9 +369,10 @@ public class GetLibrarySectionsAllMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique media identifier. @@ -384,6 +392,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Duration of the media in milliseconds. */ @@ -402,6 +411,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Bitrate in bits per second. */ @@ -420,6 +430,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video width in pixels. */ @@ -438,6 +449,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video height in pixels. */ @@ -456,6 +468,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Aspect ratio of the video. */ @@ -474,6 +487,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Number of audio channels. */ @@ -489,6 +503,7 @@ public class GetLibrarySectionsAllMedia { return this; } + public GetLibrarySectionsAllMedia withDisplayOffset(Optional displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = displayOffset; @@ -504,6 +519,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Audio codec used. */ @@ -522,6 +538,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video codec used. */ @@ -540,6 +557,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video resolution (e.g., 4k). */ @@ -558,6 +576,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * File container type. */ @@ -576,6 +595,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -594,6 +614,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video profile (e.g., main 10). */ @@ -612,6 +633,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Indicates whether voice activity is detected. */ @@ -630,6 +652,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -648,6 +671,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -663,6 +687,7 @@ public class GetLibrarySectionsAllMedia { return this; } + public GetLibrarySectionsAllMedia withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -678,6 +703,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * An array of parts for this media item. */ @@ -687,7 +713,6 @@ public class GetLibrarySectionsAllMedia { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -698,48 +723,36 @@ public class GetLibrarySectionsAllMedia { } GetLibrarySectionsAllMedia other = (GetLibrarySectionsAllMedia) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.displayOffset, other.displayOffset) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.displayOffset, other.displayOffset) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } @@ -766,51 +779,53 @@ public class GetLibrarySectionsAllMedia { "has64bitOffsets", has64bitOffsets, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional displayOffset = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional hasVoiceActivity = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique media identifier. */ @@ -820,6 +835,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Duration of the media in milliseconds. */ @@ -838,6 +854,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Bitrate in bits per second. */ @@ -856,6 +873,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video width in pixels. */ @@ -874,6 +892,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video height in pixels. */ @@ -892,6 +911,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Aspect ratio of the video. */ @@ -910,6 +930,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Number of audio channels. */ @@ -928,6 +949,7 @@ public class GetLibrarySectionsAllMedia { return this; } + public Builder displayOffset(int displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = Optional.ofNullable(displayOffset); @@ -940,6 +962,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Audio codec used. */ @@ -958,6 +981,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video codec used. */ @@ -976,6 +1000,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video resolution (e.g., 4k). */ @@ -994,6 +1019,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * File container type. */ @@ -1012,6 +1038,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -1030,6 +1057,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Video profile (e.g., main 10). */ @@ -1048,6 +1076,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Indicates whether voice activity is detected. */ @@ -1066,6 +1095,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -1084,6 +1114,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -1102,6 +1133,7 @@ public class GetLibrarySectionsAllMedia { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -1114,6 +1146,7 @@ public class GetLibrarySectionsAllMedia { return this; } + /** * An array of parts for this media item. */ @@ -1131,28 +1164,18 @@ public class GetLibrarySectionsAllMedia { this.part = part; return this; } - + public GetLibrarySectionsAllMedia build() { + return new GetLibrarySectionsAllMedia( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMediaContainer.java index 4e861039..1fec9731 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMediaContainer.java @@ -16,11 +16,10 @@ 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 GetLibrarySectionsAllMediaContainer { +public class GetLibrarySectionsAllMediaContainer { /** * Number of media items returned in this response. */ @@ -216,7 +215,13 @@ public class GetLibrarySectionsAllMediaContainer { String title1, String title2, String viewGroup) { - this(size, totalSize, offset, allowSync, art, content, identifier, Optional.empty(), Optional.empty(), Optional.empty(), mediaTagPrefix, mediaTagVersion, thumb, nocache, title1, title2, viewGroup, Optional.empty(), Optional.empty()); + this(size, totalSize, offset, + allowSync, art, content, + identifier, Optional.empty(), Optional.empty(), + Optional.empty(), mediaTagPrefix, mediaTagVersion, + thumb, nocache, title1, + title2, viewGroup, Optional.empty(), + Optional.empty()); } /** @@ -373,9 +378,10 @@ public class GetLibrarySectionsAllMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -449,6 +455,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The unique identifier for the library section. */ @@ -467,6 +474,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The title of the library section. */ @@ -485,6 +493,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The universally unique identifier for the library section. */ @@ -566,6 +575,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. */ @@ -584,6 +594,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * An array of metadata items. */ @@ -593,7 +604,6 @@ public class GetLibrarySectionsAllMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -604,48 +614,36 @@ public class GetLibrarySectionsAllMediaContainer { } GetLibrarySectionsAllMediaContainer other = (GetLibrarySectionsAllMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.totalSize, other.totalSize) && - Objects.deepEquals(this.offset, other.offset) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.nocache, other.nocache) && - Objects.deepEquals(this.title1, other.title1) && - Objects.deepEquals(this.title2, other.title2) && - Objects.deepEquals(this.viewGroup, other.viewGroup) && - Objects.deepEquals(this.meta, other.meta) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.totalSize, other.totalSize) && + Utils.enhancedDeepEquals(this.offset, other.offset) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionUUID, other.librarySectionUUID) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.nocache, other.nocache) && + Utils.enhancedDeepEquals(this.title1, other.title1) && + Utils.enhancedDeepEquals(this.title2, other.title2) && + Utils.enhancedDeepEquals(this.viewGroup, other.viewGroup) && + Utils.enhancedDeepEquals(this.meta, other.meta) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - totalSize, - offset, - allowSync, - art, - content, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - thumb, - nocache, - title1, - title2, - viewGroup, - meta, + return Utils.enhancedHash( + size, totalSize, offset, + allowSync, art, content, + identifier, librarySectionID, librarySectionTitle, + librarySectionUUID, mediaTagPrefix, mediaTagVersion, + thumb, nocache, title1, + title2, viewGroup, meta, metadata); } @@ -672,51 +670,53 @@ public class GetLibrarySectionsAllMediaContainer { "meta", meta, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Integer totalSize; - + private Long offset; - + private Boolean allowSync; - + private String art; - + private String content; - + private String identifier; - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionUUID = Optional.empty(); - + private String mediaTagPrefix; - + private Long mediaTagVersion; - + private String thumb; - + private Boolean nocache; - + private String title1; - + private String title2; - + private String viewGroup; - + private Optional meta = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -726,6 +726,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * Total number of media items in the library. */ @@ -735,6 +736,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * Offset value for pagination. */ @@ -744,6 +746,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * Indicates whether syncing is allowed. */ @@ -753,6 +756,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * URL for the background artwork of the media container. */ @@ -762,6 +766,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The content type or mode. */ @@ -771,6 +776,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -780,6 +786,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The unique identifier for the library section. */ @@ -798,6 +805,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The title of the library section. */ @@ -816,6 +824,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The universally unique identifier for the library section. */ @@ -834,6 +843,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The prefix used for media tag resource paths. */ @@ -843,6 +853,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The version number for media tags. */ @@ -852,6 +863,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * URL for the thumbnail image of the media container. */ @@ -861,6 +873,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * Specifies whether caching is disabled. */ @@ -870,6 +883,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The primary title of the media container. */ @@ -879,6 +893,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The secondary title of the media container. */ @@ -888,6 +903,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * Identifier for the view group layout. */ @@ -897,6 +913,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. */ @@ -915,6 +932,7 @@ public class GetLibrarySectionsAllMediaContainer { return this; } + /** * An array of metadata items. */ @@ -932,28 +950,18 @@ public class GetLibrarySectionsAllMediaContainer { this.metadata = metadata; return this; } - + public GetLibrarySectionsAllMediaContainer build() { + return new GetLibrarySectionsAllMediaContainer( - size, - totalSize, - offset, - allowSync, - art, - content, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - thumb, - nocache, - title1, - title2, - viewGroup, - meta, + size, totalSize, offset, + allowSync, art, content, + identifier, librarySectionID, librarySectionTitle, + librarySectionUUID, mediaTagPrefix, mediaTagVersion, + thumb, nocache, title1, + title2, viewGroup, meta, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMeta.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMeta.java index 4e83ae37..4cf575bf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMeta.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -27,6 +26,7 @@ public class GetLibrarySectionsAllMeta { @JsonProperty("Type") private Optional> type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("FieldType") private Optional> fieldType; @@ -57,9 +57,10 @@ public class GetLibrarySectionsAllMeta { return (Optional>) fieldType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllMeta withType(List type) { Utils.checkNotNull(type, "type"); @@ -67,6 +68,7 @@ public class GetLibrarySectionsAllMeta { return this; } + public GetLibrarySectionsAllMeta withType(Optional> type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -79,13 +81,13 @@ public class GetLibrarySectionsAllMeta { return this; } + public GetLibrarySectionsAllMeta withFieldType(Optional> fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = fieldType; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -96,15 +98,14 @@ public class GetLibrarySectionsAllMeta { } GetLibrarySectionsAllMeta other = (GetLibrarySectionsAllMeta) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.fieldType, other.fieldType); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.fieldType, other.fieldType); } @Override public int hashCode() { - return Objects.hash( - type, - fieldType); + return Utils.enhancedHash( + type, fieldType); } @Override @@ -113,17 +114,19 @@ public class GetLibrarySectionsAllMeta { "type", type, "fieldType", fieldType); } - + + @SuppressWarnings("UnusedReturnValue") 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); @@ -136,6 +139,7 @@ public class GetLibrarySectionsAllMeta { return this; } + public Builder fieldType(List fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = Optional.ofNullable(fieldType); @@ -147,11 +151,12 @@ public class GetLibrarySectionsAllMeta { this.fieldType = fieldType; return this; } - + public GetLibrarySectionsAllMeta build() { + return new GetLibrarySectionsAllMeta( - type, - fieldType); + type, fieldType); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMetadata.java index d4eb172b..a3acfb8d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllMetadata.java @@ -18,7 +18,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -27,7 +26,6 @@ import java.util.Optional; *

Unknown */ public class GetLibrarySectionsAllMetadata { - /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -59,6 +57,7 @@ public class GetLibrarySectionsAllMetadata { @JsonProperty("studio") private Optional studio; + @JsonProperty("type") private GetLibrarySectionsAllLibraryType type; @@ -175,6 +174,7 @@ public class GetLibrarySectionsAllMetadata { @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonProperty("addedAt") private long addedAt; @@ -381,42 +381,52 @@ public class GetLibrarySectionsAllMetadata { @JsonProperty("userRating") private Optional userRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Image") private Optional> image; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("UltraBlurColors") private Optional ultraBlurColors; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Guid") private Optional> guids; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Collection") private Optional> collection; @@ -637,7 +647,28 @@ public class GetLibrarySectionsAllMetadata { int seasonCount, int duration, long addedAt) { - this(ratingKey, key, guid, slug, Optional.empty(), type, title, titleSort, Optional.empty(), summary, rating, audienceRating, Optional.empty(), tagline, thumb, art, theme, index, Optional.empty(), Optional.empty(), childCount, seasonCount, duration, Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(ratingKey, key, guid, + slug, Optional.empty(), type, + title, titleSort, Optional.empty(), + summary, rating, audienceRating, + Optional.empty(), tagline, thumb, + art, theme, index, + Optional.empty(), Optional.empty(), childCount, + seasonCount, duration, Optional.empty(), + addedAt, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -1126,9 +1157,10 @@ public class GetLibrarySectionsAllMetadata { return (Optional>) collection; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. @@ -1175,6 +1207,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The studio that produced the media item. */ @@ -1217,6 +1250,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The content rating for the media item. */ @@ -1262,6 +1296,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The release year of the media item. */ @@ -1325,6 +1360,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -1343,6 +1379,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -1388,6 +1425,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The original release date of the media item. */ @@ -1412,6 +1450,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * Unix epoch datetime in seconds */ @@ -1430,6 +1469,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -1448,6 +1488,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -1466,6 +1507,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -1484,6 +1526,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -1502,6 +1545,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -1520,6 +1564,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -1538,6 +1583,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -1556,6 +1602,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -1574,6 +1621,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -1592,6 +1640,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -1610,6 +1659,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The key of the parent media item. */ @@ -1628,6 +1678,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -1646,6 +1697,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -1664,6 +1716,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -1682,6 +1735,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -1700,6 +1754,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The title of the parent media item. */ @@ -1718,6 +1773,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The index position of the parent media item. */ @@ -1736,6 +1792,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -1754,6 +1811,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The URL for the rating image. */ @@ -1772,6 +1830,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -1790,6 +1849,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -1808,6 +1868,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -1826,6 +1887,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -1844,6 +1906,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -1862,6 +1925,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -1880,6 +1944,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -1898,6 +1963,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -1916,6 +1982,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -1931,6 +1998,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withImage(Optional> image) { Utils.checkNotNull(image, "image"); this.image = image; @@ -1943,6 +2011,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withUltraBlurColors(Optional ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = ultraBlurColors; @@ -1955,6 +2024,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withGuids(Optional> guids) { Utils.checkNotNull(guids, "guids"); this.guids = guids; @@ -1967,6 +2037,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -1979,6 +2050,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -1991,6 +2063,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -2003,6 +2076,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -2015,6 +2089,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -2027,6 +2102,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; @@ -2039,13 +2115,13 @@ public class GetLibrarySectionsAllMetadata { return this; } + public GetLibrarySectionsAllMetadata withCollection(Optional> collection) { Utils.checkNotNull(collection, "collection"); this.collection = collection; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -2056,138 +2132,96 @@ public class GetLibrarySectionsAllMetadata { } GetLibrarySectionsAllMetadata other = (GetLibrarySectionsAllMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.slug, other.slug) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.titleSort, other.titleSort) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.theme, other.theme) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.seasonCount, other.seasonCount) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.chapterSource, other.chapterSource) && - Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && - Objects.deepEquals(this.originalTitle, other.originalTitle) && - Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && - Objects.deepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && - Objects.deepEquals(this.parentGuid, other.parentGuid) && - Objects.deepEquals(this.grandparentGuid, other.grandparentGuid) && - Objects.deepEquals(this.grandparentSlug, other.grandparentSlug) && - Objects.deepEquals(this.grandparentKey, other.grandparentKey) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && - Objects.deepEquals(this.grandparentThumb, other.grandparentThumb) && - Objects.deepEquals(this.grandparentTheme, other.grandparentTheme) && - Objects.deepEquals(this.grandparentArt, other.grandparentArt) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.viewOffset, other.viewOffset) && - Objects.deepEquals(this.skipCount, other.skipCount) && - Objects.deepEquals(this.subtype, other.subtype) && - Objects.deepEquals(this.lastRatedAt, other.lastRatedAt) && - Objects.deepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && - Objects.deepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.userRating, other.userRating) && - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) && - Objects.deepEquals(this.guids, other.guids) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.collection, other.collection); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.slug, other.slug) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.titleSort, other.titleSort) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.theme, other.theme) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.seasonCount, other.seasonCount) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.chapterSource, other.chapterSource) && + Utils.enhancedDeepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Utils.enhancedDeepEquals(this.originalTitle, other.originalTitle) && + Utils.enhancedDeepEquals(this.parentRatingKey, other.parentRatingKey) && + Utils.enhancedDeepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && + Utils.enhancedDeepEquals(this.parentGuid, other.parentGuid) && + Utils.enhancedDeepEquals(this.grandparentGuid, other.grandparentGuid) && + Utils.enhancedDeepEquals(this.grandparentSlug, other.grandparentSlug) && + Utils.enhancedDeepEquals(this.grandparentKey, other.grandparentKey) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.grandparentTitle, other.grandparentTitle) && + Utils.enhancedDeepEquals(this.grandparentThumb, other.grandparentThumb) && + Utils.enhancedDeepEquals(this.grandparentTheme, other.grandparentTheme) && + Utils.enhancedDeepEquals(this.grandparentArt, other.grandparentArt) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.viewOffset, other.viewOffset) && + Utils.enhancedDeepEquals(this.skipCount, other.skipCount) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.lastRatedAt, other.lastRatedAt) && + Utils.enhancedDeepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && + Utils.enhancedDeepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.userRating, other.userRating) && + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.ultraBlurColors, other.ultraBlurColors) && + Utils.enhancedDeepEquals(this.guids, other.guids) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.collection, other.collection); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - titleSort, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - theme, - index, - leafCount, - viewedLeafCount, - childCount, - seasonCount, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - originalTitle, - parentRatingKey, - grandparentRatingKey, - parentGuid, - grandparentGuid, - grandparentSlug, - grandparentKey, - parentKey, - grandparentTitle, - grandparentThumb, - grandparentTheme, - grandparentArt, - parentTitle, - parentIndex, - parentThumb, - ratingImage, - viewCount, - viewOffset, - skipCount, - subtype, - lastRatedAt, - createdAtAccuracy, - createdAtTZOffset, - lastViewedAt, - userRating, - image, - ultraBlurColors, - guids, - media, - genre, - country, - director, - writer, - role, + return Utils.enhancedHash( + ratingKey, key, guid, + slug, studio, type, + title, titleSort, contentRating, + summary, rating, audienceRating, + year, tagline, thumb, + art, theme, index, + leafCount, viewedLeafCount, childCount, + seasonCount, duration, originallyAvailableAt, + addedAt, updatedAt, audienceRatingImage, + chapterSource, primaryExtraKey, originalTitle, + parentRatingKey, grandparentRatingKey, parentGuid, + grandparentGuid, grandparentSlug, grandparentKey, + parentKey, grandparentTitle, grandparentThumb, + grandparentTheme, grandparentArt, parentTitle, + parentIndex, parentThumb, ratingImage, + viewCount, viewOffset, skipCount, + subtype, lastRatedAt, createdAtAccuracy, + createdAtTZOffset, lastViewedAt, userRating, + image, ultraBlurColors, guids, + media, genre, country, + director, writer, role, collection); } @@ -2259,141 +2293,143 @@ public class GetLibrarySectionsAllMetadata { "role", role, "collection", collection); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String ratingKey; - + private String key; - + private String guid; - + private String slug; - + private Optional studio = Optional.empty(); - + private GetLibrarySectionsAllLibraryType type; - + private String title; - + private String titleSort; - + private Optional contentRating = Optional.empty(); - + private String summary; - + private Float rating; - + private Double audienceRating; - + private Optional year = Optional.empty(); - + private String tagline; - + private String thumb; - + private String art; - + private String theme; - + private Integer index; - + private Optional leafCount = Optional.empty(); - + private Optional viewedLeafCount = Optional.empty(); - + private Integer childCount; - + private Integer seasonCount; - + private Integer duration; - + private Optional originallyAvailableAt = Optional.empty(); - + private Long addedAt; - + private Optional updatedAt = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional chapterSource = Optional.empty(); - + private Optional primaryExtraKey = Optional.empty(); - + private Optional originalTitle = Optional.empty(); - + private Optional parentRatingKey = Optional.empty(); - + private Optional grandparentRatingKey = Optional.empty(); - + private Optional parentGuid = Optional.empty(); - + private Optional grandparentGuid = Optional.empty(); - + private Optional grandparentSlug = Optional.empty(); - + private Optional grandparentKey = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional grandparentTitle = Optional.empty(); - + private Optional grandparentThumb = Optional.empty(); - + private Optional grandparentTheme = Optional.empty(); - + private Optional grandparentArt = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional parentThumb = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional viewOffset = Optional.empty(); - + private Optional skipCount = Optional.empty(); - + private Optional subtype = Optional.empty(); - + private Optional lastRatedAt = Optional.empty(); - + private Optional createdAtAccuracy = Optional.empty(); - + private Optional createdAtTZOffset = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional userRating = Optional.empty(); - + private Optional> image = Optional.empty(); - + private Optional ultraBlurColors = Optional.empty(); - + private Optional> guids = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Optional> collection = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -2403,6 +2439,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The unique key for the media item. */ @@ -2412,6 +2449,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The globally unique identifier for the media item. */ @@ -2421,6 +2459,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * A URL‐friendly version of the media title. */ @@ -2430,6 +2469,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The studio that produced the media item. */ @@ -2448,12 +2488,14 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder type(GetLibrarySectionsAllLibraryType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + /** * The title of the media item. */ @@ -2463,6 +2505,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The sort title used for ordering media items. */ @@ -2472,6 +2515,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The content rating for the media item. */ @@ -2490,6 +2534,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * A synopsis of the media item. */ @@ -2499,6 +2544,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The critic rating for the media item. */ @@ -2508,6 +2554,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The audience rating for the media item. */ @@ -2517,6 +2564,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The release year of the media item. */ @@ -2535,6 +2583,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * A brief tagline for the media item. */ @@ -2544,6 +2593,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The thumbnail image URL for the media item. */ @@ -2553,6 +2603,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The art image URL for the media item. */ @@ -2562,6 +2613,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The theme URL for the media item. */ @@ -2571,6 +2623,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The index position of the media item. */ @@ -2580,6 +2633,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -2598,6 +2652,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -2616,6 +2671,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of child items associated with this media item. */ @@ -2625,6 +2681,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The total number of seasons (for TV shows). */ @@ -2634,6 +2691,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The duration of the media item in milliseconds. */ @@ -2643,6 +2701,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The original release date of the media item. */ @@ -2661,12 +2720,14 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder addedAt(long addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; return this; } + /** * Unix epoch datetime in seconds */ @@ -2685,6 +2746,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -2703,6 +2765,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -2721,6 +2784,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -2739,6 +2803,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -2757,6 +2822,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -2775,6 +2841,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -2793,6 +2860,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -2811,6 +2879,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -2829,6 +2898,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -2847,6 +2917,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -2865,6 +2936,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The key of the parent media item. */ @@ -2883,6 +2955,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -2901,6 +2974,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -2919,6 +2993,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -2937,6 +3012,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -2955,6 +3031,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The title of the parent media item. */ @@ -2973,6 +3050,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The index position of the parent media item. */ @@ -2991,6 +3069,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -3009,6 +3088,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The URL for the rating image. */ @@ -3027,6 +3107,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -3045,6 +3126,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -3063,6 +3145,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -3081,6 +3164,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -3099,6 +3183,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -3117,6 +3202,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -3135,6 +3221,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -3153,6 +3240,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -3171,6 +3259,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -3189,6 +3278,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder image(List image) { Utils.checkNotNull(image, "image"); this.image = Optional.ofNullable(image); @@ -3201,6 +3291,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder ultraBlurColors(GetLibrarySectionsAllUltraBlurColors ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = Optional.ofNullable(ultraBlurColors); @@ -3213,6 +3304,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder guids(List guids) { Utils.checkNotNull(guids, "guids"); this.guids = Optional.ofNullable(guids); @@ -3225,6 +3317,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -3237,6 +3330,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -3249,6 +3343,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -3261,6 +3356,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -3273,6 +3369,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -3285,6 +3382,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -3297,6 +3395,7 @@ public class GetLibrarySectionsAllMetadata { return this; } + public Builder collection(List collection) { Utils.checkNotNull(collection, "collection"); this.collection = Optional.ofNullable(collection); @@ -3308,73 +3407,33 @@ public class GetLibrarySectionsAllMetadata { this.collection = collection; return this; } - + public GetLibrarySectionsAllMetadata build() { + return new GetLibrarySectionsAllMetadata( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - titleSort, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - theme, - index, - leafCount, - viewedLeafCount, - childCount, - seasonCount, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - originalTitle, - parentRatingKey, - grandparentRatingKey, - parentGuid, - grandparentGuid, - grandparentSlug, - grandparentKey, - parentKey, - grandparentTitle, - grandparentThumb, - grandparentTheme, - grandparentArt, - parentTitle, - parentIndex, - parentThumb, - ratingImage, - viewCount, - viewOffset, - skipCount, - subtype, - lastRatedAt, - createdAtAccuracy, - createdAtTZOffset, - lastViewedAt, - userRating, - image, - ultraBlurColors, - guids, - media, - genre, - country, - director, - writer, - role, + ratingKey, key, guid, + slug, studio, type, + title, titleSort, contentRating, + summary, rating, audienceRating, + year, tagline, thumb, + art, theme, index, + leafCount, viewedLeafCount, childCount, + seasonCount, duration, originallyAvailableAt, + addedAt, updatedAt, audienceRatingImage, + chapterSource, primaryExtraKey, originalTitle, + parentRatingKey, grandparentRatingKey, parentGuid, + grandparentGuid, grandparentSlug, grandparentKey, + parentKey, grandparentTitle, grandparentThumb, + grandparentTheme, grandparentArt, parentTitle, + parentIndex, parentThumb, ratingImage, + viewCount, viewOffset, skipCount, + subtype, lastRatedAt, createdAtAccuracy, + createdAtTZOffset, lastViewedAt, userRating, + image, ultraBlurColors, guids, + media, genre, country, + director, writer, role, collection); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOperator.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOperator.java index 1adae8a3..9c34a7ce 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOperator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOperator.java @@ -9,13 +9,14 @@ 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 GetLibrarySectionsAllOperator { @JsonProperty("key") private String key; + @JsonProperty("title") private String title; @@ -39,9 +40,10 @@ public class GetLibrarySectionsAllOperator { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllOperator withKey(String key) { Utils.checkNotNull(key, "key"); @@ -55,7 +57,6 @@ public class GetLibrarySectionsAllOperator { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,15 +67,14 @@ public class GetLibrarySectionsAllOperator { } GetLibrarySectionsAllOperator other = (GetLibrarySectionsAllOperator) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - key, - title); + return Utils.enhancedHash( + key, title); } @Override @@ -83,33 +83,37 @@ public class GetLibrarySectionsAllOperator { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") 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 GetLibrarySectionsAllOperator build() { + return new GetLibrarySectionsAllOperator( - key, - title); + key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreaming.java index efb9fb7e..aacd0f55 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetLibrarySectionsAllOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetLibrarySectionsAllOptimizedForStreaming { return false; } GetLibrarySectionsAllOptimizedForStreaming other = (GetLibrarySectionsAllOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreaming1.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreaming1.java index 62357b81..db74c24f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreaming1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreaming1.java @@ -14,7 +14,7 @@ public enum GetLibrarySectionsAllOptimizedForStreaming1 { @JsonValue private final int value; - private GetLibrarySectionsAllOptimizedForStreaming1(int value) { + GetLibrarySectionsAllOptimizedForStreaming1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreamingLibrary1.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreamingLibrary1.java index b1145a95..8f9e9afe 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreamingLibrary1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllOptimizedForStreamingLibrary1.java @@ -14,7 +14,7 @@ public enum GetLibrarySectionsAllOptimizedForStreamingLibrary1 { @JsonValue private final int value; - private GetLibrarySectionsAllOptimizedForStreamingLibrary1(int value) { + GetLibrarySectionsAllOptimizedForStreamingLibrary1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllPart.java index b00a8234..1b5aa40b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllPart.java @@ -18,11 +18,10 @@ 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 GetLibrarySectionsAllPart { +public class GetLibrarySectionsAllPart { /** * Indicates if the part is accessible. */ @@ -49,6 +48,7 @@ public class GetLibrarySectionsAllPart { @JsonProperty("key") private String key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("indexes") private Optional indexes; @@ -72,6 +72,7 @@ public class GetLibrarySectionsAllPart { @JsonProperty("size") private long size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("packetLength") private Optional packetLength; @@ -97,6 +98,7 @@ public class GetLibrarySectionsAllPart { @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; @@ -108,6 +110,7 @@ public class GetLibrarySectionsAllPart { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasThumbnail") private Optional hasThumbnail; @@ -176,7 +179,12 @@ public class GetLibrarySectionsAllPart { String key, String file, long size) { - this(Optional.empty(), Optional.empty(), id, key, Optional.empty(), Optional.empty(), file, size, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), id, + key, Optional.empty(), Optional.empty(), + file, size, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -298,9 +306,10 @@ public class GetLibrarySectionsAllPart { return (Optional>) stream; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Indicates if the part is accessible. @@ -311,6 +320,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Indicates if the part is accessible. */ @@ -329,6 +339,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Indicates if the part exists. */ @@ -362,6 +373,7 @@ public class GetLibrarySectionsAllPart { return this; } + public GetLibrarySectionsAllPart withIndexes(Optional indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = indexes; @@ -377,6 +389,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Duration of the part in milliseconds. */ @@ -410,6 +423,7 @@ public class GetLibrarySectionsAllPart { return this; } + public GetLibrarySectionsAllPart withPacketLength(Optional packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = packetLength; @@ -425,6 +439,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Container format of the part. */ @@ -443,6 +458,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Video profile for the part. */ @@ -461,6 +477,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -476,6 +493,7 @@ public class GetLibrarySectionsAllPart { return this; } + public GetLibrarySectionsAllPart withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -491,6 +509,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -506,6 +525,7 @@ public class GetLibrarySectionsAllPart { return this; } + public GetLibrarySectionsAllPart withHasThumbnail(Optional hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = hasThumbnail; @@ -521,6 +541,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * An array of streams for this part. */ @@ -530,7 +551,6 @@ public class GetLibrarySectionsAllPart { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -541,42 +561,32 @@ public class GetLibrarySectionsAllPart { } GetLibrarySectionsAllPart other = (GetLibrarySectionsAllPart) o; return - Objects.deepEquals(this.accessible, other.accessible) && - Objects.deepEquals(this.exists, other.exists) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.indexes, other.indexes) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.packetLength, other.packetLength) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.hasThumbnail, other.hasThumbnail) && - Objects.deepEquals(this.stream, other.stream); + Utils.enhancedDeepEquals(this.accessible, other.accessible) && + Utils.enhancedDeepEquals(this.exists, other.exists) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.indexes, other.indexes) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.packetLength, other.packetLength) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.hasThumbnail, other.hasThumbnail) && + Utils.enhancedDeepEquals(this.stream, other.stream); } @Override public int hashCode() { - return Objects.hash( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail, + return Utils.enhancedHash( + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail, stream); } @@ -600,45 +610,47 @@ public class GetLibrarySectionsAllPart { "hasThumbnail", hasThumbnail, "stream", stream); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional accessible = Optional.empty(); - + private Optional exists = Optional.empty(); - + private Long id; - + private String key; - + private Optional indexes = Optional.empty(); - + private Optional duration = Optional.empty(); - + private String file; - + private Long size; - + private Optional packetLength = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional hasThumbnail; - + private Optional> stream = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Indicates if the part is accessible. */ @@ -657,6 +669,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Indicates if the part exists. */ @@ -675,6 +688,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Unique part identifier. */ @@ -684,6 +698,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Key to access this part. */ @@ -693,6 +708,7 @@ public class GetLibrarySectionsAllPart { return this; } + public Builder indexes(String indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = Optional.ofNullable(indexes); @@ -705,6 +721,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Duration of the part in milliseconds. */ @@ -723,6 +740,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * File path for the part. */ @@ -732,6 +750,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * File size in bytes. */ @@ -741,6 +760,7 @@ public class GetLibrarySectionsAllPart { return this; } + public Builder packetLength(int packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = Optional.ofNullable(packetLength); @@ -753,6 +773,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Container format of the part. */ @@ -771,6 +792,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Video profile for the part. */ @@ -789,6 +811,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -807,6 +830,7 @@ public class GetLibrarySectionsAllPart { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -819,6 +843,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -837,6 +862,7 @@ public class GetLibrarySectionsAllPart { return this; } + public Builder hasThumbnail(GetLibrarySectionsAllHasThumbnail hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = Optional.ofNullable(hasThumbnail); @@ -849,6 +875,7 @@ public class GetLibrarySectionsAllPart { return this; } + /** * An array of streams for this part. */ @@ -866,30 +893,22 @@ public class GetLibrarySectionsAllPart { this.stream = stream; return this; } - + public GetLibrarySectionsAllPart build() { if (hasThumbnail == null) { hasThumbnail = _SINGLETON_VALUE_HasThumbnail.value(); } + return new GetLibrarySectionsAllPart( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail, + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail, stream); } + private static final LazySingletonValue> _SINGLETON_VALUE_HasThumbnail = new LazySingletonValue<>( "hasThumbnail", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllQueryParamIncludeMeta.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllQueryParamIncludeMeta.java index cb02843a..b4bca46f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllQueryParamIncludeMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllQueryParamIncludeMeta.java @@ -19,7 +19,7 @@ public enum GetLibrarySectionsAllQueryParamIncludeMeta { @JsonValue private final int value; - private GetLibrarySectionsAllQueryParamIncludeMeta(int value) { + GetLibrarySectionsAllQueryParamIncludeMeta(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRequest.java index 8f5553e4..4f1eabc4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRequest.java @@ -13,11 +13,10 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetLibrarySectionsAllRequest { +public class GetLibrarySectionsAllRequest { /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -48,12 +47,15 @@ public class GetLibrarySectionsAllRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids") private Optional includeGuids; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeAdvanced") private Optional includeAdvanced; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeCollections") private Optional includeCollections; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeExternalMedia") private Optional includeExternalMedia; @@ -107,7 +109,9 @@ public class GetLibrarySectionsAllRequest { public GetLibrarySectionsAllRequest( int sectionKey, GetLibrarySectionsAllQueryParamType type) { - this(sectionKey, type, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(sectionKey, type, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -188,9 +192,10 @@ public class GetLibrarySectionsAllRequest { return xPlexContainerSize; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique key of the Plex library. @@ -225,6 +230,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * Adds the Meta object to the response */ @@ -243,6 +249,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * Adds the Guid object to the response */ @@ -258,6 +265,7 @@ public class GetLibrarySectionsAllRequest { return this; } + public GetLibrarySectionsAllRequest withIncludeAdvanced(Optional includeAdvanced) { Utils.checkNotNull(includeAdvanced, "includeAdvanced"); this.includeAdvanced = includeAdvanced; @@ -270,6 +278,7 @@ public class GetLibrarySectionsAllRequest { return this; } + public GetLibrarySectionsAllRequest withIncludeCollections(Optional includeCollections) { Utils.checkNotNull(includeCollections, "includeCollections"); this.includeCollections = includeCollections; @@ -282,6 +291,7 @@ public class GetLibrarySectionsAllRequest { return this; } + public GetLibrarySectionsAllRequest withIncludeExternalMedia(Optional includeExternalMedia) { Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); this.includeExternalMedia = includeExternalMedia; @@ -299,6 +309,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -321,6 +332,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -332,7 +344,6 @@ public class GetLibrarySectionsAllRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -343,29 +354,23 @@ public class GetLibrarySectionsAllRequest { } GetLibrarySectionsAllRequest other = (GetLibrarySectionsAllRequest) o; return - Objects.deepEquals(this.sectionKey, other.sectionKey) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.includeMeta, other.includeMeta) && - Objects.deepEquals(this.includeGuids, other.includeGuids) && - Objects.deepEquals(this.includeAdvanced, other.includeAdvanced) && - Objects.deepEquals(this.includeCollections, other.includeCollections) && - Objects.deepEquals(this.includeExternalMedia, other.includeExternalMedia) && - Objects.deepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && - Objects.deepEquals(this.xPlexContainerSize, other.xPlexContainerSize); + Utils.enhancedDeepEquals(this.sectionKey, other.sectionKey) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.includeMeta, other.includeMeta) && + Utils.enhancedDeepEquals(this.includeGuids, other.includeGuids) && + Utils.enhancedDeepEquals(this.includeAdvanced, other.includeAdvanced) && + Utils.enhancedDeepEquals(this.includeCollections, other.includeCollections) && + Utils.enhancedDeepEquals(this.includeExternalMedia, other.includeExternalMedia) && + Utils.enhancedDeepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && + Utils.enhancedDeepEquals(this.xPlexContainerSize, other.xPlexContainerSize); } @Override public int hashCode() { - return Objects.hash( - sectionKey, - type, - includeMeta, - includeGuids, - includeAdvanced, - includeCollections, - includeExternalMedia, - xPlexContainerStart, - xPlexContainerSize); + return Utils.enhancedHash( + sectionKey, type, includeMeta, + includeGuids, includeAdvanced, includeCollections, + includeExternalMedia, xPlexContainerStart, xPlexContainerSize); } @Override @@ -381,31 +386,33 @@ public class GetLibrarySectionsAllRequest { "xPlexContainerStart", xPlexContainerStart, "xPlexContainerSize", xPlexContainerSize); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer sectionKey; - + private GetLibrarySectionsAllQueryParamType type; - + private Optional includeMeta; - + private Optional includeGuids; - + private Optional includeAdvanced; - + private Optional includeCollections; - + private Optional includeExternalMedia; - + private Optional xPlexContainerStart; - + private Optional xPlexContainerSize; - + private Builder() { // force use of static builder() method } + /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -416,6 +423,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * The type of media to retrieve or filter by. * 1 = movie @@ -430,6 +438,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * Adds the Meta object to the response */ @@ -448,6 +457,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * Adds the Guid object to the response */ @@ -466,6 +476,7 @@ public class GetLibrarySectionsAllRequest { return this; } + public Builder includeAdvanced(IncludeAdvanced includeAdvanced) { Utils.checkNotNull(includeAdvanced, "includeAdvanced"); this.includeAdvanced = Optional.ofNullable(includeAdvanced); @@ -478,6 +489,7 @@ public class GetLibrarySectionsAllRequest { return this; } + public Builder includeCollections(QueryParamIncludeCollections includeCollections) { Utils.checkNotNull(includeCollections, "includeCollections"); this.includeCollections = Optional.ofNullable(includeCollections); @@ -490,6 +502,7 @@ public class GetLibrarySectionsAllRequest { return this; } + public Builder includeExternalMedia(QueryParamIncludeExternalMedia includeExternalMedia) { Utils.checkNotNull(includeExternalMedia, "includeExternalMedia"); this.includeExternalMedia = Optional.ofNullable(includeExternalMedia); @@ -502,6 +515,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -524,6 +538,7 @@ public class GetLibrarySectionsAllRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -545,7 +560,7 @@ public class GetLibrarySectionsAllRequest { this.xPlexContainerSize = xPlexContainerSize; return this; } - + public GetLibrarySectionsAllRequest build() { if (includeMeta == null) { includeMeta = _SINGLETON_VALUE_IncludeMeta.value(); @@ -568,18 +583,14 @@ public class GetLibrarySectionsAllRequest { if (xPlexContainerSize == null) { xPlexContainerSize = _SINGLETON_VALUE_XPlexContainerSize.value(); } + return new GetLibrarySectionsAllRequest( - sectionKey, - type, - includeMeta, - includeGuids, - includeAdvanced, - includeCollections, - includeExternalMedia, - xPlexContainerStart, - xPlexContainerSize); + sectionKey, type, includeMeta, + includeGuids, includeAdvanced, includeCollections, + includeExternalMedia, xPlexContainerStart, xPlexContainerSize); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeMeta = new LazySingletonValue<>( "includeMeta", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRequestBuilder.java index 62033ad8..0e587603 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetLibrarySectionsAll; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetLibrarySectionsAllRequestBuilder { private GetLibrarySectionsAllRequest request; - private final SDKMethodInterfaces.MethodCallGetLibrarySectionsAll sdk; + private final SDKConfiguration sdkConfiguration; - public GetLibrarySectionsAllRequestBuilder(SDKMethodInterfaces.MethodCallGetLibrarySectionsAll sdk) { - this.sdk = sdk; + public GetLibrarySectionsAllRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetLibrarySectionsAllRequestBuilder request(GetLibrarySectionsAllRequest request) { @@ -22,8 +26,10 @@ public class GetLibrarySectionsAllRequestBuilder { } public GetLibrarySectionsAllResponse call() throws Exception { + + RequestOperation operation + = new GetLibrarySectionsAll.Sync(sdkConfiguration); - return sdk.getLibrarySectionsAll( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllResponse.java index 8b1c47e4..54975d79 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetLibrarySectionsAllResponse implements Response { +public class GetLibrarySectionsAllResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetLibrarySectionsAllResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetLibrarySectionsAllResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetLibrarySectionsAllResponse implements Response { return this; } + /** * Successful response containing media container data. */ @@ -143,7 +145,6 @@ public class GetLibrarySectionsAllResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetLibrarySectionsAllResponse implements Response { } GetLibrarySectionsAllResponse other = (GetLibrarySectionsAllResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetLibrarySectionsAllResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetLibrarySectionsAllResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetLibrarySectionsAllResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetLibrarySectionsAllResponse implements Response { return this; } + /** * Successful response containing media container data. */ @@ -236,13 +240,13 @@ public class GetLibrarySectionsAllResponse implements Response { this.object = object; return this; } - + public GetLibrarySectionsAllResponse build() { + return new GetLibrarySectionsAllResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllResponseBody.java index b2cd3626..508fe7a5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetLibrarySectionsAllResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllResponseBody withMediaContainer(GetLibrarySectionsAllMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetLibrarySectionsAllResponseBody { return this; } + public GetLibrarySectionsAllResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetLibrarySectionsAllResponseBody { } GetLibrarySectionsAllResponseBody other = (GetLibrarySectionsAllResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetLibrarySectionsAllResponseBody { return Utils.toString(GetLibrarySectionsAllResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetLibrarySectionsAllMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetLibrarySectionsAllResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetLibrarySectionsAllResponseBody build() { + return new GetLibrarySectionsAllResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRole.java index 55bfb231..d6ff30e2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllRole.java @@ -9,10 +9,9 @@ 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 GetLibrarySectionsAllRole { - /** * The display tag for the actor (typically the actor's name). */ @@ -34,9 +33,10 @@ public class GetLibrarySectionsAllRole { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The display tag for the actor (typically the actor's name). @@ -47,7 +47,6 @@ public class GetLibrarySectionsAllRole { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibrarySectionsAllRole { } GetLibrarySectionsAllRole other = (GetLibrarySectionsAllRole) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -72,15 +71,17 @@ public class GetLibrarySectionsAllRole { return Utils.toString(GetLibrarySectionsAllRole.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The display tag for the actor (typically the actor's name). */ @@ -89,10 +90,12 @@ public class GetLibrarySectionsAllRole { this.tag = tag; return this; } - + public GetLibrarySectionsAllRole build() { + return new GetLibrarySectionsAllRole( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllSort.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllSort.java index 61a52581..a6c174a8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllSort.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllSort.java @@ -15,15 +15,16 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; + public class GetLibrarySectionsAllSort { @JsonInclude(Include.NON_ABSENT) @JsonProperty("default") private Optional default_; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("active") private Optional active; @@ -42,17 +43,21 @@ public class GetLibrarySectionsAllSort { @JsonProperty("defaultDirection") private Optional 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; @@ -87,7 +92,9 @@ public class GetLibrarySectionsAllSort { public GetLibrarySectionsAllSort( String key, String title) { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), key, title); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + key, title); } @JsonIgnore @@ -138,9 +145,10 @@ public class GetLibrarySectionsAllSort { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllSort withDefault(String default_) { Utils.checkNotNull(default_, "default_"); @@ -148,6 +156,7 @@ public class GetLibrarySectionsAllSort { return this; } + public GetLibrarySectionsAllSort withDefault(Optional default_) { Utils.checkNotNull(default_, "default_"); this.default_ = default_; @@ -160,6 +169,7 @@ public class GetLibrarySectionsAllSort { return this; } + public GetLibrarySectionsAllSort withActive(Optional active) { Utils.checkNotNull(active, "active"); this.active = active; @@ -175,6 +185,7 @@ public class GetLibrarySectionsAllSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -193,6 +204,7 @@ public class GetLibrarySectionsAllSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -208,6 +220,7 @@ public class GetLibrarySectionsAllSort { return this; } + public GetLibrarySectionsAllSort withDescKey(Optional descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = descKey; @@ -220,6 +233,7 @@ public class GetLibrarySectionsAllSort { return this; } + public GetLibrarySectionsAllSort withFirstCharacterKey(Optional firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = firstCharacterKey; @@ -238,7 +252,6 @@ public class GetLibrarySectionsAllSort { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -249,27 +262,22 @@ public class GetLibrarySectionsAllSort { } GetLibrarySectionsAllSort other = (GetLibrarySectionsAllSort) o; return - Objects.deepEquals(this.default_, other.default_) && - Objects.deepEquals(this.active, other.active) && - Objects.deepEquals(this.activeDirection, other.activeDirection) && - 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); + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.activeDirection, other.activeDirection) && + Utils.enhancedDeepEquals(this.defaultDirection, other.defaultDirection) && + Utils.enhancedDeepEquals(this.descKey, other.descKey) && + Utils.enhancedDeepEquals(this.firstCharacterKey, other.firstCharacterKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - default_, - active, - activeDirection, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + return Utils.enhancedHash( + default_, active, activeDirection, + defaultDirection, descKey, firstCharacterKey, + key, title); } @Override @@ -284,29 +292,31 @@ public class GetLibrarySectionsAllSort { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional default_ = Optional.empty(); - + private Optional active = Optional.empty(); - + private Optional activeDirection; - + private Optional 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_); @@ -319,6 +329,7 @@ public class GetLibrarySectionsAllSort { return this; } + public Builder active(boolean active) { Utils.checkNotNull(active, "active"); this.active = Optional.ofNullable(active); @@ -331,6 +342,7 @@ public class GetLibrarySectionsAllSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -349,6 +361,7 @@ public class GetLibrarySectionsAllSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -367,6 +380,7 @@ public class GetLibrarySectionsAllSort { return this; } + public Builder descKey(String descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = Optional.ofNullable(descKey); @@ -379,6 +393,7 @@ public class GetLibrarySectionsAllSort { return this; } + public Builder firstCharacterKey(String firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = Optional.ofNullable(firstCharacterKey); @@ -391,18 +406,20 @@ public class GetLibrarySectionsAllSort { 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 GetLibrarySectionsAllSort build() { if (activeDirection == null) { activeDirection = _SINGLETON_VALUE_ActiveDirection.value(); @@ -410,17 +427,14 @@ public class GetLibrarySectionsAllSort { if (defaultDirection == null) { defaultDirection = _SINGLETON_VALUE_DefaultDirection.value(); } + return new GetLibrarySectionsAllSort( - default_, - active, - activeDirection, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + default_, active, activeDirection, + defaultDirection, descKey, firstCharacterKey, + key, title); } + private static final LazySingletonValue> _SINGLETON_VALUE_ActiveDirection = new LazySingletonValue<>( "activeDirection", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllStream.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllStream.java index 3fe32634..47d4e674 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllStream.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllStream.java @@ -17,11 +17,10 @@ import java.lang.Integer; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetLibrarySectionsAllStream { +public class GetLibrarySectionsAllStream { /** * Unique stream identifier. */ @@ -190,6 +189,7 @@ public class GetLibrarySectionsAllStream { @JsonProperty("codedWidth") private Optional codedWidth; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("closedCaptions") private Optional closedCaptions; @@ -257,6 +257,7 @@ public class GetLibrarySectionsAllStream { @JsonProperty("original") private Optional original; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasScalingMatrix") private Optional hasScalingMatrix; @@ -268,10 +269,12 @@ public class GetLibrarySectionsAllStream { @JsonProperty("profile") private Optional profile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("scanType") private Optional scanType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("embeddedInVideo") private Optional embeddedInVideo; @@ -309,6 +312,7 @@ public class GetLibrarySectionsAllStream { @JsonProperty("selected") private Optional selected; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("forced") private Optional forced; @@ -522,7 +526,23 @@ public class GetLibrarySectionsAllStream { String codec, String displayTitle, String extendedDisplayTitle) { - this(id, Optional.empty(), Optional.empty(), codec, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(id, Optional.empty(), Optional.empty(), + codec, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + displayTitle, extendedDisplayTitle, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } /** @@ -921,9 +941,10 @@ public class GetLibrarySectionsAllStream { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique stream identifier. @@ -943,6 +964,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Format of the stream (e.g., srt). */ @@ -961,6 +983,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if this stream is default. */ @@ -988,6 +1011,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Index of the stream. */ @@ -1006,6 +1030,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Bitrate of the stream. */ @@ -1024,6 +1049,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Language of the stream. */ @@ -1042,6 +1068,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Language tag (e.g., en). */ @@ -1060,6 +1087,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * ISO language code. */ @@ -1078,6 +1106,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates whether header compression is enabled. */ @@ -1096,6 +1125,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Dolby Vision BL compatibility ID. */ @@ -1114,6 +1144,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if Dolby Vision BL is present. */ @@ -1132,6 +1163,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if Dolby Vision EL is present. */ @@ -1150,6 +1182,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Dolby Vision level. */ @@ -1168,6 +1201,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if Dolby Vision is present. */ @@ -1186,6 +1220,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Dolby Vision profile. */ @@ -1204,6 +1239,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if Dolby Vision RPU is present. */ @@ -1222,6 +1258,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Dolby Vision version. */ @@ -1240,6 +1277,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Bit depth of the video stream. */ @@ -1258,6 +1296,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Chroma sample location. */ @@ -1276,6 +1315,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Chroma subsampling format. */ @@ -1294,6 +1334,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Coded video height. */ @@ -1312,6 +1353,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Coded video width. */ @@ -1327,6 +1369,7 @@ public class GetLibrarySectionsAllStream { return this; } + public GetLibrarySectionsAllStream withClosedCaptions(Optional closedCaptions) { Utils.checkNotNull(closedCaptions, "closedCaptions"); this.closedCaptions = closedCaptions; @@ -1342,6 +1385,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Color primaries used. */ @@ -1360,6 +1404,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Color range (e.g., tv). */ @@ -1378,6 +1423,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Color space. */ @@ -1396,6 +1442,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Color transfer characteristics. */ @@ -1414,6 +1461,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Frame rate of the stream. */ @@ -1432,6 +1480,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Key to access this stream part. */ @@ -1450,6 +1499,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Height of the video stream. */ @@ -1468,6 +1518,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Video level. */ @@ -1486,6 +1537,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if this is the original stream. */ @@ -1501,6 +1553,7 @@ public class GetLibrarySectionsAllStream { return this; } + public GetLibrarySectionsAllStream withHasScalingMatrix(Optional hasScalingMatrix) { Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); this.hasScalingMatrix = hasScalingMatrix; @@ -1516,6 +1569,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Video profile. */ @@ -1531,6 +1585,7 @@ public class GetLibrarySectionsAllStream { return this; } + public GetLibrarySectionsAllStream withScanType(Optional scanType) { Utils.checkNotNull(scanType, "scanType"); this.scanType = scanType; @@ -1543,6 +1598,7 @@ public class GetLibrarySectionsAllStream { return this; } + public GetLibrarySectionsAllStream withEmbeddedInVideo(Optional embeddedInVideo) { Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); this.embeddedInVideo = embeddedInVideo; @@ -1558,6 +1614,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Number of reference frames. */ @@ -1576,6 +1633,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Width of the video stream. */ @@ -1612,6 +1670,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if this stream is selected (applicable for audio streams). */ @@ -1627,6 +1686,7 @@ public class GetLibrarySectionsAllStream { return this; } + public GetLibrarySectionsAllStream withForced(Optional forced) { Utils.checkNotNull(forced, "forced"); this.forced = forced; @@ -1642,6 +1702,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Number of audio channels (for audio streams). */ @@ -1660,6 +1721,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Audio channel layout. */ @@ -1678,6 +1740,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Sampling rate for the audio stream. */ @@ -1696,6 +1759,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if the stream can auto-sync. */ @@ -1714,6 +1778,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if the stream is for the hearing impaired. */ @@ -1732,6 +1797,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if the stream is a dub. */ @@ -1750,6 +1816,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Optional title for the stream (e.g., language variant). */ @@ -1759,7 +1826,6 @@ public class GetLibrarySectionsAllStream { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1770,113 +1836,79 @@ public class GetLibrarySectionsAllStream { } GetLibrarySectionsAllStream other = (GetLibrarySectionsAllStream) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.streamType, other.streamType) && - Objects.deepEquals(this.format, other.format) && - Objects.deepEquals(this.default_, other.default_) && - Objects.deepEquals(this.codec, other.codec) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.language, other.language) && - Objects.deepEquals(this.languageTag, other.languageTag) && - Objects.deepEquals(this.languageCode, other.languageCode) && - Objects.deepEquals(this.headerCompression, other.headerCompression) && - Objects.deepEquals(this.doviblCompatID, other.doviblCompatID) && - Objects.deepEquals(this.doviblPresent, other.doviblPresent) && - Objects.deepEquals(this.dovielPresent, other.dovielPresent) && - Objects.deepEquals(this.doviLevel, other.doviLevel) && - Objects.deepEquals(this.doviPresent, other.doviPresent) && - Objects.deepEquals(this.doviProfile, other.doviProfile) && - Objects.deepEquals(this.dovirpuPresent, other.dovirpuPresent) && - Objects.deepEquals(this.doviVersion, other.doviVersion) && - Objects.deepEquals(this.bitDepth, other.bitDepth) && - Objects.deepEquals(this.chromaLocation, other.chromaLocation) && - Objects.deepEquals(this.chromaSubsampling, other.chromaSubsampling) && - Objects.deepEquals(this.codedHeight, other.codedHeight) && - Objects.deepEquals(this.codedWidth, other.codedWidth) && - Objects.deepEquals(this.closedCaptions, other.closedCaptions) && - Objects.deepEquals(this.colorPrimaries, other.colorPrimaries) && - Objects.deepEquals(this.colorRange, other.colorRange) && - Objects.deepEquals(this.colorSpace, other.colorSpace) && - Objects.deepEquals(this.colorTrc, other.colorTrc) && - Objects.deepEquals(this.frameRate, other.frameRate) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.level, other.level) && - Objects.deepEquals(this.original, other.original) && - Objects.deepEquals(this.hasScalingMatrix, other.hasScalingMatrix) && - Objects.deepEquals(this.profile, other.profile) && - Objects.deepEquals(this.scanType, other.scanType) && - Objects.deepEquals(this.embeddedInVideo, other.embeddedInVideo) && - Objects.deepEquals(this.refFrames, other.refFrames) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.displayTitle, other.displayTitle) && - Objects.deepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && - Objects.deepEquals(this.selected, other.selected) && - Objects.deepEquals(this.forced, other.forced) && - Objects.deepEquals(this.channels, other.channels) && - Objects.deepEquals(this.audioChannelLayout, other.audioChannelLayout) && - Objects.deepEquals(this.samplingRate, other.samplingRate) && - Objects.deepEquals(this.canAutoSync, other.canAutoSync) && - Objects.deepEquals(this.hearingImpaired, other.hearingImpaired) && - Objects.deepEquals(this.dub, other.dub) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.streamType, other.streamType) && + Utils.enhancedDeepEquals(this.format, other.format) && + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.codec, other.codec) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.language, other.language) && + Utils.enhancedDeepEquals(this.languageTag, other.languageTag) && + Utils.enhancedDeepEquals(this.languageCode, other.languageCode) && + Utils.enhancedDeepEquals(this.headerCompression, other.headerCompression) && + Utils.enhancedDeepEquals(this.doviblCompatID, other.doviblCompatID) && + Utils.enhancedDeepEquals(this.doviblPresent, other.doviblPresent) && + Utils.enhancedDeepEquals(this.dovielPresent, other.dovielPresent) && + Utils.enhancedDeepEquals(this.doviLevel, other.doviLevel) && + Utils.enhancedDeepEquals(this.doviPresent, other.doviPresent) && + Utils.enhancedDeepEquals(this.doviProfile, other.doviProfile) && + Utils.enhancedDeepEquals(this.dovirpuPresent, other.dovirpuPresent) && + Utils.enhancedDeepEquals(this.doviVersion, other.doviVersion) && + Utils.enhancedDeepEquals(this.bitDepth, other.bitDepth) && + Utils.enhancedDeepEquals(this.chromaLocation, other.chromaLocation) && + Utils.enhancedDeepEquals(this.chromaSubsampling, other.chromaSubsampling) && + Utils.enhancedDeepEquals(this.codedHeight, other.codedHeight) && + Utils.enhancedDeepEquals(this.codedWidth, other.codedWidth) && + Utils.enhancedDeepEquals(this.closedCaptions, other.closedCaptions) && + Utils.enhancedDeepEquals(this.colorPrimaries, other.colorPrimaries) && + Utils.enhancedDeepEquals(this.colorRange, other.colorRange) && + Utils.enhancedDeepEquals(this.colorSpace, other.colorSpace) && + Utils.enhancedDeepEquals(this.colorTrc, other.colorTrc) && + Utils.enhancedDeepEquals(this.frameRate, other.frameRate) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.level, other.level) && + Utils.enhancedDeepEquals(this.original, other.original) && + Utils.enhancedDeepEquals(this.hasScalingMatrix, other.hasScalingMatrix) && + Utils.enhancedDeepEquals(this.profile, other.profile) && + Utils.enhancedDeepEquals(this.scanType, other.scanType) && + Utils.enhancedDeepEquals(this.embeddedInVideo, other.embeddedInVideo) && + Utils.enhancedDeepEquals(this.refFrames, other.refFrames) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.displayTitle, other.displayTitle) && + Utils.enhancedDeepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && + Utils.enhancedDeepEquals(this.selected, other.selected) && + Utils.enhancedDeepEquals(this.forced, other.forced) && + Utils.enhancedDeepEquals(this.channels, other.channels) && + Utils.enhancedDeepEquals(this.audioChannelLayout, other.audioChannelLayout) && + Utils.enhancedDeepEquals(this.samplingRate, other.samplingRate) && + Utils.enhancedDeepEquals(this.canAutoSync, other.canAutoSync) && + Utils.enhancedDeepEquals(this.hearingImpaired, other.hearingImpaired) && + Utils.enhancedDeepEquals(this.dub, other.dub) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - id, - streamType, - format, - default_, - codec, - index, - bitrate, - language, - languageTag, - languageCode, - headerCompression, - doviblCompatID, - doviblPresent, - dovielPresent, - doviLevel, - doviPresent, - doviProfile, - dovirpuPresent, - doviVersion, - bitDepth, - chromaLocation, - chromaSubsampling, - codedHeight, - codedWidth, - closedCaptions, - colorPrimaries, - colorRange, - colorSpace, - colorTrc, - frameRate, - key, - height, - level, - original, - hasScalingMatrix, - profile, - scanType, - embeddedInVideo, - refFrames, - width, - displayTitle, - extendedDisplayTitle, - selected, - forced, - channels, - audioChannelLayout, - samplingRate, - canAutoSync, - hearingImpaired, - dub, - title); + return Utils.enhancedHash( + id, streamType, format, + default_, codec, index, + bitrate, language, languageTag, + languageCode, headerCompression, doviblCompatID, + doviblPresent, dovielPresent, doviLevel, + doviPresent, doviProfile, dovirpuPresent, + doviVersion, bitDepth, chromaLocation, + chromaSubsampling, codedHeight, codedWidth, + closedCaptions, colorPrimaries, colorRange, + colorSpace, colorTrc, frameRate, + key, height, level, + original, hasScalingMatrix, profile, + scanType, embeddedInVideo, refFrames, + width, displayTitle, extendedDisplayTitle, + selected, forced, channels, + audioChannelLayout, samplingRate, canAutoSync, + hearingImpaired, dub, title); } @Override @@ -1934,113 +1966,115 @@ public class GetLibrarySectionsAllStream { "dub", dub, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional format = Optional.empty(); - + private Optional default_ = Optional.empty(); - + private String codec; - + private Optional index = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional language = Optional.empty(); - + private Optional languageTag = Optional.empty(); - + private Optional languageCode = Optional.empty(); - + private Optional headerCompression = Optional.empty(); - + private Optional doviblCompatID = Optional.empty(); - + private Optional doviblPresent = Optional.empty(); - + private Optional dovielPresent = Optional.empty(); - + private Optional doviLevel = Optional.empty(); - + private Optional doviPresent = Optional.empty(); - + private Optional doviProfile = Optional.empty(); - + private Optional dovirpuPresent = Optional.empty(); - + private Optional doviVersion = Optional.empty(); - + private Optional bitDepth = Optional.empty(); - + private Optional chromaLocation = Optional.empty(); - + private Optional chromaSubsampling = Optional.empty(); - + private Optional codedHeight = Optional.empty(); - + private Optional codedWidth = Optional.empty(); - + private Optional closedCaptions = Optional.empty(); - + private Optional colorPrimaries = Optional.empty(); - + private Optional colorRange = Optional.empty(); - + private Optional colorSpace = Optional.empty(); - + private Optional colorTrc = Optional.empty(); - + private Optional frameRate = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional level = Optional.empty(); - + private Optional original = Optional.empty(); - + private Optional hasScalingMatrix = Optional.empty(); - + private Optional profile = Optional.empty(); - + private Optional scanType = Optional.empty(); - + private Optional embeddedInVideo = Optional.empty(); - + private Optional refFrames = Optional.empty(); - + private Optional width = Optional.empty(); - + private String displayTitle; - + private String extendedDisplayTitle; - + private Optional selected = Optional.empty(); - + private Optional forced = Optional.empty(); - + private Optional channels = Optional.empty(); - + private Optional audioChannelLayout = Optional.empty(); - + private Optional samplingRate = Optional.empty(); - + private Optional canAutoSync = Optional.empty(); - + private Optional hearingImpaired = Optional.empty(); - + private Optional dub = Optional.empty(); - + private Optional title = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique stream identifier. */ @@ -2050,6 +2084,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Format of the stream (e.g., srt). */ @@ -2068,6 +2103,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if this stream is default. */ @@ -2086,6 +2122,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Codec used by the stream. */ @@ -2095,6 +2132,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Index of the stream. */ @@ -2113,6 +2151,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Bitrate of the stream. */ @@ -2131,6 +2170,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Language of the stream. */ @@ -2149,6 +2189,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Language tag (e.g., en). */ @@ -2167,6 +2208,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * ISO language code. */ @@ -2185,6 +2227,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates whether header compression is enabled. */ @@ -2203,6 +2246,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Dolby Vision BL compatibility ID. */ @@ -2221,6 +2265,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if Dolby Vision BL is present. */ @@ -2239,6 +2284,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if Dolby Vision EL is present. */ @@ -2257,6 +2303,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Dolby Vision level. */ @@ -2275,6 +2322,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if Dolby Vision is present. */ @@ -2293,6 +2341,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Dolby Vision profile. */ @@ -2311,6 +2360,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if Dolby Vision RPU is present. */ @@ -2329,6 +2379,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Dolby Vision version. */ @@ -2347,6 +2398,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Bit depth of the video stream. */ @@ -2365,6 +2417,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Chroma sample location. */ @@ -2383,6 +2436,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Chroma subsampling format. */ @@ -2401,6 +2455,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Coded video height. */ @@ -2419,6 +2474,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Coded video width. */ @@ -2437,6 +2493,7 @@ public class GetLibrarySectionsAllStream { return this; } + public Builder closedCaptions(boolean closedCaptions) { Utils.checkNotNull(closedCaptions, "closedCaptions"); this.closedCaptions = Optional.ofNullable(closedCaptions); @@ -2449,6 +2506,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Color primaries used. */ @@ -2467,6 +2525,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Color range (e.g., tv). */ @@ -2485,6 +2544,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Color space. */ @@ -2503,6 +2563,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Color transfer characteristics. */ @@ -2521,6 +2582,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Frame rate of the stream. */ @@ -2539,6 +2601,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Key to access this stream part. */ @@ -2557,6 +2620,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Height of the video stream. */ @@ -2575,6 +2639,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Video level. */ @@ -2593,6 +2658,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if this is the original stream. */ @@ -2611,6 +2677,7 @@ public class GetLibrarySectionsAllStream { return this; } + public Builder hasScalingMatrix(boolean hasScalingMatrix) { Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); this.hasScalingMatrix = Optional.ofNullable(hasScalingMatrix); @@ -2623,6 +2690,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Video profile. */ @@ -2641,6 +2709,7 @@ public class GetLibrarySectionsAllStream { return this; } + public Builder scanType(String scanType) { Utils.checkNotNull(scanType, "scanType"); this.scanType = Optional.ofNullable(scanType); @@ -2653,6 +2722,7 @@ public class GetLibrarySectionsAllStream { return this; } + public Builder embeddedInVideo(String embeddedInVideo) { Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); this.embeddedInVideo = Optional.ofNullable(embeddedInVideo); @@ -2665,6 +2735,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Number of reference frames. */ @@ -2683,6 +2754,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Width of the video stream. */ @@ -2701,6 +2773,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Display title for the stream. */ @@ -2710,6 +2783,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Extended display title for the stream. */ @@ -2719,6 +2793,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if this stream is selected (applicable for audio streams). */ @@ -2737,6 +2812,7 @@ public class GetLibrarySectionsAllStream { return this; } + public Builder forced(boolean forced) { Utils.checkNotNull(forced, "forced"); this.forced = Optional.ofNullable(forced); @@ -2749,6 +2825,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Number of audio channels (for audio streams). */ @@ -2767,6 +2844,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Audio channel layout. */ @@ -2785,6 +2863,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Sampling rate for the audio stream. */ @@ -2803,6 +2882,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if the stream can auto-sync. */ @@ -2821,6 +2901,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if the stream is for the hearing impaired. */ @@ -2839,6 +2920,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Indicates if the stream is a dub. */ @@ -2857,6 +2939,7 @@ public class GetLibrarySectionsAllStream { return this; } + /** * Optional title for the stream (e.g., language variant). */ @@ -2874,61 +2957,30 @@ public class GetLibrarySectionsAllStream { this.title = title; return this; } - + public GetLibrarySectionsAllStream build() { + return new GetLibrarySectionsAllStream( - id, - format, - default_, - codec, - index, - bitrate, - language, - languageTag, - languageCode, - headerCompression, - doviblCompatID, - doviblPresent, - dovielPresent, - doviLevel, - doviPresent, - doviProfile, - dovirpuPresent, - doviVersion, - bitDepth, - chromaLocation, - chromaSubsampling, - codedHeight, - codedWidth, - closedCaptions, - colorPrimaries, - colorRange, - colorSpace, - colorTrc, - frameRate, - key, - height, - level, - original, - hasScalingMatrix, - profile, - scanType, - embeddedInVideo, - refFrames, - width, - displayTitle, - extendedDisplayTitle, - selected, - forced, - channels, - audioChannelLayout, - samplingRate, - canAutoSync, - hearingImpaired, - dub, - title); + id, format, default_, + codec, index, bitrate, + language, languageTag, languageCode, + headerCompression, doviblCompatID, doviblPresent, + dovielPresent, doviLevel, doviPresent, + doviProfile, dovirpuPresent, doviVersion, + bitDepth, chromaLocation, chromaSubsampling, + codedHeight, codedWidth, closedCaptions, + colorPrimaries, colorRange, colorSpace, + colorTrc, frameRate, key, + height, level, original, + hasScalingMatrix, profile, scanType, + embeddedInVideo, refFrames, width, + displayTitle, extendedDisplayTitle, selected, + forced, channels, audioChannelLayout, + samplingRate, canAutoSync, hearingImpaired, + dub, title); } + private static final LazySingletonValue _SINGLETON_VALUE_StreamType = new LazySingletonValue<>( "streamType", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllType.java index adb8ea6a..a5766a7a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllType.java @@ -14,35 +14,42 @@ 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 GetLibrarySectionsAllType { @JsonProperty("key") private String key; + @JsonProperty("type") private String type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtype") private Optional subtype; + @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; @@ -80,7 +87,9 @@ public class GetLibrarySectionsAllType { String type, String title, boolean active) { - this(key, type, Optional.empty(), title, active, Optional.empty(), Optional.empty(), Optional.empty()); + this(key, type, Optional.empty(), + title, active, Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -126,9 +135,10 @@ public class GetLibrarySectionsAllType { return (Optional>) field; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllType withKey(String key) { Utils.checkNotNull(key, "key"); @@ -148,6 +158,7 @@ public class GetLibrarySectionsAllType { return this; } + public GetLibrarySectionsAllType withSubtype(Optional subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = subtype; @@ -172,6 +183,7 @@ public class GetLibrarySectionsAllType { return this; } + public GetLibrarySectionsAllType withFilter(Optional> filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -184,6 +196,7 @@ public class GetLibrarySectionsAllType { return this; } + public GetLibrarySectionsAllType withSort(Optional> sort) { Utils.checkNotNull(sort, "sort"); this.sort = sort; @@ -196,13 +209,13 @@ public class GetLibrarySectionsAllType { return this; } + public GetLibrarySectionsAllType withField(Optional> field) { Utils.checkNotNull(field, "field"); this.field = field; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -213,27 +226,22 @@ public class GetLibrarySectionsAllType { } GetLibrarySectionsAllType other = (GetLibrarySectionsAllType) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.subtype, other.subtype) && - 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.field, other.field); } @Override public int hashCode() { - return Objects.hash( - key, - type, - subtype, - title, - active, - filter, - sort, - field); + return Utils.enhancedHash( + key, type, subtype, + title, active, filter, + sort, field); } @Override @@ -248,41 +256,45 @@ public class GetLibrarySectionsAllType { "sort", sort, "field", field); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String key; - + private String type; - + private Optional subtype = Optional.empty(); - + 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 subtype(String subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = Optional.ofNullable(subtype); @@ -295,18 +307,21 @@ public class GetLibrarySectionsAllType { 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); @@ -319,6 +334,7 @@ public class GetLibrarySectionsAllType { return this; } + public Builder sort(List sort) { Utils.checkNotNull(sort, "sort"); this.sort = Optional.ofNullable(sort); @@ -331,6 +347,7 @@ public class GetLibrarySectionsAllType { return this; } + public Builder field(List field) { Utils.checkNotNull(field, "field"); this.field = Optional.ofNullable(field); @@ -342,17 +359,14 @@ public class GetLibrarySectionsAllType { this.field = field; return this; } - + public GetLibrarySectionsAllType build() { + return new GetLibrarySectionsAllType( - key, - type, - subtype, - title, - active, - filter, - sort, - field); + key, type, subtype, + title, active, filter, + sort, field); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllUltraBlurColors.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllUltraBlurColors.java index 939dd740..3894d2c0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllUltraBlurColors.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllUltraBlurColors.java @@ -9,19 +9,22 @@ 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 GetLibrarySectionsAllUltraBlurColors { @JsonProperty("topLeft") private String topLeft; + @JsonProperty("topRight") private String topRight; + @JsonProperty("bottomRight") private String bottomRight; + @JsonProperty("bottomLeft") private String bottomLeft; @@ -61,9 +64,10 @@ public class GetLibrarySectionsAllUltraBlurColors { return bottomLeft; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetLibrarySectionsAllUltraBlurColors withTopLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); @@ -89,7 +93,6 @@ public class GetLibrarySectionsAllUltraBlurColors { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -100,18 +103,16 @@ public class GetLibrarySectionsAllUltraBlurColors { } GetLibrarySectionsAllUltraBlurColors other = (GetLibrarySectionsAllUltraBlurColors) o; return - Objects.deepEquals(this.topLeft, other.topLeft) && - Objects.deepEquals(this.topRight, other.topRight) && - Objects.deepEquals(this.bottomRight, other.bottomRight) && - Objects.deepEquals(this.bottomLeft, other.bottomLeft); + Utils.enhancedDeepEquals(this.topLeft, other.topLeft) && + Utils.enhancedDeepEquals(this.topRight, other.topRight) && + Utils.enhancedDeepEquals(this.bottomRight, other.bottomRight) && + Utils.enhancedDeepEquals(this.bottomLeft, other.bottomLeft); } @Override public int hashCode() { - return Objects.hash( - topLeft, - topRight, - bottomRight, + return Utils.enhancedHash( + topLeft, topRight, bottomRight, bottomLeft); } @@ -123,51 +124,56 @@ public class GetLibrarySectionsAllUltraBlurColors { "bottomRight", bottomRight, "bottomLeft", bottomLeft); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String topLeft; - + private String topRight; - + private String bottomRight; - + private String bottomLeft; - + private Builder() { // force use of static builder() method } + public Builder topLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); this.topLeft = topLeft; return this; } + public Builder topRight(String topRight) { Utils.checkNotNull(topRight, "topRight"); this.topRight = topRight; return this; } + public Builder bottomRight(String bottomRight) { Utils.checkNotNull(bottomRight, "bottomRight"); this.bottomRight = bottomRight; return this; } + public Builder bottomLeft(String bottomLeft) { Utils.checkNotNull(bottomLeft, "bottomLeft"); this.bottomLeft = bottomLeft; return this; } - + public GetLibrarySectionsAllUltraBlurColors build() { + return new GetLibrarySectionsAllUltraBlurColors( - topLeft, - topRight, - bottomRight, + topLeft, topRight, bottomRight, bottomLeft); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllWriter.java index 07456d75..32ca59cd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllWriter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetLibrarySectionsAllWriter.java @@ -9,10 +9,9 @@ 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 GetLibrarySectionsAllWriter { - /** * The role of Writer */ @@ -34,9 +33,10 @@ public class GetLibrarySectionsAllWriter { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The role of Writer @@ -47,7 +47,6 @@ public class GetLibrarySectionsAllWriter { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetLibrarySectionsAllWriter { } GetLibrarySectionsAllWriter other = (GetLibrarySectionsAllWriter) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -72,15 +71,17 @@ public class GetLibrarySectionsAllWriter { return Utils.toString(GetLibrarySectionsAllWriter.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The role of Writer */ @@ -89,10 +90,12 @@ public class GetLibrarySectionsAllWriter { this.tag = tag; return this; } - + public GetLibrarySectionsAllWriter build() { + return new GetLibrarySectionsAllWriter( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsMediaContainer.java index 06cec101..4d14ee63 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsMediaContainer.java @@ -12,10 +12,9 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; + public class GetMediaArtsMediaContainer { - /** * Number of media items returned in this response. */ @@ -40,6 +39,7 @@ public class GetMediaArtsMediaContainer { @JsonProperty("identifier") private String identifier; + @JsonProperty("Metadata") private List metadata; @@ -99,9 +99,10 @@ public class GetMediaArtsMediaContainer { return metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -145,7 +146,6 @@ public class GetMediaArtsMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -156,21 +156,18 @@ public class GetMediaArtsMediaContainer { } GetMediaArtsMediaContainer other = (GetMediaArtsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - mediaTagVersion, - mediaTagPrefix, - identifier, - metadata); + return Utils.enhancedHash( + size, mediaTagVersion, mediaTagPrefix, + identifier, metadata); } @Override @@ -182,23 +179,25 @@ public class GetMediaArtsMediaContainer { "identifier", identifier, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Long mediaTagVersion; - + private String mediaTagPrefix; - + private String identifier; - + private List metadata; - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -208,6 +207,7 @@ public class GetMediaArtsMediaContainer { return this; } + /** * The version number for media tags. */ @@ -217,6 +217,7 @@ public class GetMediaArtsMediaContainer { return this; } + /** * The prefix used for media tag resource paths. */ @@ -226,6 +227,7 @@ public class GetMediaArtsMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -235,19 +237,19 @@ public class GetMediaArtsMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - + public GetMediaArtsMediaContainer build() { + return new GetMediaArtsMediaContainer( - size, - mediaTagVersion, - mediaTagPrefix, - identifier, - metadata); + size, mediaTagVersion, mediaTagPrefix, + identifier, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsMetadata.java index 48742d10..071d29fd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsMetadata.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetMediaArtsMetadata { +public class GetMediaArtsMetadata { /** * The URL of the artwork. */ @@ -72,7 +71,8 @@ public class GetMediaArtsMetadata { String ratingKey, boolean selected, String thumb) { - this(key, Optional.empty(), ratingKey, selected, thumb); + this(key, Optional.empty(), ratingKey, + selected, thumb); } /** @@ -115,9 +115,10 @@ public class GetMediaArtsMetadata { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The URL of the artwork. @@ -137,6 +138,7 @@ public class GetMediaArtsMetadata { return this; } + /** * The provider of the artwork. */ @@ -173,7 +175,6 @@ public class GetMediaArtsMetadata { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,21 +185,18 @@ public class GetMediaArtsMetadata { } GetMediaArtsMetadata other = (GetMediaArtsMetadata) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.provider, other.provider) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.selected, other.selected) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.provider, other.provider) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.selected, other.selected) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - key, - provider, - ratingKey, - selected, - thumb); + return Utils.enhancedHash( + key, provider, ratingKey, + selected, thumb); } @Override @@ -210,23 +208,25 @@ public class GetMediaArtsMetadata { "selected", selected, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String key; - + private Optional provider = Optional.empty(); - + private String ratingKey; - + private Boolean selected; - + private String thumb; - + private Builder() { // force use of static builder() method } + /** * The URL of the artwork. */ @@ -236,6 +236,7 @@ public class GetMediaArtsMetadata { return this; } + /** * The provider of the artwork. */ @@ -254,6 +255,7 @@ public class GetMediaArtsMetadata { return this; } + /** * The URL of the artwork. */ @@ -263,6 +265,7 @@ public class GetMediaArtsMetadata { return this; } + /** * Whether this is the selected artwork. */ @@ -272,6 +275,7 @@ public class GetMediaArtsMetadata { return this; } + /** * The URL of the artwork thumbnail. */ @@ -280,14 +284,13 @@ public class GetMediaArtsMetadata { this.thumb = thumb; return this; } - + public GetMediaArtsMetadata build() { + return new GetMediaArtsMetadata( - key, - provider, - ratingKey, - selected, - thumb); + key, provider, ratingKey, + selected, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsRequest.java index 1599b70d..cd81ce38 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetMediaArtsRequest { - /** * the id of the library item to return the artwork of. */ @@ -35,9 +34,10 @@ public class GetMediaArtsRequest { return ratingKey; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the id of the library item to return the artwork of. @@ -48,7 +48,6 @@ public class GetMediaArtsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,12 +58,12 @@ public class GetMediaArtsRequest { } GetMediaArtsRequest other = (GetMediaArtsRequest) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ratingKey); } @@ -73,15 +72,17 @@ public class GetMediaArtsRequest { return Utils.toString(GetMediaArtsRequest.class, "ratingKey", ratingKey); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long ratingKey; - + private Builder() { // force use of static builder() method } + /** * the id of the library item to return the artwork of. */ @@ -90,10 +91,12 @@ public class GetMediaArtsRequest { this.ratingKey = ratingKey; return this; } - + public GetMediaArtsRequest build() { + return new GetMediaArtsRequest( ratingKey); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsRequestBuilder.java index d91d322c..ac138ff2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetMediaArts; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -10,10 +14,10 @@ import java.lang.Long; public class GetMediaArtsRequestBuilder { private Long ratingKey; - private final SDKMethodInterfaces.MethodCallGetMediaArts sdk; + private final SDKConfiguration sdkConfiguration; - public GetMediaArtsRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaArts sdk) { - this.sdk = sdk; + public GetMediaArtsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetMediaArtsRequestBuilder ratingKey(long ratingKey) { @@ -22,9 +26,20 @@ public class GetMediaArtsRequestBuilder { return this; } - public GetMediaArtsResponse call() throws Exception { - return sdk.getMediaArts( - ratingKey); + private GetMediaArtsRequest buildRequest() { + + GetMediaArtsRequest request = new GetMediaArtsRequest(ratingKey); + + return request; + } + + public GetMediaArtsResponse call() throws Exception { + + RequestOperation operation + = new GetMediaArts.Sync(sdkConfiguration); + GetMediaArtsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsResponse.java index f9bd7bdc..19f78d5d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetMediaArtsResponse implements Response { +public class GetMediaArtsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetMediaArtsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetMediaArtsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetMediaArtsResponse implements Response { return this; } + /** * The available background artwork for the library item. */ @@ -143,7 +145,6 @@ public class GetMediaArtsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetMediaArtsResponse implements Response { } GetMediaArtsResponse other = (GetMediaArtsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetMediaArtsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetMediaArtsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetMediaArtsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetMediaArtsResponse implements Response { return this; } + /** * The available background artwork for the library item. */ @@ -236,13 +240,13 @@ public class GetMediaArtsResponse implements Response { this.object = object; return this; } - + public GetMediaArtsResponse build() { + return new GetMediaArtsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsResponseBody.java index 2b72a9f7..55b449db 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaArtsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetMediaArtsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaArtsResponseBody withMediaContainer(GetMediaArtsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetMediaArtsResponseBody { return this; } + public GetMediaArtsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetMediaArtsResponseBody { } GetMediaArtsResponseBody other = (GetMediaArtsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetMediaArtsResponseBody { return Utils.toString(GetMediaArtsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetMediaArtsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetMediaArtsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetMediaArtsResponseBody build() { + return new GetMediaArtsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataAttributes.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataAttributes.java index 15a801fa..6c33e6e9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataAttributes.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataAttributes.java @@ -12,7 +12,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -21,7 +20,6 @@ import java.util.Optional; *

Attributes associated with the marker. */ public class GetMediaMetaDataAttributes { - /** * The identifier for the attributes. */ @@ -66,9 +64,10 @@ public class GetMediaMetaDataAttributes { return version; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The identifier for the attributes. @@ -88,6 +87,7 @@ public class GetMediaMetaDataAttributes { return this; } + /** * The version number of the marker attributes. */ @@ -97,7 +97,6 @@ public class GetMediaMetaDataAttributes { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,15 +107,14 @@ public class GetMediaMetaDataAttributes { } GetMediaMetaDataAttributes other = (GetMediaMetaDataAttributes) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.version, other.version); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.version, other.version); } @Override public int hashCode() { - return Objects.hash( - id, - version); + return Utils.enhancedHash( + id, version); } @Override @@ -125,17 +123,19 @@ public class GetMediaMetaDataAttributes { "id", id, "version", version); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional version = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The identifier for the attributes. */ @@ -145,6 +145,7 @@ public class GetMediaMetaDataAttributes { return this; } + /** * The version number of the marker attributes. */ @@ -162,11 +163,12 @@ public class GetMediaMetaDataAttributes { this.version = version; return this; } - + public GetMediaMetaDataAttributes build() { + return new GetMediaMetaDataAttributes( - id, - version); + id, version); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataChapter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataChapter.java index ccd28d89..34644a12 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataChapter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataChapter.java @@ -10,7 +10,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetMediaMetaDataChapter @@ -22,18 +21,23 @@ public class GetMediaMetaDataChapter { @JsonProperty("id") private long id; + @JsonProperty("filter") private String filter; + @JsonProperty("index") private long index; + @JsonProperty("startTimeOffset") private long startTimeOffset; + @JsonProperty("endTimeOffset") private long endTimeOffset; + @JsonProperty("thumb") private String thumb; @@ -89,9 +93,10 @@ public class GetMediaMetaDataChapter { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataChapter withId(long id) { Utils.checkNotNull(id, "id"); @@ -129,7 +134,6 @@ public class GetMediaMetaDataChapter { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -140,23 +144,19 @@ public class GetMediaMetaDataChapter { } GetMediaMetaDataChapter other = (GetMediaMetaDataChapter) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.startTimeOffset, other.startTimeOffset) && - Objects.deepEquals(this.endTimeOffset, other.endTimeOffset) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.startTimeOffset, other.startTimeOffset) && + Utils.enhancedDeepEquals(this.endTimeOffset, other.endTimeOffset) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - index, - startTimeOffset, - endTimeOffset, - thumb); + return Utils.enhancedHash( + id, filter, index, + startTimeOffset, endTimeOffset, thumb); } @Override @@ -169,69 +169,74 @@ public class GetMediaMetaDataChapter { "endTimeOffset", endTimeOffset, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String filter; - + private Long index; - + private Long startTimeOffset; - + private Long endTimeOffset; - + private String thumb; - + private Builder() { // force use of static builder() method } + public Builder id(long id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } + public Builder index(long index) { Utils.checkNotNull(index, "index"); this.index = index; return this; } + public Builder startTimeOffset(long startTimeOffset) { Utils.checkNotNull(startTimeOffset, "startTimeOffset"); this.startTimeOffset = startTimeOffset; return this; } + public Builder endTimeOffset(long endTimeOffset) { Utils.checkNotNull(endTimeOffset, "endTimeOffset"); this.endTimeOffset = endTimeOffset; return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } - + public GetMediaMetaDataChapter build() { + return new GetMediaMetaDataChapter( - id, - filter, - index, - startTimeOffset, - endTimeOffset, - thumb); + id, filter, index, + startTimeOffset, endTimeOffset, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataCountry.java index a48e0b6a..6729fda0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataCountry.java @@ -10,7 +10,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetMediaMetaDataCountry @@ -18,7 +17,6 @@ import java.util.Objects; *

The filter query string for country media items. */ public class GetMediaMetaDataCountry { - /** * The unique identifier for the country. * NOTE: This is different for each Plex server and is not globally unique. @@ -32,6 +30,7 @@ public class GetMediaMetaDataCountry { @JsonProperty("tag") private String tag; + @JsonProperty("filter") private String filter; @@ -70,9 +69,10 @@ public class GetMediaMetaDataCountry { return filter; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the country. @@ -99,7 +99,6 @@ public class GetMediaMetaDataCountry { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class GetMediaMetaDataCountry { } GetMediaMetaDataCountry other = (GetMediaMetaDataCountry) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.filter, other.filter); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.filter, other.filter); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - filter); + return Utils.enhancedHash( + id, tag, filter); } @Override @@ -130,19 +127,21 @@ public class GetMediaMetaDataCountry { "tag", tag, "filter", filter); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private String filter; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the country. * NOTE: This is different for each Plex server and is not globally unique. @@ -153,6 +152,7 @@ public class GetMediaMetaDataCountry { return this; } + /** * The country of origin of this media item */ @@ -162,17 +162,18 @@ public class GetMediaMetaDataCountry { return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } - + public GetMediaMetaDataCountry build() { + return new GetMediaMetaDataCountry( - id, - tag, - filter); + id, tag, filter); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataDirector.java index 1e67f8cd..6e7b2dff 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataDirector.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataDirector.java @@ -12,11 +12,10 @@ 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 GetMediaMetaDataDirector { +public class GetMediaMetaDataDirector { /** * Unique identifier for the director. */ @@ -72,7 +71,8 @@ public class GetMediaMetaDataDirector { String tag, String filter, String tagKey) { - this(id, tag, filter, tagKey, Optional.empty()); + this(id, tag, filter, + tagKey, Optional.empty()); } /** @@ -115,9 +115,10 @@ public class GetMediaMetaDataDirector { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the director. @@ -164,6 +165,7 @@ public class GetMediaMetaDataDirector { return this; } + /** * The absolute URL of the thumbnail image for the director. */ @@ -173,7 +175,6 @@ public class GetMediaMetaDataDirector { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,21 +185,18 @@ public class GetMediaMetaDataDirector { } GetMediaMetaDataDirector other = (GetMediaMetaDataDirector) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - filter, - tagKey, - thumb); + return Utils.enhancedHash( + id, tag, filter, + tagKey, thumb); } @Override @@ -210,23 +208,25 @@ public class GetMediaMetaDataDirector { "tagKey", tagKey, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private String filter; - + private String tagKey; - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the director. */ @@ -236,6 +236,7 @@ public class GetMediaMetaDataDirector { return this; } + /** * The role of Director */ @@ -245,6 +246,7 @@ public class GetMediaMetaDataDirector { return this; } + /** * The filter string used to query this director. */ @@ -254,6 +256,7 @@ public class GetMediaMetaDataDirector { return this; } + /** * A unique 24-character hexadecimal key associated with the director's tag, used for internal identification. */ @@ -263,6 +266,7 @@ public class GetMediaMetaDataDirector { return this; } + /** * The absolute URL of the thumbnail image for the director. */ @@ -280,14 +284,13 @@ public class GetMediaMetaDataDirector { this.thumb = thumb; return this; } - + public GetMediaMetaDataDirector build() { + return new GetMediaMetaDataDirector( - id, - tag, - filter, - tagKey, - thumb); + id, tag, filter, + tagKey, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataExtras.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataExtras.java index ea6365c4..505de32b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataExtras.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataExtras.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetMediaMetaDataExtras { +public class GetMediaMetaDataExtras { /** * The size of the extras. */ @@ -43,9 +42,10 @@ public class GetMediaMetaDataExtras { return size; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The size of the extras. @@ -56,6 +56,7 @@ public class GetMediaMetaDataExtras { return this; } + /** * The size of the extras. */ @@ -65,7 +66,6 @@ public class GetMediaMetaDataExtras { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,12 +76,12 @@ public class GetMediaMetaDataExtras { } GetMediaMetaDataExtras other = (GetMediaMetaDataExtras) o; return - Objects.deepEquals(this.size, other.size); + Utils.enhancedDeepEquals(this.size, other.size); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( size); } @@ -90,15 +90,17 @@ public class GetMediaMetaDataExtras { return Utils.toString(GetMediaMetaDataExtras.class, "size", size); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The size of the extras. */ @@ -116,10 +118,12 @@ public class GetMediaMetaDataExtras { this.size = size; return this; } - + public GetMediaMetaDataExtras build() { + return new GetMediaMetaDataExtras( size); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataGenre.java index f3a4f3f0..ffac8a4e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataGenre.java @@ -10,7 +10,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetMediaMetaDataGenre @@ -18,7 +17,6 @@ import java.util.Objects; *

The filter query string for similar items. */ public class GetMediaMetaDataGenre { - /** * The unique identifier for the genre. * NOTE: This is different for each Plex server and is not globally unique. @@ -32,6 +30,7 @@ public class GetMediaMetaDataGenre { @JsonProperty("tag") private String tag; + @JsonProperty("filter") private String filter; @@ -70,9 +69,10 @@ public class GetMediaMetaDataGenre { return filter; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the genre. @@ -99,7 +99,6 @@ public class GetMediaMetaDataGenre { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class GetMediaMetaDataGenre { } GetMediaMetaDataGenre other = (GetMediaMetaDataGenre) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.filter, other.filter); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.filter, other.filter); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - filter); + return Utils.enhancedHash( + id, tag, filter); } @Override @@ -130,19 +127,21 @@ public class GetMediaMetaDataGenre { "tag", tag, "filter", filter); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private String filter; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the genre. * NOTE: This is different for each Plex server and is not globally unique. @@ -153,6 +152,7 @@ public class GetMediaMetaDataGenre { return this; } + /** * The genre name of this media-item */ @@ -162,17 +162,18 @@ public class GetMediaMetaDataGenre { return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } - + public GetMediaMetaDataGenre build() { + return new GetMediaMetaDataGenre( - id, - tag, - filter); + id, tag, filter); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataGuids.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataGuids.java index aca5c4b4..5c31d639 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataGuids.java @@ -9,10 +9,9 @@ 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 GetMediaMetaDataGuids { - /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -34,9 +33,10 @@ public class GetMediaMetaDataGuids { return id; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// @@ -47,7 +47,6 @@ public class GetMediaMetaDataGuids { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetMediaMetaDataGuids { } GetMediaMetaDataGuids other = (GetMediaMetaDataGuids) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } @@ -72,15 +71,17 @@ public class GetMediaMetaDataGuids { return Utils.toString(GetMediaMetaDataGuids.class, "id", id); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String id; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -89,10 +90,12 @@ public class GetMediaMetaDataGuids { this.id = id; return this; } - + public GetMediaMetaDataGuids build() { + return new GetMediaMetaDataGuids( id); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataHasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataHasThumbnail.java index bfb7e644..82059c9e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataHasThumbnail.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataHasThumbnail.java @@ -20,7 +20,7 @@ public enum GetMediaMetaDataHasThumbnail { @JsonValue private final String value; - private GetMediaMetaDataHasThumbnail(String value) { + GetMediaMetaDataHasThumbnail(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataImage.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataImage.java index da81152b..aa0bd223 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataImage.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataImage.java @@ -9,16 +9,18 @@ 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 GetMediaMetaDataImage { @JsonProperty("alt") private String alt; + @JsonProperty("type") private GetMediaMetaDataLibraryType type; + @JsonProperty("url") private String url; @@ -50,9 +52,10 @@ public class GetMediaMetaDataImage { return url; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataImage withAlt(String alt) { Utils.checkNotNull(alt, "alt"); @@ -72,7 +75,6 @@ public class GetMediaMetaDataImage { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -83,17 +85,15 @@ public class GetMediaMetaDataImage { } GetMediaMetaDataImage other = (GetMediaMetaDataImage) o; return - Objects.deepEquals(this.alt, other.alt) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.alt, other.alt) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( - alt, - type, - url); + return Utils.enhancedHash( + alt, type, url); } @Override @@ -103,42 +103,46 @@ public class GetMediaMetaDataImage { "type", type, "url", url); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String alt; - + private GetMediaMetaDataLibraryType type; - + private String url; - + private Builder() { // force use of static builder() method } + public Builder alt(String alt) { Utils.checkNotNull(alt, "alt"); this.alt = alt; return this; } + public Builder type(GetMediaMetaDataLibraryType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder url(String url) { Utils.checkNotNull(url, "url"); this.url = url; return this; } - + public GetMediaMetaDataImage build() { + return new GetMediaMetaDataImage( - alt, - type, - url); + alt, type, url); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataLibraryOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataLibraryOptimizedForStreaming.java index 19a6e7e3..39e8092a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataLibraryOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataLibraryOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetMediaMetaDataLibraryOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetMediaMetaDataLibraryOptimizedForStreaming { return false; } GetMediaMetaDataLibraryOptimizedForStreaming other = (GetMediaMetaDataLibraryOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataLocation.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataLocation.java index 64f8c577..ab0b8521 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataLocation.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataLocation.java @@ -9,10 +9,9 @@ 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 GetMediaMetaDataLocation { - /** * The file path for the location. */ @@ -34,9 +33,10 @@ public class GetMediaMetaDataLocation { return path; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The file path for the location. @@ -47,7 +47,6 @@ public class GetMediaMetaDataLocation { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetMediaMetaDataLocation { } GetMediaMetaDataLocation other = (GetMediaMetaDataLocation) o; return - Objects.deepEquals(this.path, other.path); + Utils.enhancedDeepEquals(this.path, other.path); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( path); } @@ -72,15 +71,17 @@ public class GetMediaMetaDataLocation { return Utils.toString(GetMediaMetaDataLocation.class, "path", path); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String path; - + private Builder() { // force use of static builder() method } + /** * The file path for the location. */ @@ -89,10 +90,12 @@ public class GetMediaMetaDataLocation { this.path = path; return this; } - + public GetMediaMetaDataLocation build() { + return new GetMediaMetaDataLocation( path); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMarker.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMarker.java index f0467634..017e2d88 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMarker.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMarker.java @@ -14,7 +14,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -27,15 +26,19 @@ public class GetMediaMetaDataMarker { @JsonProperty("id") private long id; + @JsonProperty("type") private String type; + @JsonProperty("startTimeOffset") private long startTimeOffset; + @JsonProperty("endTimeOffset") private long endTimeOffset; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("final") private Optional final_; @@ -74,7 +77,8 @@ public class GetMediaMetaDataMarker { String type, long startTimeOffset, long endTimeOffset) { - this(id, type, startTimeOffset, endTimeOffset, Optional.empty(), Optional.empty()); + this(id, type, startTimeOffset, + endTimeOffset, Optional.empty(), Optional.empty()); } @JsonIgnore @@ -111,9 +115,10 @@ public class GetMediaMetaDataMarker { return (Optional) attributes; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataMarker withId(long id) { Utils.checkNotNull(id, "id"); @@ -145,6 +150,7 @@ public class GetMediaMetaDataMarker { return this; } + public GetMediaMetaDataMarker withFinal(Optional final_) { Utils.checkNotNull(final_, "final_"); this.final_ = final_; @@ -160,6 +166,7 @@ public class GetMediaMetaDataMarker { return this; } + /** * Attributes associated with the marker. */ @@ -169,7 +176,6 @@ public class GetMediaMetaDataMarker { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,23 +186,19 @@ public class GetMediaMetaDataMarker { } GetMediaMetaDataMarker other = (GetMediaMetaDataMarker) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.startTimeOffset, other.startTimeOffset) && - Objects.deepEquals(this.endTimeOffset, other.endTimeOffset) && - Objects.deepEquals(this.final_, other.final_) && - Objects.deepEquals(this.attributes, other.attributes); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.startTimeOffset, other.startTimeOffset) && + Utils.enhancedDeepEquals(this.endTimeOffset, other.endTimeOffset) && + Utils.enhancedDeepEquals(this.final_, other.final_) && + Utils.enhancedDeepEquals(this.attributes, other.attributes); } @Override public int hashCode() { - return Objects.hash( - id, - type, - startTimeOffset, - endTimeOffset, - final_, - attributes); + return Utils.enhancedHash( + id, type, startTimeOffset, + endTimeOffset, final_, attributes); } @Override @@ -209,49 +211,55 @@ public class GetMediaMetaDataMarker { "final_", final_, "attributes", attributes); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String type; - + private Long startTimeOffset; - + private Long endTimeOffset; - + private Optional final_ = Optional.empty(); - + private Optional attributes = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(long id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder startTimeOffset(long startTimeOffset) { Utils.checkNotNull(startTimeOffset, "startTimeOffset"); this.startTimeOffset = startTimeOffset; return this; } + public Builder endTimeOffset(long endTimeOffset) { Utils.checkNotNull(endTimeOffset, "endTimeOffset"); this.endTimeOffset = endTimeOffset; return this; } + public Builder final_(boolean final_) { Utils.checkNotNull(final_, "final_"); this.final_ = Optional.ofNullable(final_); @@ -264,6 +272,7 @@ public class GetMediaMetaDataMarker { return this; } + /** * Attributes associated with the marker. */ @@ -281,15 +290,13 @@ public class GetMediaMetaDataMarker { this.attributes = attributes; return this; } - + public GetMediaMetaDataMarker build() { + return new GetMediaMetaDataMarker( - id, - type, - startTimeOffset, - endTimeOffset, - final_, - attributes); + id, type, startTimeOffset, + endTimeOffset, final_, attributes); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMedia.java index 6aba67c2..d2d4f0c5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMedia.java @@ -17,11 +17,10 @@ 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 GetMediaMetaDataMedia { +public class GetMediaMetaDataMedia { /** * Unique media identifier. */ @@ -70,6 +69,7 @@ public class GetMediaMetaDataMedia { @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("displayOffset") private Optional displayOffset; @@ -145,6 +145,7 @@ public class GetMediaMetaDataMedia { @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Part") private Optional> part; @@ -212,7 +213,13 @@ public class GetMediaMetaDataMedia { public GetMediaMetaDataMedia( long id) { - this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -364,9 +371,10 @@ public class GetMediaMetaDataMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique media identifier. @@ -386,6 +394,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Duration of the media in milliseconds. */ @@ -404,6 +413,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Bitrate in bits per second. */ @@ -422,6 +432,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video width in pixels. */ @@ -440,6 +451,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video height in pixels. */ @@ -458,6 +470,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Aspect ratio of the video. */ @@ -476,6 +489,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Number of audio channels. */ @@ -491,6 +505,7 @@ public class GetMediaMetaDataMedia { return this; } + public GetMediaMetaDataMedia withDisplayOffset(Optional displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = displayOffset; @@ -506,6 +521,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Audio codec used. */ @@ -524,6 +540,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video codec used. */ @@ -542,6 +559,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video resolution (e.g., 4k). */ @@ -560,6 +578,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Container format of the media. */ @@ -578,6 +597,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -596,6 +616,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video profile (e.g., main 10). */ @@ -614,6 +635,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Indicates whether voice activity is detected. */ @@ -632,6 +654,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -650,6 +673,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -669,6 +693,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Indicates whether the media has 64-bit offsets. * This is relevant for media files that may require larger offsets than what 32-bit integers can provide. @@ -685,13 +710,13 @@ public class GetMediaMetaDataMedia { return this; } + public GetMediaMetaDataMedia withPart(Optional> part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -702,48 +727,36 @@ public class GetMediaMetaDataMedia { } GetMediaMetaDataMedia other = (GetMediaMetaDataMedia) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.displayOffset, other.displayOffset) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.displayOffset, other.displayOffset) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } @@ -770,51 +783,53 @@ public class GetMediaMetaDataMedia { "has64bitOffsets", has64bitOffsets, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional displayOffset = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional hasVoiceActivity = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique media identifier. */ @@ -824,6 +839,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Duration of the media in milliseconds. */ @@ -842,6 +858,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Bitrate in bits per second. */ @@ -860,6 +877,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video width in pixels. */ @@ -878,6 +896,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video height in pixels. */ @@ -896,6 +915,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Aspect ratio of the video. */ @@ -914,6 +934,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Number of audio channels. */ @@ -932,6 +953,7 @@ public class GetMediaMetaDataMedia { return this; } + public Builder displayOffset(int displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = Optional.ofNullable(displayOffset); @@ -944,6 +966,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Audio codec used. */ @@ -962,6 +985,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video codec used. */ @@ -980,6 +1004,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video resolution (e.g., 4k). */ @@ -998,6 +1023,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Container format of the media. */ @@ -1016,6 +1042,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -1034,6 +1061,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Video profile (e.g., main 10). */ @@ -1052,6 +1080,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Indicates whether voice activity is detected. */ @@ -1070,6 +1099,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -1088,6 +1118,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -1106,6 +1137,7 @@ public class GetMediaMetaDataMedia { return this; } + /** * Indicates whether the media has 64-bit offsets. * This is relevant for media files that may require larger offsets than what 32-bit integers can provide. @@ -1126,6 +1158,7 @@ public class GetMediaMetaDataMedia { return this; } + public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = Optional.ofNullable(part); @@ -1137,28 +1170,18 @@ public class GetMediaMetaDataMedia { this.part = part; return this; } - + public GetMediaMetaDataMedia build() { + return new GetMediaMetaDataMedia( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMediaContainer.java index cb78276e..0e26c436 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMediaContainer.java @@ -15,11 +15,10 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; -public class GetMediaMetaDataMediaContainer { +public class GetMediaMetaDataMediaContainer { /** * Number of media items returned in this response. */ @@ -115,7 +114,9 @@ public class GetMediaMetaDataMediaContainer { String mediaTagPrefix, long mediaTagVersion, List metadata) { - this(size, allowSync, identifier, Optional.empty(), Optional.empty(), Optional.empty(), mediaTagPrefix, mediaTagVersion, metadata); + this(size, allowSync, identifier, + Optional.empty(), Optional.empty(), Optional.empty(), + mediaTagPrefix, mediaTagVersion, metadata); } /** @@ -190,9 +191,10 @@ public class GetMediaMetaDataMediaContainer { return metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -230,6 +232,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * The unique identifier for the library section. */ @@ -248,6 +251,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * The title of the library section. */ @@ -266,6 +270,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * The universally unique identifier for the library section. */ @@ -302,7 +307,6 @@ public class GetMediaMetaDataMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -313,29 +317,23 @@ public class GetMediaMetaDataMediaContainer { } GetMediaMetaDataMediaContainer other = (GetMediaMetaDataMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionUUID, other.librarySectionUUID) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - metadata); + return Utils.enhancedHash( + size, allowSync, identifier, + librarySectionID, librarySectionTitle, librarySectionUUID, + mediaTagPrefix, mediaTagVersion, metadata); } @Override @@ -351,31 +349,33 @@ public class GetMediaMetaDataMediaContainer { "mediaTagVersion", mediaTagVersion, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Boolean allowSync; - + private String identifier; - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionUUID = Optional.empty(); - + private String mediaTagPrefix; - + private Long mediaTagVersion; - + private List metadata; - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -385,6 +385,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * Indicates whether syncing is allowed. */ @@ -394,6 +395,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -403,6 +405,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * The unique identifier for the library section. */ @@ -421,6 +424,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * The title of the library section. */ @@ -439,6 +443,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * The universally unique identifier for the library section. */ @@ -457,6 +462,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * The prefix used for media tag resource paths. */ @@ -466,6 +472,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * The version number for media tags. */ @@ -475,6 +482,7 @@ public class GetMediaMetaDataMediaContainer { return this; } + /** * An array of metadata items. */ @@ -483,18 +491,14 @@ public class GetMediaMetaDataMediaContainer { this.metadata = metadata; return this; } - + public GetMediaMetaDataMediaContainer build() { + return new GetMediaMetaDataMediaContainer( - size, - allowSync, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - metadata); + size, allowSync, identifier, + librarySectionID, librarySectionTitle, librarySectionUUID, + mediaTagPrefix, mediaTagVersion, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMetadata.java index 575a4409..5091db53 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataMetadata.java @@ -18,7 +18,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -27,7 +26,6 @@ import java.util.Optional; *

Unknown */ public class GetMediaMetaDataMetadata { - /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -59,6 +57,7 @@ public class GetMediaMetaDataMetadata { @JsonProperty("studio") private Optional studio; + @JsonProperty("type") private GetMediaMetaDataType type; @@ -175,6 +174,7 @@ public class GetMediaMetaDataMetadata { @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonProperty("addedAt") private long addedAt; @@ -381,10 +381,12 @@ public class GetMediaMetaDataMetadata { @JsonProperty("userRating") private Optional userRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Image") private Optional> image; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("UltraBlurColors") private Optional ultraBlurColors; @@ -410,58 +412,72 @@ public class GetMediaMetaDataMetadata { @JsonProperty("librarySectionKey") private Optional librarySectionKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Guid") private Optional> guids; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Producer") private Optional> producer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Rating") private Optional> ratings; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Similar") private Optional> similar; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Location") private Optional> location; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Chapter") private Optional> chapter; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Marker") private Optional> marker; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Extras") private Optional extras; @@ -709,7 +725,31 @@ public class GetMediaMetaDataMetadata { int seasonCount, int duration, long addedAt) { - this(ratingKey, key, guid, slug, Optional.empty(), type, title, titleSort, Optional.empty(), summary, rating, audienceRating, Optional.empty(), tagline, thumb, art, theme, index, Optional.empty(), Optional.empty(), childCount, seasonCount, duration, Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(ratingKey, key, guid, + slug, Optional.empty(), type, + title, titleSort, Optional.empty(), + summary, rating, audienceRating, + Optional.empty(), tagline, thumb, + art, theme, index, + Optional.empty(), Optional.empty(), childCount, + seasonCount, duration, Optional.empty(), + addedAt, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -1258,9 +1298,10 @@ public class GetMediaMetaDataMetadata { return (Optional) extras; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. @@ -1307,6 +1348,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The studio that produced the media item. */ @@ -1349,6 +1391,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The content rating for the media item. */ @@ -1394,6 +1437,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The release year of the media item. */ @@ -1457,6 +1501,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -1475,6 +1520,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -1520,6 +1566,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The original release date of the media item. */ @@ -1544,6 +1591,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * Unix epoch datetime in seconds */ @@ -1562,6 +1610,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -1580,6 +1629,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -1598,6 +1648,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -1616,6 +1667,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -1634,6 +1686,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -1652,6 +1705,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -1670,6 +1724,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -1688,6 +1743,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -1706,6 +1762,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -1724,6 +1781,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -1742,6 +1800,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The key of the parent media item. */ @@ -1760,6 +1819,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -1778,6 +1838,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -1796,6 +1857,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -1814,6 +1876,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -1832,6 +1895,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The title of the parent media item. */ @@ -1850,6 +1914,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The index position of the parent media item. */ @@ -1868,6 +1933,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -1886,6 +1952,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The URL for the rating image. */ @@ -1904,6 +1971,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -1922,6 +1990,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -1940,6 +2009,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -1958,6 +2028,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -1976,6 +2047,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -1994,6 +2066,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -2012,6 +2085,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -2030,6 +2104,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -2048,6 +2123,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -2063,6 +2139,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withImage(Optional> image) { Utils.checkNotNull(image, "image"); this.image = image; @@ -2075,6 +2152,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withUltraBlurColors(Optional ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = ultraBlurColors; @@ -2090,6 +2168,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The identifier for the library section. */ @@ -2108,6 +2187,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The title of the library section. */ @@ -2126,6 +2206,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The key corresponding to the library section. */ @@ -2141,6 +2222,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withGuids(Optional> guids) { Utils.checkNotNull(guids, "guids"); this.guids = guids; @@ -2153,6 +2235,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -2165,6 +2248,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -2177,6 +2261,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -2189,6 +2274,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -2201,6 +2287,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -2213,6 +2300,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withProducer(Optional> producer) { Utils.checkNotNull(producer, "producer"); this.producer = producer; @@ -2225,6 +2313,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; @@ -2237,6 +2326,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withRatings(Optional> ratings) { Utils.checkNotNull(ratings, "ratings"); this.ratings = ratings; @@ -2249,6 +2339,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withSimilar(Optional> similar) { Utils.checkNotNull(similar, "similar"); this.similar = similar; @@ -2261,6 +2352,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withLocation(Optional> location) { Utils.checkNotNull(location, "location"); this.location = location; @@ -2273,6 +2365,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withChapter(Optional> chapter) { Utils.checkNotNull(chapter, "chapter"); this.chapter = chapter; @@ -2285,6 +2378,7 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withMarker(Optional> marker) { Utils.checkNotNull(marker, "marker"); this.marker = marker; @@ -2297,13 +2391,13 @@ public class GetMediaMetaDataMetadata { return this; } + public GetMediaMetaDataMetadata withExtras(Optional extras) { Utils.checkNotNull(extras, "extras"); this.extras = extras; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -2314,156 +2408,108 @@ public class GetMediaMetaDataMetadata { } GetMediaMetaDataMetadata other = (GetMediaMetaDataMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.slug, other.slug) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.titleSort, other.titleSort) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.theme, other.theme) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.seasonCount, other.seasonCount) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.chapterSource, other.chapterSource) && - Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && - Objects.deepEquals(this.originalTitle, other.originalTitle) && - Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && - Objects.deepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && - Objects.deepEquals(this.parentGuid, other.parentGuid) && - Objects.deepEquals(this.grandparentGuid, other.grandparentGuid) && - Objects.deepEquals(this.grandparentSlug, other.grandparentSlug) && - Objects.deepEquals(this.grandparentKey, other.grandparentKey) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && - Objects.deepEquals(this.grandparentThumb, other.grandparentThumb) && - Objects.deepEquals(this.grandparentTheme, other.grandparentTheme) && - Objects.deepEquals(this.grandparentArt, other.grandparentArt) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.viewOffset, other.viewOffset) && - Objects.deepEquals(this.skipCount, other.skipCount) && - Objects.deepEquals(this.subtype, other.subtype) && - Objects.deepEquals(this.lastRatedAt, other.lastRatedAt) && - Objects.deepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && - Objects.deepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.userRating, other.userRating) && - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.guids, other.guids) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.producer, other.producer) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.ratings, other.ratings) && - Objects.deepEquals(this.similar, other.similar) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.chapter, other.chapter) && - Objects.deepEquals(this.marker, other.marker) && - Objects.deepEquals(this.extras, other.extras); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.slug, other.slug) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.titleSort, other.titleSort) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.theme, other.theme) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.seasonCount, other.seasonCount) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.chapterSource, other.chapterSource) && + Utils.enhancedDeepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Utils.enhancedDeepEquals(this.originalTitle, other.originalTitle) && + Utils.enhancedDeepEquals(this.parentRatingKey, other.parentRatingKey) && + Utils.enhancedDeepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && + Utils.enhancedDeepEquals(this.parentGuid, other.parentGuid) && + Utils.enhancedDeepEquals(this.grandparentGuid, other.grandparentGuid) && + Utils.enhancedDeepEquals(this.grandparentSlug, other.grandparentSlug) && + Utils.enhancedDeepEquals(this.grandparentKey, other.grandparentKey) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.grandparentTitle, other.grandparentTitle) && + Utils.enhancedDeepEquals(this.grandparentThumb, other.grandparentThumb) && + Utils.enhancedDeepEquals(this.grandparentTheme, other.grandparentTheme) && + Utils.enhancedDeepEquals(this.grandparentArt, other.grandparentArt) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.viewOffset, other.viewOffset) && + Utils.enhancedDeepEquals(this.skipCount, other.skipCount) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.lastRatedAt, other.lastRatedAt) && + Utils.enhancedDeepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && + Utils.enhancedDeepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.userRating, other.userRating) && + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.ultraBlurColors, other.ultraBlurColors) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.guids, other.guids) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.producer, other.producer) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.ratings, other.ratings) && + Utils.enhancedDeepEquals(this.similar, other.similar) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.chapter, other.chapter) && + Utils.enhancedDeepEquals(this.marker, other.marker) && + Utils.enhancedDeepEquals(this.extras, other.extras); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - titleSort, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - theme, - index, - leafCount, - viewedLeafCount, - childCount, - seasonCount, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - originalTitle, - parentRatingKey, - grandparentRatingKey, - parentGuid, - grandparentGuid, - grandparentSlug, - grandparentKey, - parentKey, - grandparentTitle, - grandparentThumb, - grandparentTheme, - grandparentArt, - parentTitle, - parentIndex, - parentThumb, - ratingImage, - viewCount, - viewOffset, - skipCount, - subtype, - lastRatedAt, - createdAtAccuracy, - createdAtTZOffset, - lastViewedAt, - userRating, - image, - ultraBlurColors, - librarySectionID, - librarySectionTitle, - librarySectionKey, - guids, - media, - genre, - country, - director, - writer, - producer, - role, - ratings, - similar, - location, - chapter, - marker, + return Utils.enhancedHash( + ratingKey, key, guid, + slug, studio, type, + title, titleSort, contentRating, + summary, rating, audienceRating, + year, tagline, thumb, + art, theme, index, + leafCount, viewedLeafCount, childCount, + seasonCount, duration, originallyAvailableAt, + addedAt, updatedAt, audienceRatingImage, + chapterSource, primaryExtraKey, originalTitle, + parentRatingKey, grandparentRatingKey, parentGuid, + grandparentGuid, grandparentSlug, grandparentKey, + parentKey, grandparentTitle, grandparentThumb, + grandparentTheme, grandparentArt, parentTitle, + parentIndex, parentThumb, ratingImage, + viewCount, viewOffset, skipCount, + subtype, lastRatedAt, createdAtAccuracy, + createdAtTZOffset, lastViewedAt, userRating, + image, ultraBlurColors, librarySectionID, + librarySectionTitle, librarySectionKey, guids, + media, genre, country, + director, writer, producer, + role, ratings, similar, + location, chapter, marker, extras); } @@ -2544,159 +2590,161 @@ public class GetMediaMetaDataMetadata { "marker", marker, "extras", extras); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String ratingKey; - + private String key; - + private String guid; - + private String slug; - + private Optional studio = Optional.empty(); - + private GetMediaMetaDataType type; - + private String title; - + private String titleSort; - + private Optional contentRating = Optional.empty(); - + private String summary; - + private Float rating; - + private Double audienceRating; - + private Optional year = Optional.empty(); - + private String tagline; - + private String thumb; - + private String art; - + private String theme; - + private Integer index; - + private Optional leafCount = Optional.empty(); - + private Optional viewedLeafCount = Optional.empty(); - + private Integer childCount; - + private Integer seasonCount; - + private Integer duration; - + private Optional originallyAvailableAt = Optional.empty(); - + private Long addedAt; - + private Optional updatedAt = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional chapterSource = Optional.empty(); - + private Optional primaryExtraKey = Optional.empty(); - + private Optional originalTitle = Optional.empty(); - + private Optional parentRatingKey = Optional.empty(); - + private Optional grandparentRatingKey = Optional.empty(); - + private Optional parentGuid = Optional.empty(); - + private Optional grandparentGuid = Optional.empty(); - + private Optional grandparentSlug = Optional.empty(); - + private Optional grandparentKey = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional grandparentTitle = Optional.empty(); - + private Optional grandparentThumb = Optional.empty(); - + private Optional grandparentTheme = Optional.empty(); - + private Optional grandparentArt = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional parentThumb = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional viewOffset = Optional.empty(); - + private Optional skipCount = Optional.empty(); - + private Optional subtype = Optional.empty(); - + private Optional lastRatedAt = Optional.empty(); - + private Optional createdAtAccuracy = Optional.empty(); - + private Optional createdAtTZOffset = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional userRating = Optional.empty(); - + private Optional> image = Optional.empty(); - + private Optional ultraBlurColors = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionKey = Optional.empty(); - + private Optional> guids = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional> producer = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Optional> ratings = Optional.empty(); - + private Optional> similar = Optional.empty(); - + private Optional> location = Optional.empty(); - + private Optional> chapter = Optional.empty(); - + private Optional> marker = Optional.empty(); - + private Optional extras = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -2706,6 +2754,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The unique key for the media item. */ @@ -2715,6 +2764,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The globally unique identifier for the media item. */ @@ -2724,6 +2774,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * A URL‐friendly version of the media title. */ @@ -2733,6 +2784,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The studio that produced the media item. */ @@ -2751,12 +2803,14 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder type(GetMediaMetaDataType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + /** * The title of the media item. */ @@ -2766,6 +2820,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The sort title used for ordering media items. */ @@ -2775,6 +2830,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The content rating for the media item. */ @@ -2793,6 +2849,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * A synopsis of the media item. */ @@ -2802,6 +2859,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The critic rating for the media item. */ @@ -2811,6 +2869,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The audience rating for the media item. */ @@ -2820,6 +2879,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The release year of the media item. */ @@ -2838,6 +2898,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * A brief tagline for the media item. */ @@ -2847,6 +2908,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The thumbnail image URL for the media item. */ @@ -2856,6 +2918,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The art image URL for the media item. */ @@ -2865,6 +2928,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The theme URL for the media item. */ @@ -2874,6 +2938,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The index position of the media item. */ @@ -2883,6 +2948,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -2901,6 +2967,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -2919,6 +2986,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of child items associated with this media item. */ @@ -2928,6 +2996,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The total number of seasons (for TV shows). */ @@ -2937,6 +3006,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The duration of the media item in milliseconds. */ @@ -2946,6 +3016,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The original release date of the media item. */ @@ -2964,12 +3035,14 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder addedAt(long addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; return this; } + /** * Unix epoch datetime in seconds */ @@ -2988,6 +3061,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -3006,6 +3080,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -3024,6 +3099,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -3042,6 +3118,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -3060,6 +3137,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -3078,6 +3156,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -3096,6 +3175,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -3114,6 +3194,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -3132,6 +3213,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -3150,6 +3232,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -3168,6 +3251,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The key of the parent media item. */ @@ -3186,6 +3270,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -3204,6 +3289,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -3222,6 +3308,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -3240,6 +3327,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -3258,6 +3346,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The title of the parent media item. */ @@ -3276,6 +3365,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The index position of the parent media item. */ @@ -3294,6 +3384,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -3312,6 +3403,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The URL for the rating image. */ @@ -3330,6 +3422,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -3348,6 +3441,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -3366,6 +3460,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -3384,6 +3479,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -3402,6 +3498,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -3420,6 +3517,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -3438,6 +3536,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -3456,6 +3555,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -3474,6 +3574,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -3492,6 +3593,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder image(List image) { Utils.checkNotNull(image, "image"); this.image = Optional.ofNullable(image); @@ -3504,6 +3606,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder ultraBlurColors(GetMediaMetaDataUltraBlurColors ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = Optional.ofNullable(ultraBlurColors); @@ -3516,6 +3619,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The identifier for the library section. */ @@ -3534,6 +3638,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The title of the library section. */ @@ -3552,6 +3657,7 @@ public class GetMediaMetaDataMetadata { return this; } + /** * The key corresponding to the library section. */ @@ -3570,6 +3676,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder guids(List guids) { Utils.checkNotNull(guids, "guids"); this.guids = Optional.ofNullable(guids); @@ -3582,6 +3689,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -3594,6 +3702,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -3606,6 +3715,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -3618,6 +3728,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -3630,6 +3741,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -3642,6 +3754,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder producer(List producer) { Utils.checkNotNull(producer, "producer"); this.producer = Optional.ofNullable(producer); @@ -3654,6 +3767,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -3666,6 +3780,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder ratings(List ratings) { Utils.checkNotNull(ratings, "ratings"); this.ratings = Optional.ofNullable(ratings); @@ -3678,6 +3793,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder similar(List similar) { Utils.checkNotNull(similar, "similar"); this.similar = Optional.ofNullable(similar); @@ -3690,6 +3806,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder location(List location) { Utils.checkNotNull(location, "location"); this.location = Optional.ofNullable(location); @@ -3702,6 +3819,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder chapter(List chapter) { Utils.checkNotNull(chapter, "chapter"); this.chapter = Optional.ofNullable(chapter); @@ -3714,6 +3832,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder marker(List marker) { Utils.checkNotNull(marker, "marker"); this.marker = Optional.ofNullable(marker); @@ -3726,6 +3845,7 @@ public class GetMediaMetaDataMetadata { return this; } + public Builder extras(GetMediaMetaDataExtras extras) { Utils.checkNotNull(extras, "extras"); this.extras = Optional.ofNullable(extras); @@ -3737,82 +3857,36 @@ public class GetMediaMetaDataMetadata { this.extras = extras; return this; } - + public GetMediaMetaDataMetadata build() { + return new GetMediaMetaDataMetadata( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - titleSort, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - theme, - index, - leafCount, - viewedLeafCount, - childCount, - seasonCount, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - originalTitle, - parentRatingKey, - grandparentRatingKey, - parentGuid, - grandparentGuid, - grandparentSlug, - grandparentKey, - parentKey, - grandparentTitle, - grandparentThumb, - grandparentTheme, - grandparentArt, - parentTitle, - parentIndex, - parentThumb, - ratingImage, - viewCount, - viewOffset, - skipCount, - subtype, - lastRatedAt, - createdAtAccuracy, - createdAtTZOffset, - lastViewedAt, - userRating, - image, - ultraBlurColors, - librarySectionID, - librarySectionTitle, - librarySectionKey, - guids, - media, - genre, - country, - director, - writer, - producer, - role, - ratings, - similar, - location, - chapter, - marker, + ratingKey, key, guid, + slug, studio, type, + title, titleSort, contentRating, + summary, rating, audienceRating, + year, tagline, thumb, + art, theme, index, + leafCount, viewedLeafCount, childCount, + seasonCount, duration, originallyAvailableAt, + addedAt, updatedAt, audienceRatingImage, + chapterSource, primaryExtraKey, originalTitle, + parentRatingKey, grandparentRatingKey, parentGuid, + grandparentGuid, grandparentSlug, grandparentKey, + parentKey, grandparentTitle, grandparentThumb, + grandparentTheme, grandparentArt, parentTitle, + parentIndex, parentThumb, ratingImage, + viewCount, viewOffset, skipCount, + subtype, lastRatedAt, createdAtAccuracy, + createdAtTZOffset, lastViewedAt, userRating, + image, ultraBlurColors, librarySectionID, + librarySectionTitle, librarySectionKey, guids, + media, genre, country, + director, writer, producer, + role, ratings, similar, + location, chapter, marker, extras); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreaming.java index 1f0b6c4c..07731c7b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetMediaMetaDataOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetMediaMetaDataOptimizedForStreaming { return false; } GetMediaMetaDataOptimizedForStreaming other = (GetMediaMetaDataOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreaming1.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreaming1.java index 1fe6fd71..587799a8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreaming1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreaming1.java @@ -14,7 +14,7 @@ public enum GetMediaMetaDataOptimizedForStreaming1 { @JsonValue private final int value; - private GetMediaMetaDataOptimizedForStreaming1(int value) { + GetMediaMetaDataOptimizedForStreaming1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreamingLibrary1.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreamingLibrary1.java index 23c6832a..d6fcdf5c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreamingLibrary1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataOptimizedForStreamingLibrary1.java @@ -14,7 +14,7 @@ public enum GetMediaMetaDataOptimizedForStreamingLibrary1 { @JsonValue private final int value; - private GetMediaMetaDataOptimizedForStreamingLibrary1(int value) { + GetMediaMetaDataOptimizedForStreamingLibrary1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataPart.java index b3885460..af03ec39 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataPart.java @@ -18,11 +18,10 @@ 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 GetMediaMetaDataPart { +public class GetMediaMetaDataPart { /** * Indicates if the part is accessible. */ @@ -50,6 +49,7 @@ public class GetMediaMetaDataPart { @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("indexes") private Optional indexes; @@ -75,6 +75,7 @@ public class GetMediaMetaDataPart { @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("packetLength") private Optional packetLength; @@ -100,6 +101,7 @@ public class GetMediaMetaDataPart { @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; @@ -111,10 +113,12 @@ public class GetMediaMetaDataPart { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasThumbnail") private Optional hasThumbnail; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Stream") private Optional> stream; @@ -173,7 +177,12 @@ public class GetMediaMetaDataPart { public GetMediaMetaDataPart( long id) { - this(Optional.empty(), Optional.empty(), id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), id, + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -292,9 +301,10 @@ public class GetMediaMetaDataPart { return (Optional>) stream; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Indicates if the part is accessible. @@ -305,6 +315,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Indicates if the part is accessible. */ @@ -323,6 +334,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Indicates if the part exists. */ @@ -350,6 +362,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Key to access this part. */ @@ -365,6 +378,7 @@ public class GetMediaMetaDataPart { return this; } + public GetMediaMetaDataPart withIndexes(Optional indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = indexes; @@ -380,6 +394,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Duration of the part in milliseconds. */ @@ -398,6 +413,7 @@ public class GetMediaMetaDataPart { return this; } + /** * File path for the part. */ @@ -416,6 +432,7 @@ public class GetMediaMetaDataPart { return this; } + /** * File size in bytes. */ @@ -431,6 +448,7 @@ public class GetMediaMetaDataPart { return this; } + public GetMediaMetaDataPart withPacketLength(Optional packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = packetLength; @@ -446,6 +464,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Container format of the part. */ @@ -464,6 +483,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Video profile for the part. */ @@ -482,6 +502,7 @@ public class GetMediaMetaDataPart { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -497,6 +518,7 @@ public class GetMediaMetaDataPart { return this; } + public GetMediaMetaDataPart withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -512,6 +534,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -527,6 +550,7 @@ public class GetMediaMetaDataPart { return this; } + public GetMediaMetaDataPart withHasThumbnail(Optional hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = hasThumbnail; @@ -539,13 +563,13 @@ public class GetMediaMetaDataPart { return this; } + public GetMediaMetaDataPart withStream(Optional> stream) { Utils.checkNotNull(stream, "stream"); this.stream = stream; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -556,42 +580,32 @@ public class GetMediaMetaDataPart { } GetMediaMetaDataPart other = (GetMediaMetaDataPart) o; return - Objects.deepEquals(this.accessible, other.accessible) && - Objects.deepEquals(this.exists, other.exists) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.indexes, other.indexes) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.packetLength, other.packetLength) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.hasThumbnail, other.hasThumbnail) && - Objects.deepEquals(this.stream, other.stream); + Utils.enhancedDeepEquals(this.accessible, other.accessible) && + Utils.enhancedDeepEquals(this.exists, other.exists) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.indexes, other.indexes) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.packetLength, other.packetLength) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.hasThumbnail, other.hasThumbnail) && + Utils.enhancedDeepEquals(this.stream, other.stream); } @Override public int hashCode() { - return Objects.hash( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail, + return Utils.enhancedHash( + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail, stream); } @@ -615,45 +629,47 @@ public class GetMediaMetaDataPart { "hasThumbnail", hasThumbnail, "stream", stream); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional accessible = Optional.empty(); - + private Optional exists = Optional.empty(); - + private Long id; - + private Optional key = Optional.empty(); - + private Optional indexes = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional file = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional packetLength = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional hasThumbnail; - + private Optional> stream = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Indicates if the part is accessible. */ @@ -672,6 +688,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Indicates if the part exists. */ @@ -690,6 +707,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Unique part identifier. */ @@ -699,6 +717,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Key to access this part. */ @@ -717,6 +736,7 @@ public class GetMediaMetaDataPart { return this; } + public Builder indexes(String indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = Optional.ofNullable(indexes); @@ -729,6 +749,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Duration of the part in milliseconds. */ @@ -747,6 +768,7 @@ public class GetMediaMetaDataPart { return this; } + /** * File path for the part. */ @@ -765,6 +787,7 @@ public class GetMediaMetaDataPart { return this; } + /** * File size in bytes. */ @@ -783,6 +806,7 @@ public class GetMediaMetaDataPart { return this; } + public Builder packetLength(int packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = Optional.ofNullable(packetLength); @@ -795,6 +819,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Container format of the part. */ @@ -813,6 +838,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Video profile for the part. */ @@ -831,6 +857,7 @@ public class GetMediaMetaDataPart { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -849,6 +876,7 @@ public class GetMediaMetaDataPart { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -861,6 +889,7 @@ public class GetMediaMetaDataPart { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -879,6 +908,7 @@ public class GetMediaMetaDataPart { return this; } + public Builder hasThumbnail(GetMediaMetaDataHasThumbnail hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = Optional.ofNullable(hasThumbnail); @@ -891,6 +921,7 @@ public class GetMediaMetaDataPart { return this; } + public Builder stream(List stream) { Utils.checkNotNull(stream, "stream"); this.stream = Optional.ofNullable(stream); @@ -902,30 +933,22 @@ public class GetMediaMetaDataPart { this.stream = stream; return this; } - + public GetMediaMetaDataPart build() { if (hasThumbnail == null) { hasThumbnail = _SINGLETON_VALUE_HasThumbnail.value(); } + return new GetMediaMetaDataPart( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail, + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail, stream); } + private static final LazySingletonValue> _SINGLETON_VALUE_HasThumbnail = new LazySingletonValue<>( "hasThumbnail", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataProducer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataProducer.java index 9df9f60d..0fe99725 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataProducer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataProducer.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetMediaMetaDataProducer { +public class GetMediaMetaDataProducer { /** * The unique role identifier. */ @@ -82,7 +81,8 @@ public class GetMediaMetaDataProducer { String filter, String tag, String tagKey) { - this(id, filter, tag, tagKey, Optional.empty(), Optional.empty()); + this(id, filter, tag, + tagKey, Optional.empty(), Optional.empty()); } /** @@ -133,9 +133,10 @@ public class GetMediaMetaDataProducer { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique role identifier. @@ -182,6 +183,7 @@ public class GetMediaMetaDataProducer { return this; } + /** * The character name or role. */ @@ -200,6 +202,7 @@ public class GetMediaMetaDataProducer { return this; } + /** * URL for the role thumbnail image. */ @@ -209,7 +212,6 @@ public class GetMediaMetaDataProducer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,23 +222,19 @@ public class GetMediaMetaDataProducer { } GetMediaMetaDataProducer other = (GetMediaMetaDataProducer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag, - tagKey, - role, - thumb); + return Utils.enhancedHash( + id, filter, tag, + tagKey, role, thumb); } @Override @@ -249,25 +247,27 @@ public class GetMediaMetaDataProducer { "role", role, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String filter; - + private String tag; - + private String tagKey; - + private Optional role = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The unique role identifier. */ @@ -277,6 +277,7 @@ public class GetMediaMetaDataProducer { return this; } + /** * The filter string for the role. */ @@ -286,6 +287,7 @@ public class GetMediaMetaDataProducer { return this; } + /** * The actor's name. */ @@ -295,6 +297,7 @@ public class GetMediaMetaDataProducer { return this; } + /** * A key associated with the actor tag. */ @@ -304,6 +307,7 @@ public class GetMediaMetaDataProducer { return this; } + /** * The character name or role. */ @@ -322,6 +326,7 @@ public class GetMediaMetaDataProducer { return this; } + /** * URL for the role thumbnail image. */ @@ -339,15 +344,13 @@ public class GetMediaMetaDataProducer { this.thumb = thumb; return this; } - + public GetMediaMetaDataProducer build() { + return new GetMediaMetaDataProducer( - id, - filter, - tag, - tagKey, - role, - thumb); + id, filter, tag, + tagKey, role, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRatings.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRatings.java index b5f2fb27..b5f13e03 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRatings.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRatings.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Float; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetMediaMetaDataRatings { - /** * The image or reference for the rating. */ @@ -69,9 +68,10 @@ public class GetMediaMetaDataRatings { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The image or reference for the rating. @@ -100,7 +100,6 @@ public class GetMediaMetaDataRatings { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,17 +110,15 @@ public class GetMediaMetaDataRatings { } GetMediaMetaDataRatings other = (GetMediaMetaDataRatings) o; return - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - image, - value, - type); + return Utils.enhancedHash( + image, value, type); } @Override @@ -131,19 +128,21 @@ public class GetMediaMetaDataRatings { "value", value, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String image; - + private Float value; - + private String type; - + private Builder() { // force use of static builder() method } + /** * The image or reference for the rating. */ @@ -153,6 +152,7 @@ public class GetMediaMetaDataRatings { return this; } + /** * The rating value. */ @@ -162,6 +162,7 @@ public class GetMediaMetaDataRatings { return this; } + /** * The type of rating (e.g., audience, critic). */ @@ -170,12 +171,12 @@ public class GetMediaMetaDataRatings { this.type = type; return this; } - + public GetMediaMetaDataRatings build() { + return new GetMediaMetaDataRatings( - image, - value, - type); + image, value, type); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRequest.java index 40a3791f..ea608d52 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetMediaMetaDataRequest { +public class GetMediaMetaDataRequest { /** * The id(s) of the library item(s) to return metadata for. Can be a single ID or comma-separated list of IDs. */ @@ -147,7 +146,11 @@ public class GetMediaMetaDataRequest { public GetMediaMetaDataRequest( String ratingKey) { - this(ratingKey, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(ratingKey, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } /** @@ -262,9 +265,10 @@ public class GetMediaMetaDataRequest { return asyncRefreshLocalMediaAgent; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The id(s) of the library item(s) to return metadata for. Can be a single ID or comma-separated list of IDs. @@ -284,6 +288,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include concerts data if set to true. */ @@ -302,6 +307,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include extra content (e.g. bonus features). */ @@ -320,6 +326,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include on-deck items. */ @@ -338,6 +345,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include popular leaves (episodes/chapters). */ @@ -356,6 +364,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include preferences information. */ @@ -374,6 +383,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include reviews for the content. */ @@ -392,6 +402,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include chapter details. */ @@ -410,6 +421,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include station data. */ @@ -428,6 +440,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include external media data. */ @@ -446,6 +459,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Trigger asynchronous metadata augmentation. */ @@ -464,6 +478,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Trigger asynchronous file checking. */ @@ -482,6 +497,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Trigger asynchronous refresh of analysis. */ @@ -500,6 +516,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Trigger asynchronous refresh of the local media agent. */ @@ -509,7 +526,6 @@ public class GetMediaMetaDataRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -520,39 +536,30 @@ public class GetMediaMetaDataRequest { } GetMediaMetaDataRequest other = (GetMediaMetaDataRequest) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.includeConcerts, other.includeConcerts) && - Objects.deepEquals(this.includeExtras, other.includeExtras) && - Objects.deepEquals(this.includeOnDeck, other.includeOnDeck) && - Objects.deepEquals(this.includePopularLeaves, other.includePopularLeaves) && - Objects.deepEquals(this.includePreferences, other.includePreferences) && - Objects.deepEquals(this.includeReviews, other.includeReviews) && - Objects.deepEquals(this.includeChapters, other.includeChapters) && - Objects.deepEquals(this.includeStations, other.includeStations) && - Objects.deepEquals(this.includeExternalMedia, other.includeExternalMedia) && - Objects.deepEquals(this.asyncAugmentMetadata, other.asyncAugmentMetadata) && - Objects.deepEquals(this.asyncCheckFiles, other.asyncCheckFiles) && - Objects.deepEquals(this.asyncRefreshAnalysis, other.asyncRefreshAnalysis) && - Objects.deepEquals(this.asyncRefreshLocalMediaAgent, other.asyncRefreshLocalMediaAgent); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.includeConcerts, other.includeConcerts) && + Utils.enhancedDeepEquals(this.includeExtras, other.includeExtras) && + Utils.enhancedDeepEquals(this.includeOnDeck, other.includeOnDeck) && + Utils.enhancedDeepEquals(this.includePopularLeaves, other.includePopularLeaves) && + Utils.enhancedDeepEquals(this.includePreferences, other.includePreferences) && + Utils.enhancedDeepEquals(this.includeReviews, other.includeReviews) && + Utils.enhancedDeepEquals(this.includeChapters, other.includeChapters) && + Utils.enhancedDeepEquals(this.includeStations, other.includeStations) && + Utils.enhancedDeepEquals(this.includeExternalMedia, other.includeExternalMedia) && + Utils.enhancedDeepEquals(this.asyncAugmentMetadata, other.asyncAugmentMetadata) && + Utils.enhancedDeepEquals(this.asyncCheckFiles, other.asyncCheckFiles) && + Utils.enhancedDeepEquals(this.asyncRefreshAnalysis, other.asyncRefreshAnalysis) && + Utils.enhancedDeepEquals(this.asyncRefreshLocalMediaAgent, other.asyncRefreshLocalMediaAgent); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - includeConcerts, - includeExtras, - includeOnDeck, - includePopularLeaves, - includePreferences, - includeReviews, - includeChapters, - includeStations, - includeExternalMedia, - asyncAugmentMetadata, - asyncCheckFiles, - asyncRefreshAnalysis, - asyncRefreshLocalMediaAgent); + return Utils.enhancedHash( + ratingKey, includeConcerts, includeExtras, + includeOnDeck, includePopularLeaves, includePreferences, + includeReviews, includeChapters, includeStations, + includeExternalMedia, asyncAugmentMetadata, asyncCheckFiles, + asyncRefreshAnalysis, asyncRefreshLocalMediaAgent); } @Override @@ -573,41 +580,43 @@ public class GetMediaMetaDataRequest { "asyncRefreshAnalysis", asyncRefreshAnalysis, "asyncRefreshLocalMediaAgent", asyncRefreshLocalMediaAgent); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String ratingKey; - + private Optional includeConcerts = Optional.empty(); - + private Optional includeExtras = Optional.empty(); - + private Optional includeOnDeck = Optional.empty(); - + private Optional includePopularLeaves = Optional.empty(); - + private Optional includePreferences = Optional.empty(); - + private Optional includeReviews = Optional.empty(); - + private Optional includeChapters = Optional.empty(); - + private Optional includeStations = Optional.empty(); - + private Optional includeExternalMedia = Optional.empty(); - + private Optional asyncAugmentMetadata = Optional.empty(); - + private Optional asyncCheckFiles = Optional.empty(); - + private Optional asyncRefreshAnalysis = Optional.empty(); - + private Optional asyncRefreshLocalMediaAgent = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The id(s) of the library item(s) to return metadata for. Can be a single ID or comma-separated list of IDs. */ @@ -617,6 +626,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include concerts data if set to true. */ @@ -635,6 +645,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include extra content (e.g. bonus features). */ @@ -653,6 +664,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include on-deck items. */ @@ -671,6 +683,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include popular leaves (episodes/chapters). */ @@ -689,6 +702,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include preferences information. */ @@ -707,6 +721,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include reviews for the content. */ @@ -725,6 +740,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include chapter details. */ @@ -743,6 +759,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include station data. */ @@ -761,6 +778,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Include external media data. */ @@ -779,6 +797,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Trigger asynchronous metadata augmentation. */ @@ -797,6 +816,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Trigger asynchronous file checking. */ @@ -815,6 +835,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Trigger asynchronous refresh of analysis. */ @@ -833,6 +854,7 @@ public class GetMediaMetaDataRequest { return this; } + /** * Trigger asynchronous refresh of the local media agent. */ @@ -850,23 +872,16 @@ public class GetMediaMetaDataRequest { this.asyncRefreshLocalMediaAgent = asyncRefreshLocalMediaAgent; return this; } - + public GetMediaMetaDataRequest build() { + return new GetMediaMetaDataRequest( - ratingKey, - includeConcerts, - includeExtras, - includeOnDeck, - includePopularLeaves, - includePreferences, - includeReviews, - includeChapters, - includeStations, - includeExternalMedia, - asyncAugmentMetadata, - asyncCheckFiles, - asyncRefreshAnalysis, - asyncRefreshLocalMediaAgent); + ratingKey, includeConcerts, includeExtras, + includeOnDeck, includePopularLeaves, includePreferences, + includeReviews, includeChapters, includeStations, + includeExternalMedia, asyncAugmentMetadata, asyncCheckFiles, + asyncRefreshAnalysis, asyncRefreshLocalMediaAgent); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRequestBuilder.java index 1720b200..459c35be 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetMediaMetaData; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetMediaMetaDataRequestBuilder { private GetMediaMetaDataRequest request; - private final SDKMethodInterfaces.MethodCallGetMediaMetaData sdk; + private final SDKConfiguration sdkConfiguration; - public GetMediaMetaDataRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaMetaData sdk) { - this.sdk = sdk; + public GetMediaMetaDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetMediaMetaDataRequestBuilder request(GetMediaMetaDataRequest request) { @@ -22,8 +26,10 @@ public class GetMediaMetaDataRequestBuilder { } public GetMediaMetaDataResponse call() throws Exception { + + RequestOperation operation + = new GetMediaMetaData.Sync(sdkConfiguration); - return sdk.getMediaMetaData( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataResponse.java index 0468216c..fadd6e50 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetMediaMetaDataResponse implements Response { +public class GetMediaMetaDataResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetMediaMetaDataResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetMediaMetaDataResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetMediaMetaDataResponse implements Response { return this; } + /** * The metadata of the library item. */ @@ -143,7 +145,6 @@ public class GetMediaMetaDataResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetMediaMetaDataResponse implements Response { } GetMediaMetaDataResponse other = (GetMediaMetaDataResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetMediaMetaDataResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetMediaMetaDataResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetMediaMetaDataResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetMediaMetaDataResponse implements Response { return this; } + /** * The metadata of the library item. */ @@ -236,13 +240,13 @@ public class GetMediaMetaDataResponse implements Response { this.object = object; return this; } - + public GetMediaMetaDataResponse build() { + return new GetMediaMetaDataResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataResponseBody.java index 1ce1b104..50feff01 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetMediaMetaDataResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataResponseBody withMediaContainer(GetMediaMetaDataMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetMediaMetaDataResponseBody { return this; } + public GetMediaMetaDataResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetMediaMetaDataResponseBody { } GetMediaMetaDataResponseBody other = (GetMediaMetaDataResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetMediaMetaDataResponseBody { return Utils.toString(GetMediaMetaDataResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetMediaMetaDataMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetMediaMetaDataResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetMediaMetaDataResponseBody build() { + return new GetMediaMetaDataResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRole.java index d4af138d..c383a86c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataRole.java @@ -12,11 +12,10 @@ 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 GetMediaMetaDataRole { +public class GetMediaMetaDataRole { /** * The unique identifier for the role. * NOTE: This is different for each Plex server and is not globally unique. @@ -84,7 +83,8 @@ public class GetMediaMetaDataRole { String tag, String filter, String tagKey) { - this(id, tag, Optional.empty(), filter, tagKey, Optional.empty()); + this(id, tag, Optional.empty(), + filter, tagKey, Optional.empty()); } /** @@ -137,9 +137,10 @@ public class GetMediaMetaDataRole { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the role. @@ -169,6 +170,7 @@ public class GetMediaMetaDataRole { return this; } + /** * The role played by the actor in the media item. */ @@ -206,6 +208,7 @@ public class GetMediaMetaDataRole { return this; } + /** * The absolute URL of the thumbnail image for the actor. */ @@ -215,7 +218,6 @@ public class GetMediaMetaDataRole { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -226,23 +228,19 @@ public class GetMediaMetaDataRole { } GetMediaMetaDataRole other = (GetMediaMetaDataRole) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - role, - filter, - tagKey, - thumb); + return Utils.enhancedHash( + id, tag, role, + filter, tagKey, thumb); } @Override @@ -255,25 +253,27 @@ public class GetMediaMetaDataRole { "tagKey", tagKey, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Optional role = Optional.empty(); - + private String filter; - + private String tagKey; - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the role. * NOTE: This is different for each Plex server and is not globally unique. @@ -284,6 +284,7 @@ public class GetMediaMetaDataRole { return this; } + /** * The display tag for the actor (typically the actor's name). */ @@ -293,6 +294,7 @@ public class GetMediaMetaDataRole { return this; } + /** * The role played by the actor in the media item. */ @@ -311,6 +313,7 @@ public class GetMediaMetaDataRole { return this; } + /** * The filter string used to query this actor. For example, it may indicate that this is an actor with a given key. */ @@ -320,6 +323,7 @@ public class GetMediaMetaDataRole { return this; } + /** * A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification. * NOTE: This is globally unique across all Plex Servers. @@ -330,6 +334,7 @@ public class GetMediaMetaDataRole { return this; } + /** * The absolute URL of the thumbnail image for the actor. */ @@ -347,15 +352,13 @@ public class GetMediaMetaDataRole { this.thumb = thumb; return this; } - + public GetMediaMetaDataRole build() { + return new GetMediaMetaDataRole( - id, - tag, - role, - filter, - tagKey, - thumb); + id, tag, role, + filter, tagKey, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataSimilar.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataSimilar.java index d6cef2da..807dee3e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataSimilar.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataSimilar.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetMediaMetaDataSimilar { - /** * The unique similar item identifier. */ @@ -69,9 +68,10 @@ public class GetMediaMetaDataSimilar { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique similar item identifier. @@ -100,7 +100,6 @@ public class GetMediaMetaDataSimilar { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,17 +110,15 @@ public class GetMediaMetaDataSimilar { } GetMediaMetaDataSimilar other = (GetMediaMetaDataSimilar) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag); + return Utils.enhancedHash( + id, filter, tag); } @Override @@ -131,19 +128,21 @@ public class GetMediaMetaDataSimilar { "filter", filter, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String filter; - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The unique similar item identifier. */ @@ -153,6 +152,7 @@ public class GetMediaMetaDataSimilar { return this; } + /** * The filter string for similar items. */ @@ -162,6 +162,7 @@ public class GetMediaMetaDataSimilar { return this; } + /** * The tag or title of the similar content. */ @@ -170,12 +171,12 @@ public class GetMediaMetaDataSimilar { this.tag = tag; return this; } - + public GetMediaMetaDataSimilar build() { + return new GetMediaMetaDataSimilar( - id, - filter, - tag); + id, filter, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataStream.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataStream.java index cb5edf78..17ef15d4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataStream.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataStream.java @@ -17,11 +17,10 @@ import java.lang.Integer; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetMediaMetaDataStream { +public class GetMediaMetaDataStream { /** * Unique stream identifier. */ @@ -191,6 +190,7 @@ public class GetMediaMetaDataStream { @JsonProperty("codedWidth") private Optional codedWidth; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("closedCaptions") private Optional closedCaptions; @@ -258,6 +258,7 @@ public class GetMediaMetaDataStream { @JsonProperty("original") private Optional original; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasScalingMatrix") private Optional hasScalingMatrix; @@ -269,10 +270,12 @@ public class GetMediaMetaDataStream { @JsonProperty("profile") private Optional profile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("scanType") private Optional scanType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("embeddedInVideo") private Optional embeddedInVideo; @@ -312,6 +315,7 @@ public class GetMediaMetaDataStream { @JsonProperty("selected") private Optional selected; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("forced") private Optional forced; @@ -522,7 +526,23 @@ public class GetMediaMetaDataStream { public GetMediaMetaDataStream( long id) { - this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } /** @@ -921,9 +941,10 @@ public class GetMediaMetaDataStream { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique stream identifier. @@ -943,6 +964,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Format of the stream (e.g., srt). */ @@ -961,6 +983,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if this stream is default. */ @@ -979,6 +1002,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Codec used by the stream. */ @@ -997,6 +1021,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Index of the stream. */ @@ -1015,6 +1040,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Bitrate of the stream. */ @@ -1033,6 +1059,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Language of the stream. */ @@ -1051,6 +1078,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Language tag (e.g., en). */ @@ -1069,6 +1097,7 @@ public class GetMediaMetaDataStream { return this; } + /** * ISO language code. */ @@ -1087,6 +1116,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates whether header compression is enabled. */ @@ -1105,6 +1135,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Dolby Vision BL compatibility ID. */ @@ -1123,6 +1154,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if Dolby Vision BL is present. */ @@ -1141,6 +1173,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if Dolby Vision EL is present. */ @@ -1159,6 +1192,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Dolby Vision level. */ @@ -1177,6 +1211,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if Dolby Vision is present. */ @@ -1195,6 +1230,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Dolby Vision profile. */ @@ -1213,6 +1249,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if Dolby Vision RPU is present. */ @@ -1231,6 +1268,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Dolby Vision version. */ @@ -1249,6 +1287,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Bit depth of the video stream. */ @@ -1267,6 +1306,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Chroma sample location. */ @@ -1285,6 +1325,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Chroma subsampling format. */ @@ -1303,6 +1344,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Coded video height. */ @@ -1321,6 +1363,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Coded video width. */ @@ -1336,6 +1379,7 @@ public class GetMediaMetaDataStream { return this; } + public GetMediaMetaDataStream withClosedCaptions(Optional closedCaptions) { Utils.checkNotNull(closedCaptions, "closedCaptions"); this.closedCaptions = closedCaptions; @@ -1351,6 +1395,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Color primaries used. */ @@ -1369,6 +1414,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Color range (e.g., tv). */ @@ -1387,6 +1433,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Color space. */ @@ -1405,6 +1452,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Color transfer characteristics. */ @@ -1423,6 +1471,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Frame rate of the stream. */ @@ -1441,6 +1490,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Key to access this stream part. */ @@ -1459,6 +1509,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Height of the video stream. */ @@ -1477,6 +1528,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Video level. */ @@ -1495,6 +1547,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if this is the original stream. */ @@ -1510,6 +1563,7 @@ public class GetMediaMetaDataStream { return this; } + public GetMediaMetaDataStream withHasScalingMatrix(Optional hasScalingMatrix) { Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); this.hasScalingMatrix = hasScalingMatrix; @@ -1525,6 +1579,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Video profile. */ @@ -1540,6 +1595,7 @@ public class GetMediaMetaDataStream { return this; } + public GetMediaMetaDataStream withScanType(Optional scanType) { Utils.checkNotNull(scanType, "scanType"); this.scanType = scanType; @@ -1552,6 +1608,7 @@ public class GetMediaMetaDataStream { return this; } + public GetMediaMetaDataStream withEmbeddedInVideo(Optional embeddedInVideo) { Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); this.embeddedInVideo = embeddedInVideo; @@ -1567,6 +1624,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Number of reference frames. */ @@ -1585,6 +1643,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Width of the video stream. */ @@ -1603,6 +1662,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Display title for the stream. */ @@ -1621,6 +1681,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Extended display title for the stream. */ @@ -1639,6 +1700,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if this stream is selected (applicable for audio streams). */ @@ -1654,6 +1716,7 @@ public class GetMediaMetaDataStream { return this; } + public GetMediaMetaDataStream withForced(Optional forced) { Utils.checkNotNull(forced, "forced"); this.forced = forced; @@ -1669,6 +1732,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Number of audio channels (for audio streams). */ @@ -1687,6 +1751,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Audio channel layout. */ @@ -1705,6 +1770,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Sampling rate for the audio stream. */ @@ -1723,6 +1789,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if the stream can auto-sync. */ @@ -1741,6 +1808,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if the stream is for the hearing impaired. */ @@ -1759,6 +1827,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if the stream is a dub. */ @@ -1777,6 +1846,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Optional title for the stream (e.g., language variant). */ @@ -1786,7 +1856,6 @@ public class GetMediaMetaDataStream { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1797,113 +1866,79 @@ public class GetMediaMetaDataStream { } GetMediaMetaDataStream other = (GetMediaMetaDataStream) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.streamType, other.streamType) && - Objects.deepEquals(this.format, other.format) && - Objects.deepEquals(this.default_, other.default_) && - Objects.deepEquals(this.codec, other.codec) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.language, other.language) && - Objects.deepEquals(this.languageTag, other.languageTag) && - Objects.deepEquals(this.languageCode, other.languageCode) && - Objects.deepEquals(this.headerCompression, other.headerCompression) && - Objects.deepEquals(this.doviblCompatID, other.doviblCompatID) && - Objects.deepEquals(this.doviblPresent, other.doviblPresent) && - Objects.deepEquals(this.dovielPresent, other.dovielPresent) && - Objects.deepEquals(this.doviLevel, other.doviLevel) && - Objects.deepEquals(this.doviPresent, other.doviPresent) && - Objects.deepEquals(this.doviProfile, other.doviProfile) && - Objects.deepEquals(this.dovirpuPresent, other.dovirpuPresent) && - Objects.deepEquals(this.doviVersion, other.doviVersion) && - Objects.deepEquals(this.bitDepth, other.bitDepth) && - Objects.deepEquals(this.chromaLocation, other.chromaLocation) && - Objects.deepEquals(this.chromaSubsampling, other.chromaSubsampling) && - Objects.deepEquals(this.codedHeight, other.codedHeight) && - Objects.deepEquals(this.codedWidth, other.codedWidth) && - Objects.deepEquals(this.closedCaptions, other.closedCaptions) && - Objects.deepEquals(this.colorPrimaries, other.colorPrimaries) && - Objects.deepEquals(this.colorRange, other.colorRange) && - Objects.deepEquals(this.colorSpace, other.colorSpace) && - Objects.deepEquals(this.colorTrc, other.colorTrc) && - Objects.deepEquals(this.frameRate, other.frameRate) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.level, other.level) && - Objects.deepEquals(this.original, other.original) && - Objects.deepEquals(this.hasScalingMatrix, other.hasScalingMatrix) && - Objects.deepEquals(this.profile, other.profile) && - Objects.deepEquals(this.scanType, other.scanType) && - Objects.deepEquals(this.embeddedInVideo, other.embeddedInVideo) && - Objects.deepEquals(this.refFrames, other.refFrames) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.displayTitle, other.displayTitle) && - Objects.deepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && - Objects.deepEquals(this.selected, other.selected) && - Objects.deepEquals(this.forced, other.forced) && - Objects.deepEquals(this.channels, other.channels) && - Objects.deepEquals(this.audioChannelLayout, other.audioChannelLayout) && - Objects.deepEquals(this.samplingRate, other.samplingRate) && - Objects.deepEquals(this.canAutoSync, other.canAutoSync) && - Objects.deepEquals(this.hearingImpaired, other.hearingImpaired) && - Objects.deepEquals(this.dub, other.dub) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.streamType, other.streamType) && + Utils.enhancedDeepEquals(this.format, other.format) && + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.codec, other.codec) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.language, other.language) && + Utils.enhancedDeepEquals(this.languageTag, other.languageTag) && + Utils.enhancedDeepEquals(this.languageCode, other.languageCode) && + Utils.enhancedDeepEquals(this.headerCompression, other.headerCompression) && + Utils.enhancedDeepEquals(this.doviblCompatID, other.doviblCompatID) && + Utils.enhancedDeepEquals(this.doviblPresent, other.doviblPresent) && + Utils.enhancedDeepEquals(this.dovielPresent, other.dovielPresent) && + Utils.enhancedDeepEquals(this.doviLevel, other.doviLevel) && + Utils.enhancedDeepEquals(this.doviPresent, other.doviPresent) && + Utils.enhancedDeepEquals(this.doviProfile, other.doviProfile) && + Utils.enhancedDeepEquals(this.dovirpuPresent, other.dovirpuPresent) && + Utils.enhancedDeepEquals(this.doviVersion, other.doviVersion) && + Utils.enhancedDeepEquals(this.bitDepth, other.bitDepth) && + Utils.enhancedDeepEquals(this.chromaLocation, other.chromaLocation) && + Utils.enhancedDeepEquals(this.chromaSubsampling, other.chromaSubsampling) && + Utils.enhancedDeepEquals(this.codedHeight, other.codedHeight) && + Utils.enhancedDeepEquals(this.codedWidth, other.codedWidth) && + Utils.enhancedDeepEquals(this.closedCaptions, other.closedCaptions) && + Utils.enhancedDeepEquals(this.colorPrimaries, other.colorPrimaries) && + Utils.enhancedDeepEquals(this.colorRange, other.colorRange) && + Utils.enhancedDeepEquals(this.colorSpace, other.colorSpace) && + Utils.enhancedDeepEquals(this.colorTrc, other.colorTrc) && + Utils.enhancedDeepEquals(this.frameRate, other.frameRate) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.level, other.level) && + Utils.enhancedDeepEquals(this.original, other.original) && + Utils.enhancedDeepEquals(this.hasScalingMatrix, other.hasScalingMatrix) && + Utils.enhancedDeepEquals(this.profile, other.profile) && + Utils.enhancedDeepEquals(this.scanType, other.scanType) && + Utils.enhancedDeepEquals(this.embeddedInVideo, other.embeddedInVideo) && + Utils.enhancedDeepEquals(this.refFrames, other.refFrames) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.displayTitle, other.displayTitle) && + Utils.enhancedDeepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && + Utils.enhancedDeepEquals(this.selected, other.selected) && + Utils.enhancedDeepEquals(this.forced, other.forced) && + Utils.enhancedDeepEquals(this.channels, other.channels) && + Utils.enhancedDeepEquals(this.audioChannelLayout, other.audioChannelLayout) && + Utils.enhancedDeepEquals(this.samplingRate, other.samplingRate) && + Utils.enhancedDeepEquals(this.canAutoSync, other.canAutoSync) && + Utils.enhancedDeepEquals(this.hearingImpaired, other.hearingImpaired) && + Utils.enhancedDeepEquals(this.dub, other.dub) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - id, - streamType, - format, - default_, - codec, - index, - bitrate, - language, - languageTag, - languageCode, - headerCompression, - doviblCompatID, - doviblPresent, - dovielPresent, - doviLevel, - doviPresent, - doviProfile, - dovirpuPresent, - doviVersion, - bitDepth, - chromaLocation, - chromaSubsampling, - codedHeight, - codedWidth, - closedCaptions, - colorPrimaries, - colorRange, - colorSpace, - colorTrc, - frameRate, - key, - height, - level, - original, - hasScalingMatrix, - profile, - scanType, - embeddedInVideo, - refFrames, - width, - displayTitle, - extendedDisplayTitle, - selected, - forced, - channels, - audioChannelLayout, - samplingRate, - canAutoSync, - hearingImpaired, - dub, - title); + return Utils.enhancedHash( + id, streamType, format, + default_, codec, index, + bitrate, language, languageTag, + languageCode, headerCompression, doviblCompatID, + doviblPresent, dovielPresent, doviLevel, + doviPresent, doviProfile, dovirpuPresent, + doviVersion, bitDepth, chromaLocation, + chromaSubsampling, codedHeight, codedWidth, + closedCaptions, colorPrimaries, colorRange, + colorSpace, colorTrc, frameRate, + key, height, level, + original, hasScalingMatrix, profile, + scanType, embeddedInVideo, refFrames, + width, displayTitle, extendedDisplayTitle, + selected, forced, channels, + audioChannelLayout, samplingRate, canAutoSync, + hearingImpaired, dub, title); } @Override @@ -1961,113 +1996,115 @@ public class GetMediaMetaDataStream { "dub", dub, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional format = Optional.empty(); - + private Optional default_ = Optional.empty(); - + private Optional codec = Optional.empty(); - + private Optional index = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional language = Optional.empty(); - + private Optional languageTag = Optional.empty(); - + private Optional languageCode = Optional.empty(); - + private Optional headerCompression = Optional.empty(); - + private Optional doviblCompatID = Optional.empty(); - + private Optional doviblPresent = Optional.empty(); - + private Optional dovielPresent = Optional.empty(); - + private Optional doviLevel = Optional.empty(); - + private Optional doviPresent = Optional.empty(); - + private Optional doviProfile = Optional.empty(); - + private Optional dovirpuPresent = Optional.empty(); - + private Optional doviVersion = Optional.empty(); - + private Optional bitDepth = Optional.empty(); - + private Optional chromaLocation = Optional.empty(); - + private Optional chromaSubsampling = Optional.empty(); - + private Optional codedHeight = Optional.empty(); - + private Optional codedWidth = Optional.empty(); - + private Optional closedCaptions = Optional.empty(); - + private Optional colorPrimaries = Optional.empty(); - + private Optional colorRange = Optional.empty(); - + private Optional colorSpace = Optional.empty(); - + private Optional colorTrc = Optional.empty(); - + private Optional frameRate = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional level = Optional.empty(); - + private Optional original = Optional.empty(); - + private Optional hasScalingMatrix = Optional.empty(); - + private Optional profile = Optional.empty(); - + private Optional scanType = Optional.empty(); - + private Optional embeddedInVideo = Optional.empty(); - + private Optional refFrames = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional displayTitle = Optional.empty(); - + private Optional extendedDisplayTitle = Optional.empty(); - + private Optional selected = Optional.empty(); - + private Optional forced = Optional.empty(); - + private Optional channels = Optional.empty(); - + private Optional audioChannelLayout = Optional.empty(); - + private Optional samplingRate = Optional.empty(); - + private Optional canAutoSync = Optional.empty(); - + private Optional hearingImpaired = Optional.empty(); - + private Optional dub = Optional.empty(); - + private Optional title = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique stream identifier. */ @@ -2077,6 +2114,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Format of the stream (e.g., srt). */ @@ -2095,6 +2133,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if this stream is default. */ @@ -2113,6 +2152,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Codec used by the stream. */ @@ -2131,6 +2171,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Index of the stream. */ @@ -2149,6 +2190,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Bitrate of the stream. */ @@ -2167,6 +2209,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Language of the stream. */ @@ -2185,6 +2228,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Language tag (e.g., en). */ @@ -2203,6 +2247,7 @@ public class GetMediaMetaDataStream { return this; } + /** * ISO language code. */ @@ -2221,6 +2266,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates whether header compression is enabled. */ @@ -2239,6 +2285,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Dolby Vision BL compatibility ID. */ @@ -2257,6 +2304,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if Dolby Vision BL is present. */ @@ -2275,6 +2323,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if Dolby Vision EL is present. */ @@ -2293,6 +2342,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Dolby Vision level. */ @@ -2311,6 +2361,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if Dolby Vision is present. */ @@ -2329,6 +2380,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Dolby Vision profile. */ @@ -2347,6 +2399,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if Dolby Vision RPU is present. */ @@ -2365,6 +2418,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Dolby Vision version. */ @@ -2383,6 +2437,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Bit depth of the video stream. */ @@ -2401,6 +2456,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Chroma sample location. */ @@ -2419,6 +2475,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Chroma subsampling format. */ @@ -2437,6 +2494,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Coded video height. */ @@ -2455,6 +2513,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Coded video width. */ @@ -2473,6 +2532,7 @@ public class GetMediaMetaDataStream { return this; } + public Builder closedCaptions(boolean closedCaptions) { Utils.checkNotNull(closedCaptions, "closedCaptions"); this.closedCaptions = Optional.ofNullable(closedCaptions); @@ -2485,6 +2545,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Color primaries used. */ @@ -2503,6 +2564,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Color range (e.g., tv). */ @@ -2521,6 +2583,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Color space. */ @@ -2539,6 +2602,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Color transfer characteristics. */ @@ -2557,6 +2621,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Frame rate of the stream. */ @@ -2575,6 +2640,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Key to access this stream part. */ @@ -2593,6 +2659,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Height of the video stream. */ @@ -2611,6 +2678,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Video level. */ @@ -2629,6 +2697,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if this is the original stream. */ @@ -2647,6 +2716,7 @@ public class GetMediaMetaDataStream { return this; } + public Builder hasScalingMatrix(boolean hasScalingMatrix) { Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); this.hasScalingMatrix = Optional.ofNullable(hasScalingMatrix); @@ -2659,6 +2729,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Video profile. */ @@ -2677,6 +2748,7 @@ public class GetMediaMetaDataStream { return this; } + public Builder scanType(String scanType) { Utils.checkNotNull(scanType, "scanType"); this.scanType = Optional.ofNullable(scanType); @@ -2689,6 +2761,7 @@ public class GetMediaMetaDataStream { return this; } + public Builder embeddedInVideo(String embeddedInVideo) { Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); this.embeddedInVideo = Optional.ofNullable(embeddedInVideo); @@ -2701,6 +2774,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Number of reference frames. */ @@ -2719,6 +2793,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Width of the video stream. */ @@ -2737,6 +2812,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Display title for the stream. */ @@ -2755,6 +2831,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Extended display title for the stream. */ @@ -2773,6 +2850,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if this stream is selected (applicable for audio streams). */ @@ -2791,6 +2869,7 @@ public class GetMediaMetaDataStream { return this; } + public Builder forced(boolean forced) { Utils.checkNotNull(forced, "forced"); this.forced = Optional.ofNullable(forced); @@ -2803,6 +2882,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Number of audio channels (for audio streams). */ @@ -2821,6 +2901,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Audio channel layout. */ @@ -2839,6 +2920,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Sampling rate for the audio stream. */ @@ -2857,6 +2939,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if the stream can auto-sync. */ @@ -2875,6 +2958,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if the stream is for the hearing impaired. */ @@ -2893,6 +2977,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Indicates if the stream is a dub. */ @@ -2911,6 +2996,7 @@ public class GetMediaMetaDataStream { return this; } + /** * Optional title for the stream (e.g., language variant). */ @@ -2928,61 +3014,30 @@ public class GetMediaMetaDataStream { this.title = title; return this; } - + public GetMediaMetaDataStream build() { + return new GetMediaMetaDataStream( - id, - format, - default_, - codec, - index, - bitrate, - language, - languageTag, - languageCode, - headerCompression, - doviblCompatID, - doviblPresent, - dovielPresent, - doviLevel, - doviPresent, - doviProfile, - dovirpuPresent, - doviVersion, - bitDepth, - chromaLocation, - chromaSubsampling, - codedHeight, - codedWidth, - closedCaptions, - colorPrimaries, - colorRange, - colorSpace, - colorTrc, - frameRate, - key, - height, - level, - original, - hasScalingMatrix, - profile, - scanType, - embeddedInVideo, - refFrames, - width, - displayTitle, - extendedDisplayTitle, - selected, - forced, - channels, - audioChannelLayout, - samplingRate, - canAutoSync, - hearingImpaired, - dub, - title); + id, format, default_, + codec, index, bitrate, + language, languageTag, languageCode, + headerCompression, doviblCompatID, doviblPresent, + dovielPresent, doviLevel, doviPresent, + doviProfile, dovirpuPresent, doviVersion, + bitDepth, chromaLocation, chromaSubsampling, + codedHeight, codedWidth, closedCaptions, + colorPrimaries, colorRange, colorSpace, + colorTrc, frameRate, key, + height, level, original, + hasScalingMatrix, profile, scanType, + embeddedInVideo, refFrames, width, + displayTitle, extendedDisplayTitle, selected, + forced, channels, audioChannelLayout, + samplingRate, canAutoSync, hearingImpaired, + dub, title); } + private static final LazySingletonValue _SINGLETON_VALUE_StreamType = new LazySingletonValue<>( "streamType", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataUltraBlurColors.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataUltraBlurColors.java index ba7d6681..7753ad63 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataUltraBlurColors.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataUltraBlurColors.java @@ -9,19 +9,22 @@ 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 GetMediaMetaDataUltraBlurColors { @JsonProperty("topLeft") private String topLeft; + @JsonProperty("topRight") private String topRight; + @JsonProperty("bottomRight") private String bottomRight; + @JsonProperty("bottomLeft") private String bottomLeft; @@ -61,9 +64,10 @@ public class GetMediaMetaDataUltraBlurColors { return bottomLeft; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaMetaDataUltraBlurColors withTopLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); @@ -89,7 +93,6 @@ public class GetMediaMetaDataUltraBlurColors { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -100,18 +103,16 @@ public class GetMediaMetaDataUltraBlurColors { } GetMediaMetaDataUltraBlurColors other = (GetMediaMetaDataUltraBlurColors) o; return - Objects.deepEquals(this.topLeft, other.topLeft) && - Objects.deepEquals(this.topRight, other.topRight) && - Objects.deepEquals(this.bottomRight, other.bottomRight) && - Objects.deepEquals(this.bottomLeft, other.bottomLeft); + Utils.enhancedDeepEquals(this.topLeft, other.topLeft) && + Utils.enhancedDeepEquals(this.topRight, other.topRight) && + Utils.enhancedDeepEquals(this.bottomRight, other.bottomRight) && + Utils.enhancedDeepEquals(this.bottomLeft, other.bottomLeft); } @Override public int hashCode() { - return Objects.hash( - topLeft, - topRight, - bottomRight, + return Utils.enhancedHash( + topLeft, topRight, bottomRight, bottomLeft); } @@ -123,51 +124,56 @@ public class GetMediaMetaDataUltraBlurColors { "bottomRight", bottomRight, "bottomLeft", bottomLeft); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String topLeft; - + private String topRight; - + private String bottomRight; - + private String bottomLeft; - + private Builder() { // force use of static builder() method } + public Builder topLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); this.topLeft = topLeft; return this; } + public Builder topRight(String topRight) { Utils.checkNotNull(topRight, "topRight"); this.topRight = topRight; return this; } + public Builder bottomRight(String bottomRight) { Utils.checkNotNull(bottomRight, "bottomRight"); this.bottomRight = bottomRight; return this; } + public Builder bottomLeft(String bottomLeft) { Utils.checkNotNull(bottomLeft, "bottomLeft"); this.bottomLeft = bottomLeft; return this; } - + public GetMediaMetaDataUltraBlurColors build() { + return new GetMediaMetaDataUltraBlurColors( - topLeft, - topRight, - bottomRight, + topLeft, topRight, bottomRight, bottomLeft); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataWriter.java index 672e1d94..8a60a18c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataWriter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaMetaDataWriter.java @@ -12,11 +12,10 @@ 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 GetMediaMetaDataWriter { +public class GetMediaMetaDataWriter { /** * Unique identifier for the writer. */ @@ -72,7 +71,8 @@ public class GetMediaMetaDataWriter { int id, String tag, String filter) { - this(id, tag, filter, Optional.empty(), Optional.empty()); + this(id, tag, filter, + Optional.empty(), Optional.empty()); } /** @@ -115,9 +115,10 @@ public class GetMediaMetaDataWriter { return tagKey; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the writer. @@ -155,6 +156,7 @@ public class GetMediaMetaDataWriter { return this; } + /** * The absolute URL of the thumbnail image for the writer. */ @@ -173,6 +175,7 @@ public class GetMediaMetaDataWriter { return this; } + /** * A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification. */ @@ -182,7 +185,6 @@ public class GetMediaMetaDataWriter { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -193,21 +195,18 @@ public class GetMediaMetaDataWriter { } GetMediaMetaDataWriter other = (GetMediaMetaDataWriter) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.tagKey, other.tagKey); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - filter, - thumb, - tagKey); + return Utils.enhancedHash( + id, tag, filter, + thumb, tagKey); } @Override @@ -219,23 +218,25 @@ public class GetMediaMetaDataWriter { "thumb", thumb, "tagKey", tagKey); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private String filter; - + private Optional thumb = Optional.empty(); - + private Optional tagKey = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the writer. */ @@ -245,6 +246,7 @@ public class GetMediaMetaDataWriter { return this; } + /** * The role of Writer */ @@ -254,6 +256,7 @@ public class GetMediaMetaDataWriter { return this; } + /** * The filter string used to query this writer. */ @@ -263,6 +266,7 @@ public class GetMediaMetaDataWriter { return this; } + /** * The absolute URL of the thumbnail image for the writer. */ @@ -281,6 +285,7 @@ public class GetMediaMetaDataWriter { return this; } + /** * A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification. */ @@ -298,14 +303,13 @@ public class GetMediaMetaDataWriter { this.tagKey = tagKey; return this; } - + public GetMediaMetaDataWriter build() { + return new GetMediaMetaDataWriter( - id, - tag, - filter, - thumb, - tagKey); + id, tag, filter, + thumb, tagKey); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersMediaContainer.java index 3e137c49..9f93c4c8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersMediaContainer.java @@ -12,10 +12,9 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; + public class GetMediaPostersMediaContainer { - /** * Number of media items returned in this response. */ @@ -40,6 +39,7 @@ public class GetMediaPostersMediaContainer { @JsonProperty("identifier") private String identifier; + @JsonProperty("Metadata") private List metadata; @@ -99,9 +99,10 @@ public class GetMediaPostersMediaContainer { return metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -145,7 +146,6 @@ public class GetMediaPostersMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -156,21 +156,18 @@ public class GetMediaPostersMediaContainer { } GetMediaPostersMediaContainer other = (GetMediaPostersMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - mediaTagVersion, - mediaTagPrefix, - identifier, - metadata); + return Utils.enhancedHash( + size, mediaTagVersion, mediaTagPrefix, + identifier, metadata); } @Override @@ -182,23 +179,25 @@ public class GetMediaPostersMediaContainer { "identifier", identifier, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Long mediaTagVersion; - + private String mediaTagPrefix; - + private String identifier; - + private List metadata; - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -208,6 +207,7 @@ public class GetMediaPostersMediaContainer { return this; } + /** * The version number for media tags. */ @@ -217,6 +217,7 @@ public class GetMediaPostersMediaContainer { return this; } + /** * The prefix used for media tag resource paths. */ @@ -226,6 +227,7 @@ public class GetMediaPostersMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -235,19 +237,19 @@ public class GetMediaPostersMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - + public GetMediaPostersMediaContainer build() { + return new GetMediaPostersMediaContainer( - size, - mediaTagVersion, - mediaTagPrefix, - identifier, - metadata); + size, mediaTagVersion, mediaTagPrefix, + identifier, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersMetadata.java index 4f716681..b2dff398 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersMetadata.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetMediaPostersMetadata { +public class GetMediaPostersMetadata { /** * The URL of the poster. */ @@ -72,7 +71,8 @@ public class GetMediaPostersMetadata { String ratingKey, boolean selected, String thumb) { - this(key, Optional.empty(), ratingKey, selected, thumb); + this(key, Optional.empty(), ratingKey, + selected, thumb); } /** @@ -115,9 +115,10 @@ public class GetMediaPostersMetadata { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The URL of the poster. @@ -137,6 +138,7 @@ public class GetMediaPostersMetadata { return this; } + /** * The provider of the poster. */ @@ -173,7 +175,6 @@ public class GetMediaPostersMetadata { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,21 +185,18 @@ public class GetMediaPostersMetadata { } GetMediaPostersMetadata other = (GetMediaPostersMetadata) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.provider, other.provider) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.selected, other.selected) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.provider, other.provider) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.selected, other.selected) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - key, - provider, - ratingKey, - selected, - thumb); + return Utils.enhancedHash( + key, provider, ratingKey, + selected, thumb); } @Override @@ -210,23 +208,25 @@ public class GetMediaPostersMetadata { "selected", selected, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String key; - + private Optional provider = Optional.empty(); - + private String ratingKey; - + private Boolean selected; - + private String thumb; - + private Builder() { // force use of static builder() method } + /** * The URL of the poster. */ @@ -236,6 +236,7 @@ public class GetMediaPostersMetadata { return this; } + /** * The provider of the poster. */ @@ -254,6 +255,7 @@ public class GetMediaPostersMetadata { return this; } + /** * The URL of the poster. */ @@ -263,6 +265,7 @@ public class GetMediaPostersMetadata { return this; } + /** * Whether this is the selected poster. */ @@ -272,6 +275,7 @@ public class GetMediaPostersMetadata { return this; } + /** * The URL of the poster thumbnail. */ @@ -280,14 +284,13 @@ public class GetMediaPostersMetadata { this.thumb = thumb; return this; } - + public GetMediaPostersMetadata build() { + return new GetMediaPostersMetadata( - key, - provider, - ratingKey, - selected, - thumb); + key, provider, ratingKey, + selected, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersRequest.java index 1e2906c5..8ca9add9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetMediaPostersRequest { - /** * the id of the library item to return the posters of. */ @@ -35,9 +34,10 @@ public class GetMediaPostersRequest { return ratingKey; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the id of the library item to return the posters of. @@ -48,7 +48,6 @@ public class GetMediaPostersRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,12 +58,12 @@ public class GetMediaPostersRequest { } GetMediaPostersRequest other = (GetMediaPostersRequest) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ratingKey); } @@ -73,15 +72,17 @@ public class GetMediaPostersRequest { return Utils.toString(GetMediaPostersRequest.class, "ratingKey", ratingKey); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long ratingKey; - + private Builder() { // force use of static builder() method } + /** * the id of the library item to return the posters of. */ @@ -90,10 +91,12 @@ public class GetMediaPostersRequest { this.ratingKey = ratingKey; return this; } - + public GetMediaPostersRequest build() { + return new GetMediaPostersRequest( ratingKey); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersRequestBuilder.java index 963f7a54..b4388597 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetMediaPosters; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -10,10 +14,10 @@ import java.lang.Long; public class GetMediaPostersRequestBuilder { private Long ratingKey; - private final SDKMethodInterfaces.MethodCallGetMediaPosters sdk; + private final SDKConfiguration sdkConfiguration; - public GetMediaPostersRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaPosters sdk) { - this.sdk = sdk; + public GetMediaPostersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetMediaPostersRequestBuilder ratingKey(long ratingKey) { @@ -22,9 +26,20 @@ public class GetMediaPostersRequestBuilder { return this; } - public GetMediaPostersResponse call() throws Exception { - return sdk.getMediaPosters( - ratingKey); + private GetMediaPostersRequest buildRequest() { + + GetMediaPostersRequest request = new GetMediaPostersRequest(ratingKey); + + return request; + } + + public GetMediaPostersResponse call() throws Exception { + + RequestOperation operation + = new GetMediaPosters.Sync(sdkConfiguration); + GetMediaPostersRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersResponse.java index b8418b60..0a67bb57 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetMediaPostersResponse implements Response { +public class GetMediaPostersResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetMediaPostersResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetMediaPostersResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetMediaPostersResponse implements Response { return this; } + /** * The available posters for the library item. */ @@ -143,7 +145,6 @@ public class GetMediaPostersResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetMediaPostersResponse implements Response { } GetMediaPostersResponse other = (GetMediaPostersResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetMediaPostersResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetMediaPostersResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetMediaPostersResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetMediaPostersResponse implements Response { return this; } + /** * The available posters for the library item. */ @@ -236,13 +240,13 @@ public class GetMediaPostersResponse implements Response { this.object = object; return this; } - + public GetMediaPostersResponse build() { + return new GetMediaPostersResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersResponseBody.java index 98e8c4ba..3de1dbee 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaPostersResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetMediaPostersResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaPostersResponseBody withMediaContainer(GetMediaPostersMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetMediaPostersResponseBody { return this; } + public GetMediaPostersResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetMediaPostersResponseBody { } GetMediaPostersResponseBody other = (GetMediaPostersResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetMediaPostersResponseBody { return Utils.toString(GetMediaPostersResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetMediaPostersMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetMediaPostersResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetMediaPostersResponseBody build() { + return new GetMediaPostersResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersDirectory.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersDirectory.java index 812f341b..992ce4d3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersDirectory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersDirectory.java @@ -15,63 +15,76 @@ 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 GetMediaProvidersDirectory { @JsonInclude(Include.NON_ABSENT) @JsonProperty("hubKey") private Optional hubKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("agent") private Optional agent; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("language") private Optional language; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("refreshing") private Optional refreshing; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("scanner") private Optional scanner; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("uuid") private Optional uuid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtype") private Optional subtype; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("scannedAt") private Optional scannedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Pivot") private Optional> pivot; @@ -123,7 +136,11 @@ public class GetMediaProvidersDirectory { } public GetMediaProvidersDirectory() { - 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()); + 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()); } @JsonIgnore @@ -197,9 +214,10 @@ public class GetMediaProvidersDirectory { return (Optional>) pivot; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaProvidersDirectory withHubKey(String hubKey) { Utils.checkNotNull(hubKey, "hubKey"); @@ -207,6 +225,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withHubKey(Optional hubKey) { Utils.checkNotNull(hubKey, "hubKey"); this.hubKey = hubKey; @@ -219,6 +238,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -231,6 +251,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withAgent(Optional agent) { Utils.checkNotNull(agent, "agent"); this.agent = agent; @@ -243,6 +264,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withLanguage(Optional language) { Utils.checkNotNull(language, "language"); this.language = language; @@ -255,6 +277,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withRefreshing(Optional refreshing) { Utils.checkNotNull(refreshing, "refreshing"); this.refreshing = refreshing; @@ -267,6 +290,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withScanner(Optional scanner) { Utils.checkNotNull(scanner, "scanner"); this.scanner = scanner; @@ -279,6 +303,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withUuid(Optional uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = uuid; @@ -291,6 +316,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -303,6 +329,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -315,6 +342,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -327,6 +355,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withSubtype(Optional subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = subtype; @@ -339,6 +368,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -351,6 +381,7 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withScannedAt(Optional scannedAt) { Utils.checkNotNull(scannedAt, "scannedAt"); this.scannedAt = scannedAt; @@ -363,13 +394,13 @@ public class GetMediaProvidersDirectory { return this; } + public GetMediaProvidersDirectory withPivot(Optional> pivot) { Utils.checkNotNull(pivot, "pivot"); this.pivot = pivot; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -380,39 +411,30 @@ public class GetMediaProvidersDirectory { } GetMediaProvidersDirectory other = (GetMediaProvidersDirectory) o; return - Objects.deepEquals(this.hubKey, other.hubKey) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.agent, other.agent) && - Objects.deepEquals(this.language, other.language) && - Objects.deepEquals(this.refreshing, other.refreshing) && - Objects.deepEquals(this.scanner, other.scanner) && - Objects.deepEquals(this.uuid, other.uuid) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.subtype, other.subtype) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.scannedAt, other.scannedAt) && - Objects.deepEquals(this.pivot, other.pivot); + Utils.enhancedDeepEquals(this.hubKey, other.hubKey) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.agent, other.agent) && + Utils.enhancedDeepEquals(this.language, other.language) && + Utils.enhancedDeepEquals(this.refreshing, other.refreshing) && + Utils.enhancedDeepEquals(this.scanner, other.scanner) && + Utils.enhancedDeepEquals(this.uuid, other.uuid) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.scannedAt, other.scannedAt) && + Utils.enhancedDeepEquals(this.pivot, other.pivot); } @Override public int hashCode() { - return Objects.hash( - hubKey, - title, - agent, - language, - refreshing, - scanner, - uuid, - id, - key, - type, - subtype, - updatedAt, - scannedAt, - pivot); + return Utils.enhancedHash( + hubKey, title, agent, + language, refreshing, scanner, + uuid, id, key, + type, subtype, updatedAt, + scannedAt, pivot); } @Override @@ -433,41 +455,43 @@ public class GetMediaProvidersDirectory { "scannedAt", scannedAt, "pivot", pivot); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional hubKey = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional agent = Optional.empty(); - + private Optional language = Optional.empty(); - + private Optional refreshing = Optional.empty(); - + private Optional scanner = Optional.empty(); - + private Optional uuid = Optional.empty(); - + private Optional id = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional subtype = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional scannedAt = Optional.empty(); - + private Optional> pivot = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder hubKey(String hubKey) { Utils.checkNotNull(hubKey, "hubKey"); this.hubKey = Optional.ofNullable(hubKey); @@ -480,6 +504,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -492,6 +517,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder agent(String agent) { Utils.checkNotNull(agent, "agent"); this.agent = Optional.ofNullable(agent); @@ -504,6 +530,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder language(String language) { Utils.checkNotNull(language, "language"); this.language = Optional.ofNullable(language); @@ -516,6 +543,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder refreshing(boolean refreshing) { Utils.checkNotNull(refreshing, "refreshing"); this.refreshing = Optional.ofNullable(refreshing); @@ -528,6 +556,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder scanner(String scanner) { Utils.checkNotNull(scanner, "scanner"); this.scanner = Optional.ofNullable(scanner); @@ -540,6 +569,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder uuid(String uuid) { Utils.checkNotNull(uuid, "uuid"); this.uuid = Optional.ofNullable(uuid); @@ -552,6 +582,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -564,6 +595,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -576,6 +608,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -588,6 +621,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder subtype(String subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = Optional.ofNullable(subtype); @@ -600,6 +634,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder updatedAt(long updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -612,6 +647,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder scannedAt(long scannedAt) { Utils.checkNotNull(scannedAt, "scannedAt"); this.scannedAt = Optional.ofNullable(scannedAt); @@ -624,6 +660,7 @@ public class GetMediaProvidersDirectory { return this; } + public Builder pivot(List pivot) { Utils.checkNotNull(pivot, "pivot"); this.pivot = Optional.ofNullable(pivot); @@ -635,23 +672,16 @@ public class GetMediaProvidersDirectory { this.pivot = pivot; return this; } - + public GetMediaProvidersDirectory build() { + return new GetMediaProvidersDirectory( - hubKey, - title, - agent, - language, - refreshing, - scanner, - uuid, - id, - key, - type, - subtype, - updatedAt, - scannedAt, - pivot); + hubKey, title, agent, + language, refreshing, scanner, + uuid, id, key, + type, subtype, updatedAt, + scannedAt, pivot); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersMediaContainer.java index c7cbdefb..97542cdb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersMediaContainer.java @@ -15,183 +15,226 @@ 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 GetMediaProvidersMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowCameraUpload") private Optional allowCameraUpload; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowChannelAccess") private Optional allowChannelAccess; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSharing") private Optional allowSharing; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowTuners") private Optional allowTuners; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("backgroundProcessing") private Optional backgroundProcessing; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("certificate") private Optional certificate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("companionProxy") private Optional companionProxy; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("countryCode") private Optional countryCode; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("diagnostics") private Optional diagnostics; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("eventStream") private Optional eventStream; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("friendlyName") private Optional friendlyName; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("livetv") private Optional livetv; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("machineIdentifier") private Optional machineIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("musicAnalysis") private Optional musicAnalysis; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlex") private Optional myPlex; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlexMappingState") private Optional myPlexMappingState; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlexSigninState") private Optional myPlexSigninState; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlexSubscription") private Optional myPlexSubscription; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlexUsername") private Optional myPlexUsername; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("offlineTranscode") private Optional offlineTranscode; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ownerFeatures") private Optional ownerFeatures; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("platform") private Optional platform; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("platformVersion") private Optional platformVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("pluginHost") private Optional pluginHost; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("pushNotifications") private Optional pushNotifications; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("readOnlyLibraries") private Optional readOnlyLibraries; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("streamingBrainABRVersion") private Optional streamingBrainABRVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("streamingBrainVersion") private Optional streamingBrainVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("sync") private Optional sync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderActiveVideoSessions") private Optional transcoderActiveVideoSessions; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderAudio") private Optional transcoderAudio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderLyrics") private Optional transcoderLyrics; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderSubtitles") private Optional transcoderSubtitles; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderVideo") private Optional transcoderVideo; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderVideoBitrates") private Optional transcoderVideoBitrates; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderVideoQualities") private Optional transcoderVideoQualities; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderVideoResolutions") private Optional transcoderVideoResolutions; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updater") private Optional updater; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("version") private Optional version; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("voiceSearch") private Optional voiceSearch; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("MediaProvider") private Optional> mediaProvider; @@ -333,7 +376,21 @@ public class GetMediaProvidersMediaContainer { } public GetMediaProvidersMediaContainer() { - 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()); + 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()); } @JsonIgnore @@ -557,9 +614,10 @@ public class GetMediaProvidersMediaContainer { return (Optional>) mediaProvider; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaProvidersMediaContainer withSize(long size) { Utils.checkNotNull(size, "size"); @@ -567,6 +625,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -579,6 +638,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withAllowCameraUpload(Optional allowCameraUpload) { Utils.checkNotNull(allowCameraUpload, "allowCameraUpload"); this.allowCameraUpload = allowCameraUpload; @@ -591,6 +651,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withAllowChannelAccess(Optional allowChannelAccess) { Utils.checkNotNull(allowChannelAccess, "allowChannelAccess"); this.allowChannelAccess = allowChannelAccess; @@ -603,6 +664,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withAllowSharing(Optional allowSharing) { Utils.checkNotNull(allowSharing, "allowSharing"); this.allowSharing = allowSharing; @@ -615,6 +677,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -627,6 +690,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withAllowTuners(Optional allowTuners) { Utils.checkNotNull(allowTuners, "allowTuners"); this.allowTuners = allowTuners; @@ -639,6 +703,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withBackgroundProcessing(Optional backgroundProcessing) { Utils.checkNotNull(backgroundProcessing, "backgroundProcessing"); this.backgroundProcessing = backgroundProcessing; @@ -651,6 +716,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withCertificate(Optional certificate) { Utils.checkNotNull(certificate, "certificate"); this.certificate = certificate; @@ -663,6 +729,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withCompanionProxy(Optional companionProxy) { Utils.checkNotNull(companionProxy, "companionProxy"); this.companionProxy = companionProxy; @@ -675,6 +742,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withCountryCode(Optional countryCode) { Utils.checkNotNull(countryCode, "countryCode"); this.countryCode = countryCode; @@ -687,6 +755,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withDiagnostics(Optional diagnostics) { Utils.checkNotNull(diagnostics, "diagnostics"); this.diagnostics = diagnostics; @@ -699,6 +768,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withEventStream(Optional eventStream) { Utils.checkNotNull(eventStream, "eventStream"); this.eventStream = eventStream; @@ -711,6 +781,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withFriendlyName(Optional friendlyName) { Utils.checkNotNull(friendlyName, "friendlyName"); this.friendlyName = friendlyName; @@ -723,6 +794,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withLivetv(Optional livetv) { Utils.checkNotNull(livetv, "livetv"); this.livetv = livetv; @@ -735,6 +807,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withMachineIdentifier(Optional machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = machineIdentifier; @@ -747,6 +820,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withMusicAnalysis(Optional musicAnalysis) { Utils.checkNotNull(musicAnalysis, "musicAnalysis"); this.musicAnalysis = musicAnalysis; @@ -759,6 +833,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withMyPlex(Optional myPlex) { Utils.checkNotNull(myPlex, "myPlex"); this.myPlex = myPlex; @@ -771,6 +846,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withMyPlexMappingState(Optional myPlexMappingState) { Utils.checkNotNull(myPlexMappingState, "myPlexMappingState"); this.myPlexMappingState = myPlexMappingState; @@ -783,6 +859,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withMyPlexSigninState(Optional myPlexSigninState) { Utils.checkNotNull(myPlexSigninState, "myPlexSigninState"); this.myPlexSigninState = myPlexSigninState; @@ -795,6 +872,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withMyPlexSubscription(Optional myPlexSubscription) { Utils.checkNotNull(myPlexSubscription, "myPlexSubscription"); this.myPlexSubscription = myPlexSubscription; @@ -807,6 +885,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withMyPlexUsername(Optional myPlexUsername) { Utils.checkNotNull(myPlexUsername, "myPlexUsername"); this.myPlexUsername = myPlexUsername; @@ -819,6 +898,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withOfflineTranscode(Optional offlineTranscode) { Utils.checkNotNull(offlineTranscode, "offlineTranscode"); this.offlineTranscode = offlineTranscode; @@ -831,6 +911,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withOwnerFeatures(Optional ownerFeatures) { Utils.checkNotNull(ownerFeatures, "ownerFeatures"); this.ownerFeatures = ownerFeatures; @@ -843,6 +924,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withPlatform(Optional platform) { Utils.checkNotNull(platform, "platform"); this.platform = platform; @@ -855,6 +937,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withPlatformVersion(Optional platformVersion) { Utils.checkNotNull(platformVersion, "platformVersion"); this.platformVersion = platformVersion; @@ -867,6 +950,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withPluginHost(Optional pluginHost) { Utils.checkNotNull(pluginHost, "pluginHost"); this.pluginHost = pluginHost; @@ -879,6 +963,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withPushNotifications(Optional pushNotifications) { Utils.checkNotNull(pushNotifications, "pushNotifications"); this.pushNotifications = pushNotifications; @@ -891,6 +976,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withReadOnlyLibraries(Optional readOnlyLibraries) { Utils.checkNotNull(readOnlyLibraries, "readOnlyLibraries"); this.readOnlyLibraries = readOnlyLibraries; @@ -903,6 +989,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withStreamingBrainABRVersion(Optional streamingBrainABRVersion) { Utils.checkNotNull(streamingBrainABRVersion, "streamingBrainABRVersion"); this.streamingBrainABRVersion = streamingBrainABRVersion; @@ -915,6 +1002,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withStreamingBrainVersion(Optional streamingBrainVersion) { Utils.checkNotNull(streamingBrainVersion, "streamingBrainVersion"); this.streamingBrainVersion = streamingBrainVersion; @@ -927,6 +1015,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withSync(Optional sync) { Utils.checkNotNull(sync, "sync"); this.sync = sync; @@ -939,6 +1028,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withTranscoderActiveVideoSessions(Optional transcoderActiveVideoSessions) { Utils.checkNotNull(transcoderActiveVideoSessions, "transcoderActiveVideoSessions"); this.transcoderActiveVideoSessions = transcoderActiveVideoSessions; @@ -951,6 +1041,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withTranscoderAudio(Optional transcoderAudio) { Utils.checkNotNull(transcoderAudio, "transcoderAudio"); this.transcoderAudio = transcoderAudio; @@ -963,6 +1054,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withTranscoderLyrics(Optional transcoderLyrics) { Utils.checkNotNull(transcoderLyrics, "transcoderLyrics"); this.transcoderLyrics = transcoderLyrics; @@ -975,6 +1067,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withTranscoderSubtitles(Optional transcoderSubtitles) { Utils.checkNotNull(transcoderSubtitles, "transcoderSubtitles"); this.transcoderSubtitles = transcoderSubtitles; @@ -987,6 +1080,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withTranscoderVideo(Optional transcoderVideo) { Utils.checkNotNull(transcoderVideo, "transcoderVideo"); this.transcoderVideo = transcoderVideo; @@ -999,6 +1093,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withTranscoderVideoBitrates(Optional transcoderVideoBitrates) { Utils.checkNotNull(transcoderVideoBitrates, "transcoderVideoBitrates"); this.transcoderVideoBitrates = transcoderVideoBitrates; @@ -1011,6 +1106,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withTranscoderVideoQualities(Optional transcoderVideoQualities) { Utils.checkNotNull(transcoderVideoQualities, "transcoderVideoQualities"); this.transcoderVideoQualities = transcoderVideoQualities; @@ -1023,6 +1119,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withTranscoderVideoResolutions(Optional transcoderVideoResolutions) { Utils.checkNotNull(transcoderVideoResolutions, "transcoderVideoResolutions"); this.transcoderVideoResolutions = transcoderVideoResolutions; @@ -1035,6 +1132,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -1047,6 +1145,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withUpdater(Optional updater) { Utils.checkNotNull(updater, "updater"); this.updater = updater; @@ -1059,6 +1158,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withVersion(Optional version) { Utils.checkNotNull(version, "version"); this.version = version; @@ -1071,6 +1171,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withVoiceSearch(Optional voiceSearch) { Utils.checkNotNull(voiceSearch, "voiceSearch"); this.voiceSearch = voiceSearch; @@ -1083,13 +1184,13 @@ public class GetMediaProvidersMediaContainer { return this; } + public GetMediaProvidersMediaContainer withMediaProvider(Optional> mediaProvider) { Utils.checkNotNull(mediaProvider, "mediaProvider"); this.mediaProvider = mediaProvider; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1100,99 +1201,70 @@ public class GetMediaProvidersMediaContainer { } GetMediaProvidersMediaContainer other = (GetMediaProvidersMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowCameraUpload, other.allowCameraUpload) && - Objects.deepEquals(this.allowChannelAccess, other.allowChannelAccess) && - Objects.deepEquals(this.allowSharing, other.allowSharing) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.allowTuners, other.allowTuners) && - Objects.deepEquals(this.backgroundProcessing, other.backgroundProcessing) && - Objects.deepEquals(this.certificate, other.certificate) && - Objects.deepEquals(this.companionProxy, other.companionProxy) && - Objects.deepEquals(this.countryCode, other.countryCode) && - Objects.deepEquals(this.diagnostics, other.diagnostics) && - Objects.deepEquals(this.eventStream, other.eventStream) && - Objects.deepEquals(this.friendlyName, other.friendlyName) && - Objects.deepEquals(this.livetv, other.livetv) && - Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) && - Objects.deepEquals(this.musicAnalysis, other.musicAnalysis) && - Objects.deepEquals(this.myPlex, other.myPlex) && - Objects.deepEquals(this.myPlexMappingState, other.myPlexMappingState) && - Objects.deepEquals(this.myPlexSigninState, other.myPlexSigninState) && - Objects.deepEquals(this.myPlexSubscription, other.myPlexSubscription) && - Objects.deepEquals(this.myPlexUsername, other.myPlexUsername) && - Objects.deepEquals(this.offlineTranscode, other.offlineTranscode) && - Objects.deepEquals(this.ownerFeatures, other.ownerFeatures) && - Objects.deepEquals(this.platform, other.platform) && - Objects.deepEquals(this.platformVersion, other.platformVersion) && - Objects.deepEquals(this.pluginHost, other.pluginHost) && - Objects.deepEquals(this.pushNotifications, other.pushNotifications) && - Objects.deepEquals(this.readOnlyLibraries, other.readOnlyLibraries) && - Objects.deepEquals(this.streamingBrainABRVersion, other.streamingBrainABRVersion) && - Objects.deepEquals(this.streamingBrainVersion, other.streamingBrainVersion) && - Objects.deepEquals(this.sync, other.sync) && - Objects.deepEquals(this.transcoderActiveVideoSessions, other.transcoderActiveVideoSessions) && - Objects.deepEquals(this.transcoderAudio, other.transcoderAudio) && - Objects.deepEquals(this.transcoderLyrics, other.transcoderLyrics) && - Objects.deepEquals(this.transcoderSubtitles, other.transcoderSubtitles) && - Objects.deepEquals(this.transcoderVideo, other.transcoderVideo) && - Objects.deepEquals(this.transcoderVideoBitrates, other.transcoderVideoBitrates) && - Objects.deepEquals(this.transcoderVideoQualities, other.transcoderVideoQualities) && - Objects.deepEquals(this.transcoderVideoResolutions, other.transcoderVideoResolutions) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.updater, other.updater) && - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.voiceSearch, other.voiceSearch) && - Objects.deepEquals(this.mediaProvider, other.mediaProvider); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowCameraUpload, other.allowCameraUpload) && + Utils.enhancedDeepEquals(this.allowChannelAccess, other.allowChannelAccess) && + Utils.enhancedDeepEquals(this.allowSharing, other.allowSharing) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.allowTuners, other.allowTuners) && + Utils.enhancedDeepEquals(this.backgroundProcessing, other.backgroundProcessing) && + Utils.enhancedDeepEquals(this.certificate, other.certificate) && + Utils.enhancedDeepEquals(this.companionProxy, other.companionProxy) && + Utils.enhancedDeepEquals(this.countryCode, other.countryCode) && + Utils.enhancedDeepEquals(this.diagnostics, other.diagnostics) && + Utils.enhancedDeepEquals(this.eventStream, other.eventStream) && + Utils.enhancedDeepEquals(this.friendlyName, other.friendlyName) && + Utils.enhancedDeepEquals(this.livetv, other.livetv) && + Utils.enhancedDeepEquals(this.machineIdentifier, other.machineIdentifier) && + Utils.enhancedDeepEquals(this.musicAnalysis, other.musicAnalysis) && + Utils.enhancedDeepEquals(this.myPlex, other.myPlex) && + Utils.enhancedDeepEquals(this.myPlexMappingState, other.myPlexMappingState) && + Utils.enhancedDeepEquals(this.myPlexSigninState, other.myPlexSigninState) && + Utils.enhancedDeepEquals(this.myPlexSubscription, other.myPlexSubscription) && + Utils.enhancedDeepEquals(this.myPlexUsername, other.myPlexUsername) && + Utils.enhancedDeepEquals(this.offlineTranscode, other.offlineTranscode) && + Utils.enhancedDeepEquals(this.ownerFeatures, other.ownerFeatures) && + Utils.enhancedDeepEquals(this.platform, other.platform) && + Utils.enhancedDeepEquals(this.platformVersion, other.platformVersion) && + Utils.enhancedDeepEquals(this.pluginHost, other.pluginHost) && + Utils.enhancedDeepEquals(this.pushNotifications, other.pushNotifications) && + Utils.enhancedDeepEquals(this.readOnlyLibraries, other.readOnlyLibraries) && + Utils.enhancedDeepEquals(this.streamingBrainABRVersion, other.streamingBrainABRVersion) && + Utils.enhancedDeepEquals(this.streamingBrainVersion, other.streamingBrainVersion) && + Utils.enhancedDeepEquals(this.sync, other.sync) && + Utils.enhancedDeepEquals(this.transcoderActiveVideoSessions, other.transcoderActiveVideoSessions) && + Utils.enhancedDeepEquals(this.transcoderAudio, other.transcoderAudio) && + Utils.enhancedDeepEquals(this.transcoderLyrics, other.transcoderLyrics) && + Utils.enhancedDeepEquals(this.transcoderSubtitles, other.transcoderSubtitles) && + Utils.enhancedDeepEquals(this.transcoderVideo, other.transcoderVideo) && + Utils.enhancedDeepEquals(this.transcoderVideoBitrates, other.transcoderVideoBitrates) && + Utils.enhancedDeepEquals(this.transcoderVideoQualities, other.transcoderVideoQualities) && + Utils.enhancedDeepEquals(this.transcoderVideoResolutions, other.transcoderVideoResolutions) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.updater, other.updater) && + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.voiceSearch, other.voiceSearch) && + Utils.enhancedDeepEquals(this.mediaProvider, other.mediaProvider); } @Override public int hashCode() { - return Objects.hash( - size, - allowCameraUpload, - allowChannelAccess, - allowSharing, - allowSync, - allowTuners, - backgroundProcessing, - certificate, - companionProxy, - countryCode, - diagnostics, - eventStream, - friendlyName, - livetv, - machineIdentifier, - musicAnalysis, - myPlex, - myPlexMappingState, - myPlexSigninState, - myPlexSubscription, - myPlexUsername, - offlineTranscode, - ownerFeatures, - platform, - platformVersion, - pluginHost, - pushNotifications, - readOnlyLibraries, - streamingBrainABRVersion, - streamingBrainVersion, - sync, - transcoderActiveVideoSessions, - transcoderAudio, - transcoderLyrics, - transcoderSubtitles, - transcoderVideo, - transcoderVideoBitrates, - transcoderVideoQualities, - transcoderVideoResolutions, - updatedAt, - updater, - version, - voiceSearch, - mediaProvider); + return Utils.enhancedHash( + size, allowCameraUpload, allowChannelAccess, + allowSharing, allowSync, allowTuners, + backgroundProcessing, certificate, companionProxy, + countryCode, diagnostics, eventStream, + friendlyName, livetv, machineIdentifier, + musicAnalysis, myPlex, myPlexMappingState, + myPlexSigninState, myPlexSubscription, myPlexUsername, + offlineTranscode, ownerFeatures, platform, + platformVersion, pluginHost, pushNotifications, + readOnlyLibraries, streamingBrainABRVersion, streamingBrainVersion, + sync, transcoderActiveVideoSessions, transcoderAudio, + transcoderLyrics, transcoderSubtitles, transcoderVideo, + transcoderVideoBitrates, transcoderVideoQualities, transcoderVideoResolutions, + updatedAt, updater, version, + voiceSearch, mediaProvider); } @Override @@ -1243,101 +1315,103 @@ public class GetMediaProvidersMediaContainer { "voiceSearch", voiceSearch, "mediaProvider", mediaProvider); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional allowCameraUpload = Optional.empty(); - + private Optional allowChannelAccess = Optional.empty(); - + private Optional allowSharing = Optional.empty(); - + private Optional allowSync = Optional.empty(); - + private Optional allowTuners = Optional.empty(); - + private Optional backgroundProcessing = Optional.empty(); - + private Optional certificate = Optional.empty(); - + private Optional companionProxy = Optional.empty(); - + private Optional countryCode = Optional.empty(); - + private Optional diagnostics = Optional.empty(); - + private Optional eventStream = Optional.empty(); - + private Optional friendlyName = Optional.empty(); - + private Optional livetv = Optional.empty(); - + private Optional machineIdentifier = Optional.empty(); - + private Optional musicAnalysis = Optional.empty(); - + private Optional myPlex = Optional.empty(); - + private Optional myPlexMappingState = Optional.empty(); - + private Optional myPlexSigninState = Optional.empty(); - + private Optional myPlexSubscription = Optional.empty(); - + private Optional myPlexUsername = Optional.empty(); - + private Optional offlineTranscode = Optional.empty(); - + private Optional ownerFeatures = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Optional platformVersion = Optional.empty(); - + private Optional pluginHost = Optional.empty(); - + private Optional pushNotifications = Optional.empty(); - + private Optional readOnlyLibraries = Optional.empty(); - + private Optional streamingBrainABRVersion = Optional.empty(); - + private Optional streamingBrainVersion = Optional.empty(); - + private Optional sync = Optional.empty(); - + private Optional transcoderActiveVideoSessions = Optional.empty(); - + private Optional transcoderAudio = Optional.empty(); - + private Optional transcoderLyrics = Optional.empty(); - + private Optional transcoderSubtitles = Optional.empty(); - + private Optional transcoderVideo = Optional.empty(); - + private Optional transcoderVideoBitrates = Optional.empty(); - + private Optional transcoderVideoQualities = Optional.empty(); - + private Optional transcoderVideoResolutions = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional updater = Optional.empty(); - + private Optional version = Optional.empty(); - + private Optional voiceSearch = Optional.empty(); - + private Optional> mediaProvider = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(long size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -1350,6 +1424,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder allowCameraUpload(boolean allowCameraUpload) { Utils.checkNotNull(allowCameraUpload, "allowCameraUpload"); this.allowCameraUpload = Optional.ofNullable(allowCameraUpload); @@ -1362,6 +1437,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder allowChannelAccess(boolean allowChannelAccess) { Utils.checkNotNull(allowChannelAccess, "allowChannelAccess"); this.allowChannelAccess = Optional.ofNullable(allowChannelAccess); @@ -1374,6 +1450,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder allowSharing(boolean allowSharing) { Utils.checkNotNull(allowSharing, "allowSharing"); this.allowSharing = Optional.ofNullable(allowSharing); @@ -1386,6 +1463,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -1398,6 +1476,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder allowTuners(boolean allowTuners) { Utils.checkNotNull(allowTuners, "allowTuners"); this.allowTuners = Optional.ofNullable(allowTuners); @@ -1410,6 +1489,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder backgroundProcessing(boolean backgroundProcessing) { Utils.checkNotNull(backgroundProcessing, "backgroundProcessing"); this.backgroundProcessing = Optional.ofNullable(backgroundProcessing); @@ -1422,6 +1502,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder certificate(boolean certificate) { Utils.checkNotNull(certificate, "certificate"); this.certificate = Optional.ofNullable(certificate); @@ -1434,6 +1515,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder companionProxy(boolean companionProxy) { Utils.checkNotNull(companionProxy, "companionProxy"); this.companionProxy = Optional.ofNullable(companionProxy); @@ -1446,6 +1528,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder countryCode(String countryCode) { Utils.checkNotNull(countryCode, "countryCode"); this.countryCode = Optional.ofNullable(countryCode); @@ -1458,6 +1541,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder diagnostics(String diagnostics) { Utils.checkNotNull(diagnostics, "diagnostics"); this.diagnostics = Optional.ofNullable(diagnostics); @@ -1470,6 +1554,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder eventStream(boolean eventStream) { Utils.checkNotNull(eventStream, "eventStream"); this.eventStream = Optional.ofNullable(eventStream); @@ -1482,6 +1567,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder friendlyName(String friendlyName) { Utils.checkNotNull(friendlyName, "friendlyName"); this.friendlyName = Optional.ofNullable(friendlyName); @@ -1494,6 +1580,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder livetv(long livetv) { Utils.checkNotNull(livetv, "livetv"); this.livetv = Optional.ofNullable(livetv); @@ -1506,6 +1593,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder machineIdentifier(String machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = Optional.ofNullable(machineIdentifier); @@ -1518,6 +1606,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder musicAnalysis(long musicAnalysis) { Utils.checkNotNull(musicAnalysis, "musicAnalysis"); this.musicAnalysis = Optional.ofNullable(musicAnalysis); @@ -1530,6 +1619,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder myPlex(boolean myPlex) { Utils.checkNotNull(myPlex, "myPlex"); this.myPlex = Optional.ofNullable(myPlex); @@ -1542,6 +1632,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder myPlexMappingState(String myPlexMappingState) { Utils.checkNotNull(myPlexMappingState, "myPlexMappingState"); this.myPlexMappingState = Optional.ofNullable(myPlexMappingState); @@ -1554,6 +1645,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder myPlexSigninState(String myPlexSigninState) { Utils.checkNotNull(myPlexSigninState, "myPlexSigninState"); this.myPlexSigninState = Optional.ofNullable(myPlexSigninState); @@ -1566,6 +1658,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder myPlexSubscription(boolean myPlexSubscription) { Utils.checkNotNull(myPlexSubscription, "myPlexSubscription"); this.myPlexSubscription = Optional.ofNullable(myPlexSubscription); @@ -1578,6 +1671,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder myPlexUsername(String myPlexUsername) { Utils.checkNotNull(myPlexUsername, "myPlexUsername"); this.myPlexUsername = Optional.ofNullable(myPlexUsername); @@ -1590,6 +1684,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder offlineTranscode(long offlineTranscode) { Utils.checkNotNull(offlineTranscode, "offlineTranscode"); this.offlineTranscode = Optional.ofNullable(offlineTranscode); @@ -1602,6 +1697,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder ownerFeatures(String ownerFeatures) { Utils.checkNotNull(ownerFeatures, "ownerFeatures"); this.ownerFeatures = Optional.ofNullable(ownerFeatures); @@ -1614,6 +1710,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder platform(String platform) { Utils.checkNotNull(platform, "platform"); this.platform = Optional.ofNullable(platform); @@ -1626,6 +1723,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder platformVersion(String platformVersion) { Utils.checkNotNull(platformVersion, "platformVersion"); this.platformVersion = Optional.ofNullable(platformVersion); @@ -1638,6 +1736,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder pluginHost(boolean pluginHost) { Utils.checkNotNull(pluginHost, "pluginHost"); this.pluginHost = Optional.ofNullable(pluginHost); @@ -1650,6 +1749,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder pushNotifications(boolean pushNotifications) { Utils.checkNotNull(pushNotifications, "pushNotifications"); this.pushNotifications = Optional.ofNullable(pushNotifications); @@ -1662,6 +1762,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder readOnlyLibraries(boolean readOnlyLibraries) { Utils.checkNotNull(readOnlyLibraries, "readOnlyLibraries"); this.readOnlyLibraries = Optional.ofNullable(readOnlyLibraries); @@ -1674,6 +1775,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder streamingBrainABRVersion(long streamingBrainABRVersion) { Utils.checkNotNull(streamingBrainABRVersion, "streamingBrainABRVersion"); this.streamingBrainABRVersion = Optional.ofNullable(streamingBrainABRVersion); @@ -1686,6 +1788,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder streamingBrainVersion(long streamingBrainVersion) { Utils.checkNotNull(streamingBrainVersion, "streamingBrainVersion"); this.streamingBrainVersion = Optional.ofNullable(streamingBrainVersion); @@ -1698,6 +1801,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder sync(boolean sync) { Utils.checkNotNull(sync, "sync"); this.sync = Optional.ofNullable(sync); @@ -1710,6 +1814,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder transcoderActiveVideoSessions(long transcoderActiveVideoSessions) { Utils.checkNotNull(transcoderActiveVideoSessions, "transcoderActiveVideoSessions"); this.transcoderActiveVideoSessions = Optional.ofNullable(transcoderActiveVideoSessions); @@ -1722,6 +1827,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder transcoderAudio(boolean transcoderAudio) { Utils.checkNotNull(transcoderAudio, "transcoderAudio"); this.transcoderAudio = Optional.ofNullable(transcoderAudio); @@ -1734,6 +1840,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder transcoderLyrics(boolean transcoderLyrics) { Utils.checkNotNull(transcoderLyrics, "transcoderLyrics"); this.transcoderLyrics = Optional.ofNullable(transcoderLyrics); @@ -1746,6 +1853,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder transcoderSubtitles(boolean transcoderSubtitles) { Utils.checkNotNull(transcoderSubtitles, "transcoderSubtitles"); this.transcoderSubtitles = Optional.ofNullable(transcoderSubtitles); @@ -1758,6 +1866,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder transcoderVideo(boolean transcoderVideo) { Utils.checkNotNull(transcoderVideo, "transcoderVideo"); this.transcoderVideo = Optional.ofNullable(transcoderVideo); @@ -1770,6 +1879,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder transcoderVideoBitrates(String transcoderVideoBitrates) { Utils.checkNotNull(transcoderVideoBitrates, "transcoderVideoBitrates"); this.transcoderVideoBitrates = Optional.ofNullable(transcoderVideoBitrates); @@ -1782,6 +1892,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder transcoderVideoQualities(String transcoderVideoQualities) { Utils.checkNotNull(transcoderVideoQualities, "transcoderVideoQualities"); this.transcoderVideoQualities = Optional.ofNullable(transcoderVideoQualities); @@ -1794,6 +1905,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder transcoderVideoResolutions(String transcoderVideoResolutions) { Utils.checkNotNull(transcoderVideoResolutions, "transcoderVideoResolutions"); this.transcoderVideoResolutions = Optional.ofNullable(transcoderVideoResolutions); @@ -1806,6 +1918,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder updatedAt(long updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -1818,6 +1931,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder updater(boolean updater) { Utils.checkNotNull(updater, "updater"); this.updater = Optional.ofNullable(updater); @@ -1830,6 +1944,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder version(String version) { Utils.checkNotNull(version, "version"); this.version = Optional.ofNullable(version); @@ -1842,6 +1957,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder voiceSearch(boolean voiceSearch) { Utils.checkNotNull(voiceSearch, "voiceSearch"); this.voiceSearch = Optional.ofNullable(voiceSearch); @@ -1854,6 +1970,7 @@ public class GetMediaProvidersMediaContainer { return this; } + public Builder mediaProvider(List mediaProvider) { Utils.checkNotNull(mediaProvider, "mediaProvider"); this.mediaProvider = Optional.ofNullable(mediaProvider); @@ -1865,53 +1982,26 @@ public class GetMediaProvidersMediaContainer { this.mediaProvider = mediaProvider; return this; } - + public GetMediaProvidersMediaContainer build() { + return new GetMediaProvidersMediaContainer( - size, - allowCameraUpload, - allowChannelAccess, - allowSharing, - allowSync, - allowTuners, - backgroundProcessing, - certificate, - companionProxy, - countryCode, - diagnostics, - eventStream, - friendlyName, - livetv, - machineIdentifier, - musicAnalysis, - myPlex, - myPlexMappingState, - myPlexSigninState, - myPlexSubscription, - myPlexUsername, - offlineTranscode, - ownerFeatures, - platform, - platformVersion, - pluginHost, - pushNotifications, - readOnlyLibraries, - streamingBrainABRVersion, - streamingBrainVersion, - sync, - transcoderActiveVideoSessions, - transcoderAudio, - transcoderLyrics, - transcoderSubtitles, - transcoderVideo, - transcoderVideoBitrates, - transcoderVideoQualities, - transcoderVideoResolutions, - updatedAt, - updater, - version, - voiceSearch, - mediaProvider); + size, allowCameraUpload, allowChannelAccess, + allowSharing, allowSync, allowTuners, + backgroundProcessing, certificate, companionProxy, + countryCode, diagnostics, eventStream, + friendlyName, livetv, machineIdentifier, + musicAnalysis, myPlex, myPlexMappingState, + myPlexSigninState, myPlexSubscription, myPlexUsername, + offlineTranscode, ownerFeatures, platform, + platformVersion, pluginHost, pushNotifications, + readOnlyLibraries, streamingBrainABRVersion, streamingBrainVersion, + sync, transcoderActiveVideoSessions, transcoderAudio, + transcoderLyrics, transcoderSubtitles, transcoderVideo, + transcoderVideoBitrates, transcoderVideoQualities, transcoderVideoResolutions, + updatedAt, updater, version, + voiceSearch, mediaProvider); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequest.java index 177ab567..8d522b78 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetMediaProvidersRequest { - /** * An authentication token, obtained from plex.tv */ @@ -34,9 +33,10 @@ public class GetMediaProvidersRequest { return xPlexToken; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * An authentication token, obtained from plex.tv @@ -47,7 +47,6 @@ public class GetMediaProvidersRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetMediaProvidersRequest { } GetMediaProvidersRequest other = (GetMediaProvidersRequest) o; return - Objects.deepEquals(this.xPlexToken, other.xPlexToken); + Utils.enhancedDeepEquals(this.xPlexToken, other.xPlexToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( xPlexToken); } @@ -72,15 +71,17 @@ public class GetMediaProvidersRequest { return Utils.toString(GetMediaProvidersRequest.class, "xPlexToken", xPlexToken); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String xPlexToken; - + private Builder() { // force use of static builder() method } + /** * An authentication token, obtained from plex.tv */ @@ -89,10 +90,12 @@ public class GetMediaProvidersRequest { this.xPlexToken = xPlexToken; return this; } - + public GetMediaProvidersRequest build() { + return new GetMediaProvidersRequest( xPlexToken); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java index c5732ef5..8a67c19c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetMediaProviders; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ import java.lang.String; public class GetMediaProvidersRequestBuilder { private String xPlexToken; - private final SDKMethodInterfaces.MethodCallGetMediaProviders sdk; + private final SDKConfiguration sdkConfiguration; - public GetMediaProvidersRequestBuilder(SDKMethodInterfaces.MethodCallGetMediaProviders sdk) { - this.sdk = sdk; + public GetMediaProvidersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetMediaProvidersRequestBuilder xPlexToken(String xPlexToken) { @@ -22,9 +26,20 @@ public class GetMediaProvidersRequestBuilder { return this; } - public GetMediaProvidersResponse call() throws Exception { - return sdk.getMediaProviders( - xPlexToken); + private GetMediaProvidersRequest buildRequest() { + + GetMediaProvidersRequest request = new GetMediaProvidersRequest(xPlexToken); + + return request; + } + + public GetMediaProvidersResponse call() throws Exception { + + RequestOperation operation + = new GetMediaProviders.Sync(sdkConfiguration); + GetMediaProvidersRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersResponse.java index c1117515..8c63c210 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetMediaProvidersResponse implements Response { +public class GetMediaProvidersResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetMediaProvidersResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetMediaProvidersResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetMediaProvidersResponse implements Response { return this; } + /** * Media providers and their features */ @@ -143,7 +145,6 @@ public class GetMediaProvidersResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetMediaProvidersResponse implements Response { } GetMediaProvidersResponse other = (GetMediaProvidersResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetMediaProvidersResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetMediaProvidersResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetMediaProvidersResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetMediaProvidersResponse implements Response { return this; } + /** * Media providers and their features */ @@ -236,13 +240,13 @@ public class GetMediaProvidersResponse implements Response { this.object = object; return this; } - + public GetMediaProvidersResponse build() { + return new GetMediaProvidersResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersResponseBody.java index d81399ae..75c0a4d4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMediaProvidersResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetMediaProvidersResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMediaProvidersResponseBody withMediaContainer(GetMediaProvidersMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetMediaProvidersResponseBody { return this; } + public GetMediaProvidersResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetMediaProvidersResponseBody { } GetMediaProvidersResponseBody other = (GetMediaProvidersResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetMediaProvidersResponseBody { return Utils.toString(GetMediaProvidersResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetMediaProvidersMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetMediaProvidersResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetMediaProvidersResponseBody build() { + return new GetMediaProvidersResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenDirectory.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenDirectory.java index d7859a5b..5e9ef6aa 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenDirectory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenDirectory.java @@ -12,27 +12,31 @@ 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 GetMetadataChildrenDirectory { @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewedLeafCount") private Optional viewedLeafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; @@ -57,7 +61,8 @@ public class GetMetadataChildrenDirectory { } public GetMetadataChildrenDirectory() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -85,9 +90,10 @@ public class GetMetadataChildrenDirectory { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMetadataChildrenDirectory withLeafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); @@ -95,6 +101,7 @@ public class GetMetadataChildrenDirectory { return this; } + public GetMetadataChildrenDirectory withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -107,6 +114,7 @@ public class GetMetadataChildrenDirectory { return this; } + public GetMetadataChildrenDirectory withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -119,6 +127,7 @@ public class GetMetadataChildrenDirectory { return this; } + public GetMetadataChildrenDirectory withViewedLeafCount(Optional viewedLeafCount) { Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); this.viewedLeafCount = viewedLeafCount; @@ -131,6 +140,7 @@ public class GetMetadataChildrenDirectory { return this; } + public GetMetadataChildrenDirectory withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -143,13 +153,13 @@ public class GetMetadataChildrenDirectory { return this; } + public GetMetadataChildrenDirectory withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,21 +170,18 @@ public class GetMetadataChildrenDirectory { } GetMetadataChildrenDirectory other = (GetMetadataChildrenDirectory) o; return - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - leafCount, - thumb, - viewedLeafCount, - key, - title); + return Utils.enhancedHash( + leafCount, thumb, viewedLeafCount, + key, title); } @Override @@ -186,23 +193,25 @@ public class GetMetadataChildrenDirectory { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional leafCount = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional viewedLeafCount = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -215,6 +224,7 @@ public class GetMetadataChildrenDirectory { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -227,6 +237,7 @@ public class GetMetadataChildrenDirectory { return this; } + public Builder viewedLeafCount(int viewedLeafCount) { Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); this.viewedLeafCount = Optional.ofNullable(viewedLeafCount); @@ -239,6 +250,7 @@ public class GetMetadataChildrenDirectory { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -251,6 +263,7 @@ public class GetMetadataChildrenDirectory { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -262,14 +275,13 @@ public class GetMetadataChildrenDirectory { this.title = title; return this; } - + public GetMetadataChildrenDirectory build() { + return new GetMetadataChildrenDirectory( - leafCount, - thumb, - viewedLeafCount, - key, - title); + leafCount, thumb, viewedLeafCount, + key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenMediaContainer.java index 55387f87..a456fc80 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenMediaContainer.java @@ -15,99 +15,121 @@ 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 GetMetadataChildrenMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionUUID") private Optional librarySectionUUID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagPrefix") private Optional mediaTagPrefix; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagVersion") private Optional mediaTagVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("nocache") private Optional nocache; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentIndex") private Optional parentIndex; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentTitle") private Optional parentTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentYear") private Optional parentYear; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("theme") private Optional theme; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title1") private Optional title1; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title2") private Optional title2; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewGroup") private Optional viewGroup; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewMode") private Optional viewMode; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Directory") private Optional> directory; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -186,7 +208,14 @@ public class GetMetadataChildrenMediaContainer { } public GetMetadataChildrenMediaContainer() { - 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()); + 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()); } @JsonIgnore @@ -306,9 +335,10 @@ public class GetMetadataChildrenMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMetadataChildrenMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -316,6 +346,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -328,6 +359,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -340,6 +372,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -352,6 +385,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -364,6 +398,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -376,6 +411,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -388,6 +424,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -400,6 +437,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withLibrarySectionUUID(Optional librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = librarySectionUUID; @@ -412,6 +450,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withMediaTagPrefix(Optional mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = mediaTagPrefix; @@ -424,6 +463,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withMediaTagVersion(Optional mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = mediaTagVersion; @@ -436,6 +476,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withNocache(Optional nocache) { Utils.checkNotNull(nocache, "nocache"); this.nocache = nocache; @@ -448,6 +489,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withParentIndex(Optional parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = parentIndex; @@ -460,6 +502,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withParentTitle(Optional parentTitle) { Utils.checkNotNull(parentTitle, "parentTitle"); this.parentTitle = parentTitle; @@ -472,6 +515,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withParentYear(Optional parentYear) { Utils.checkNotNull(parentYear, "parentYear"); this.parentYear = parentYear; @@ -484,6 +528,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -496,6 +541,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withTheme(Optional theme) { Utils.checkNotNull(theme, "theme"); this.theme = theme; @@ -508,6 +554,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -520,6 +567,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withTitle1(Optional title1) { Utils.checkNotNull(title1, "title1"); this.title1 = title1; @@ -532,6 +580,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withTitle2(Optional title2) { Utils.checkNotNull(title2, "title2"); this.title2 = title2; @@ -544,6 +593,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withViewGroup(Optional viewGroup) { Utils.checkNotNull(viewGroup, "viewGroup"); this.viewGroup = viewGroup; @@ -556,6 +606,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withViewMode(Optional viewMode) { Utils.checkNotNull(viewMode, "viewMode"); this.viewMode = viewMode; @@ -568,6 +619,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withDirectory(Optional> directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; @@ -580,13 +632,13 @@ public class GetMetadataChildrenMediaContainer { return this; } + public GetMetadataChildrenMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -597,57 +649,42 @@ public class GetMetadataChildrenMediaContainer { } GetMetadataChildrenMediaContainer other = (GetMetadataChildrenMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.nocache, other.nocache) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.parentYear, other.parentYear) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.theme, other.theme) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title1, other.title1) && - Objects.deepEquals(this.title2, other.title2) && - Objects.deepEquals(this.viewGroup, other.viewGroup) && - Objects.deepEquals(this.viewMode, other.viewMode) && - Objects.deepEquals(this.directory, other.directory) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionUUID, other.librarySectionUUID) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.nocache, other.nocache) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.parentYear, other.parentYear) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.theme, other.theme) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title1, other.title1) && + Utils.enhancedDeepEquals(this.title2, other.title2) && + Utils.enhancedDeepEquals(this.viewGroup, other.viewGroup) && + Utils.enhancedDeepEquals(this.viewMode, other.viewMode) && + Utils.enhancedDeepEquals(this.directory, other.directory) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - art, - identifier, - key, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - nocache, - parentIndex, - parentTitle, - parentYear, - summary, - theme, - thumb, - title1, - title2, - viewGroup, - viewMode, - directory, - metadata); + return Utils.enhancedHash( + size, allowSync, art, + identifier, key, librarySectionID, + librarySectionTitle, librarySectionUUID, mediaTagPrefix, + mediaTagVersion, nocache, parentIndex, + parentTitle, parentYear, summary, + theme, thumb, title1, + title2, viewGroup, viewMode, + directory, metadata); } @Override @@ -677,59 +714,61 @@ public class GetMetadataChildrenMediaContainer { "directory", directory, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional allowSync = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional identifier = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionUUID = Optional.empty(); - + private Optional mediaTagPrefix = Optional.empty(); - + private Optional mediaTagVersion = Optional.empty(); - + private Optional nocache = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional parentYear = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional theme = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional title1 = Optional.empty(); - + private Optional title2 = Optional.empty(); - + private Optional viewGroup = Optional.empty(); - + private Optional viewMode = Optional.empty(); - + private Optional> directory = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -742,6 +781,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -754,6 +794,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -766,6 +807,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -778,6 +820,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -790,6 +833,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder librarySectionID(int librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -802,6 +846,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -814,6 +859,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder librarySectionUUID(String librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); @@ -826,6 +872,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder mediaTagPrefix(String mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); @@ -838,6 +885,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder mediaTagVersion(int mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); @@ -850,6 +898,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder nocache(boolean nocache) { Utils.checkNotNull(nocache, "nocache"); this.nocache = Optional.ofNullable(nocache); @@ -862,6 +911,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder parentIndex(int parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = Optional.ofNullable(parentIndex); @@ -874,6 +924,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder parentTitle(String parentTitle) { Utils.checkNotNull(parentTitle, "parentTitle"); this.parentTitle = Optional.ofNullable(parentTitle); @@ -886,6 +937,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder parentYear(int parentYear) { Utils.checkNotNull(parentYear, "parentYear"); this.parentYear = Optional.ofNullable(parentYear); @@ -898,6 +950,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -910,6 +963,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder theme(String theme) { Utils.checkNotNull(theme, "theme"); this.theme = Optional.ofNullable(theme); @@ -922,6 +976,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -934,6 +989,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder title1(String title1) { Utils.checkNotNull(title1, "title1"); this.title1 = Optional.ofNullable(title1); @@ -946,6 +1002,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder title2(String title2) { Utils.checkNotNull(title2, "title2"); this.title2 = Optional.ofNullable(title2); @@ -958,6 +1015,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder viewGroup(String viewGroup) { Utils.checkNotNull(viewGroup, "viewGroup"); this.viewGroup = Optional.ofNullable(viewGroup); @@ -970,6 +1028,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder viewMode(int viewMode) { Utils.checkNotNull(viewMode, "viewMode"); this.viewMode = Optional.ofNullable(viewMode); @@ -982,6 +1041,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder directory(List directory) { Utils.checkNotNull(directory, "directory"); this.directory = Optional.ofNullable(directory); @@ -994,6 +1054,7 @@ public class GetMetadataChildrenMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -1005,32 +1066,19 @@ public class GetMetadataChildrenMediaContainer { this.metadata = metadata; return this; } - + public GetMetadataChildrenMediaContainer build() { + return new GetMetadataChildrenMediaContainer( - size, - allowSync, - art, - identifier, - key, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - nocache, - parentIndex, - parentTitle, - parentYear, - summary, - theme, - thumb, - title1, - title2, - viewGroup, - viewMode, - directory, - metadata); + size, allowSync, art, + identifier, key, librarySectionID, + librarySectionTitle, librarySectionUUID, mediaTagPrefix, + mediaTagVersion, nocache, parentIndex, + parentTitle, parentYear, summary, + theme, thumb, title1, + title2, viewGroup, viewMode, + directory, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenMetadata.java index 9f49bf01..733cf049 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenMetadata.java @@ -12,115 +12,141 @@ 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 GetMetadataChildrenMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentRatingKey") private Optional parentRatingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentGuid") private Optional parentGuid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentStudio") private Optional parentStudio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentKey") private Optional parentKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentTitle") private Optional parentTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("index") private Optional index; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentIndex") private Optional parentIndex; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewCount") private Optional viewCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("lastViewedAt") private Optional lastViewedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentYear") private Optional parentYear; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentThumb") private Optional parentThumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentTheme") private Optional parentTheme; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewedLeafCount") private Optional viewedLeafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("userRating") private Optional userRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("skipCount") private Optional skipCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("lastRatedAt") private Optional lastRatedAt; @@ -211,7 +237,15 @@ public class GetMetadataChildrenMetadata { } public GetMetadataChildrenMetadata() { - 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()); + 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()); } @JsonIgnore @@ -349,9 +383,10 @@ public class GetMetadataChildrenMetadata { return lastRatedAt; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMetadataChildrenMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -359,6 +394,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -371,6 +407,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -383,6 +420,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentRatingKey(Optional parentRatingKey) { Utils.checkNotNull(parentRatingKey, "parentRatingKey"); this.parentRatingKey = parentRatingKey; @@ -395,6 +433,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -407,6 +446,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentGuid(Optional parentGuid) { Utils.checkNotNull(parentGuid, "parentGuid"); this.parentGuid = parentGuid; @@ -419,6 +459,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentStudio(Optional parentStudio) { Utils.checkNotNull(parentStudio, "parentStudio"); this.parentStudio = parentStudio; @@ -431,6 +472,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -443,6 +485,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -455,6 +498,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentKey(Optional parentKey) { Utils.checkNotNull(parentKey, "parentKey"); this.parentKey = parentKey; @@ -467,6 +511,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentTitle(Optional parentTitle) { Utils.checkNotNull(parentTitle, "parentTitle"); this.parentTitle = parentTitle; @@ -479,6 +524,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -491,6 +537,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withIndex(Optional index) { Utils.checkNotNull(index, "index"); this.index = index; @@ -503,6 +550,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentIndex(Optional parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = parentIndex; @@ -515,6 +563,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withViewCount(Optional viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = viewCount; @@ -527,6 +576,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withLastViewedAt(Optional lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = lastViewedAt; @@ -539,6 +589,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentYear(Optional parentYear) { Utils.checkNotNull(parentYear, "parentYear"); this.parentYear = parentYear; @@ -551,6 +602,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -563,6 +615,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -575,6 +628,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentThumb(Optional parentThumb) { Utils.checkNotNull(parentThumb, "parentThumb"); this.parentThumb = parentThumb; @@ -587,6 +641,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withParentTheme(Optional parentTheme) { Utils.checkNotNull(parentTheme, "parentTheme"); this.parentTheme = parentTheme; @@ -599,6 +654,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -611,6 +667,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withViewedLeafCount(Optional viewedLeafCount) { Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); this.viewedLeafCount = viewedLeafCount; @@ -623,6 +680,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -635,6 +693,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -647,6 +706,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withUserRating(Optional userRating) { Utils.checkNotNull(userRating, "userRating"); this.userRating = userRating; @@ -659,6 +719,7 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withSkipCount(Optional skipCount) { Utils.checkNotNull(skipCount, "skipCount"); this.skipCount = skipCount; @@ -671,13 +732,13 @@ public class GetMetadataChildrenMetadata { return this; } + public GetMetadataChildrenMetadata withLastRatedAt(Optional lastRatedAt) { Utils.checkNotNull(lastRatedAt, "lastRatedAt"); this.lastRatedAt = lastRatedAt; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -688,65 +749,47 @@ public class GetMetadataChildrenMetadata { } GetMetadataChildrenMetadata other = (GetMetadataChildrenMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.parentGuid, other.parentGuid) && - Objects.deepEquals(this.parentStudio, other.parentStudio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.parentYear, other.parentYear) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.parentTheme, other.parentTheme) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.userRating, other.userRating) && - Objects.deepEquals(this.skipCount, other.skipCount) && - Objects.deepEquals(this.lastRatedAt, other.lastRatedAt); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.parentRatingKey, other.parentRatingKey) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.parentGuid, other.parentGuid) && + Utils.enhancedDeepEquals(this.parentStudio, other.parentStudio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.parentYear, other.parentYear) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.parentTheme, other.parentTheme) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.userRating, other.userRating) && + Utils.enhancedDeepEquals(this.skipCount, other.skipCount) && + Utils.enhancedDeepEquals(this.lastRatedAt, other.lastRatedAt); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - parentRatingKey, - guid, - parentGuid, - parentStudio, - type, - title, - parentKey, - parentTitle, - summary, - index, - parentIndex, - viewCount, - lastViewedAt, - parentYear, - thumb, - art, - parentThumb, - parentTheme, - leafCount, - viewedLeafCount, - addedAt, - updatedAt, - userRating, - skipCount, - lastRatedAt); + return Utils.enhancedHash( + ratingKey, key, parentRatingKey, + guid, parentGuid, parentStudio, + type, title, parentKey, + parentTitle, summary, index, + parentIndex, viewCount, lastViewedAt, + parentYear, thumb, art, + parentThumb, parentTheme, leafCount, + viewedLeafCount, addedAt, updatedAt, + userRating, skipCount, lastRatedAt); } @Override @@ -780,67 +823,69 @@ public class GetMetadataChildrenMetadata { "skipCount", skipCount, "lastRatedAt", lastRatedAt); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional parentRatingKey = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional parentGuid = Optional.empty(); - + private Optional parentStudio = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional index = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional parentYear = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional parentThumb = Optional.empty(); - + private Optional parentTheme = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional viewedLeafCount = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional userRating = Optional.empty(); - + private Optional skipCount = Optional.empty(); - + private Optional lastRatedAt = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -853,6 +898,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -865,6 +911,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentRatingKey(String parentRatingKey) { Utils.checkNotNull(parentRatingKey, "parentRatingKey"); this.parentRatingKey = Optional.ofNullable(parentRatingKey); @@ -877,6 +924,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -889,6 +937,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentGuid(String parentGuid) { Utils.checkNotNull(parentGuid, "parentGuid"); this.parentGuid = Optional.ofNullable(parentGuid); @@ -901,6 +950,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentStudio(String parentStudio) { Utils.checkNotNull(parentStudio, "parentStudio"); this.parentStudio = Optional.ofNullable(parentStudio); @@ -913,6 +963,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -925,6 +976,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -937,6 +989,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentKey(String parentKey) { Utils.checkNotNull(parentKey, "parentKey"); this.parentKey = Optional.ofNullable(parentKey); @@ -949,6 +1002,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentTitle(String parentTitle) { Utils.checkNotNull(parentTitle, "parentTitle"); this.parentTitle = Optional.ofNullable(parentTitle); @@ -961,6 +1015,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -973,6 +1028,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder index(int index) { Utils.checkNotNull(index, "index"); this.index = Optional.ofNullable(index); @@ -985,6 +1041,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentIndex(int parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = Optional.ofNullable(parentIndex); @@ -997,6 +1054,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder viewCount(int viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = Optional.ofNullable(viewCount); @@ -1009,6 +1067,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder lastViewedAt(int lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = Optional.ofNullable(lastViewedAt); @@ -1021,6 +1080,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentYear(int parentYear) { Utils.checkNotNull(parentYear, "parentYear"); this.parentYear = Optional.ofNullable(parentYear); @@ -1033,6 +1093,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -1045,6 +1106,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -1057,6 +1119,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentThumb(String parentThumb) { Utils.checkNotNull(parentThumb, "parentThumb"); this.parentThumb = Optional.ofNullable(parentThumb); @@ -1069,6 +1132,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder parentTheme(String parentTheme) { Utils.checkNotNull(parentTheme, "parentTheme"); this.parentTheme = Optional.ofNullable(parentTheme); @@ -1081,6 +1145,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -1093,6 +1158,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder viewedLeafCount(int viewedLeafCount) { Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); this.viewedLeafCount = Optional.ofNullable(viewedLeafCount); @@ -1105,6 +1171,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -1117,6 +1184,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -1129,6 +1197,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder userRating(int userRating) { Utils.checkNotNull(userRating, "userRating"); this.userRating = Optional.ofNullable(userRating); @@ -1141,6 +1210,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder skipCount(int skipCount) { Utils.checkNotNull(skipCount, "skipCount"); this.skipCount = Optional.ofNullable(skipCount); @@ -1153,6 +1223,7 @@ public class GetMetadataChildrenMetadata { return this; } + public Builder lastRatedAt(int lastRatedAt) { Utils.checkNotNull(lastRatedAt, "lastRatedAt"); this.lastRatedAt = Optional.ofNullable(lastRatedAt); @@ -1164,36 +1235,20 @@ public class GetMetadataChildrenMetadata { this.lastRatedAt = lastRatedAt; return this; } - + public GetMetadataChildrenMetadata build() { + return new GetMetadataChildrenMetadata( - ratingKey, - key, - parentRatingKey, - guid, - parentGuid, - parentStudio, - type, - title, - parentKey, - parentTitle, - summary, - index, - parentIndex, - viewCount, - lastViewedAt, - parentYear, - thumb, - art, - parentThumb, - parentTheme, - leafCount, - viewedLeafCount, - addedAt, - updatedAt, - userRating, - skipCount, - lastRatedAt); + ratingKey, key, parentRatingKey, + guid, parentGuid, parentStudio, + type, title, parentKey, + parentTitle, summary, index, + parentIndex, viewCount, lastViewedAt, + parentYear, thumb, art, + parentThumb, parentTheme, leafCount, + viewedLeafCount, addedAt, updatedAt, + userRating, skipCount, lastRatedAt); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequest.java index 64ca8f26..14dd3b84 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetMetadataChildrenRequest { +public class GetMetadataChildrenRequest { /** * the id of the library item to return the children of. */ @@ -58,9 +57,10 @@ public class GetMetadataChildrenRequest { return includeElements; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the id of the library item to return the children of. @@ -80,6 +80,7 @@ public class GetMetadataChildrenRequest { return this; } + /** * Adds additional elements to the response. Supported types are (Stream) */ @@ -89,7 +90,6 @@ public class GetMetadataChildrenRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -100,15 +100,14 @@ public class GetMetadataChildrenRequest { } GetMetadataChildrenRequest other = (GetMetadataChildrenRequest) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.includeElements, other.includeElements); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.includeElements, other.includeElements); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - includeElements); + return Utils.enhancedHash( + ratingKey, includeElements); } @Override @@ -117,17 +116,19 @@ public class GetMetadataChildrenRequest { "ratingKey", ratingKey, "includeElements", includeElements); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double ratingKey; - + private Optional includeElements = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * the id of the library item to return the children of. */ @@ -137,6 +138,7 @@ public class GetMetadataChildrenRequest { return this; } + /** * Adds additional elements to the response. Supported types are (Stream) */ @@ -154,11 +156,12 @@ public class GetMetadataChildrenRequest { this.includeElements = includeElements; return this; } - + public GetMetadataChildrenRequest build() { + return new GetMetadataChildrenRequest( - ratingKey, - includeElements); + ratingKey, includeElements); } + } } 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 685fa920..5cefe9ad 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetMetadataChildren; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -13,10 +17,10 @@ public class GetMetadataChildrenRequestBuilder { private Double ratingKey; private Optional includeElements = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetMetadataChildren sdk; + private final SDKConfiguration sdkConfiguration; - public GetMetadataChildrenRequestBuilder(SDKMethodInterfaces.MethodCallGetMetadataChildren sdk) { - this.sdk = sdk; + public GetMetadataChildrenRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetMetadataChildrenRequestBuilder ratingKey(double ratingKey) { @@ -37,10 +41,21 @@ public class GetMetadataChildrenRequestBuilder { return this; } - public GetMetadataChildrenResponse call() throws Exception { - return sdk.getMetadataChildren( - ratingKey, + private GetMetadataChildrenRequest buildRequest() { + + GetMetadataChildrenRequest request = new GetMetadataChildrenRequest(ratingKey, includeElements); + + return request; + } + + public GetMetadataChildrenResponse call() throws Exception { + + RequestOperation operation + = new GetMetadataChildren.Sync(sdkConfiguration); + GetMetadataChildrenRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenResponse.java index 14f7178f..8a9420ff 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetMetadataChildrenResponse implements Response { +public class GetMetadataChildrenResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetMetadataChildrenResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetMetadataChildrenResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetMetadataChildrenResponse implements Response { return this; } + /** * The children of the library item. */ @@ -143,7 +145,6 @@ public class GetMetadataChildrenResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetMetadataChildrenResponse implements Response { } GetMetadataChildrenResponse other = (GetMetadataChildrenResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetMetadataChildrenResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetMetadataChildrenResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetMetadataChildrenResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetMetadataChildrenResponse implements Response { return this; } + /** * The children of the library item. */ @@ -236,13 +240,13 @@ public class GetMetadataChildrenResponse implements Response { this.object = object; return this; } - + public GetMetadataChildrenResponse build() { + return new GetMetadataChildrenResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenResponseBody.java index 997d5c52..210d48ec 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMetadataChildrenResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetMetadataChildrenResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMetadataChildrenResponseBody withMediaContainer(GetMetadataChildrenMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetMetadataChildrenResponseBody { return this; } + public GetMetadataChildrenResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetMetadataChildrenResponseBody { } GetMetadataChildrenResponseBody other = (GetMetadataChildrenResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetMetadataChildrenResponseBody { return Utils.toString(GetMetadataChildrenResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetMetadataChildrenMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetMetadataChildrenResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetMetadataChildrenResponseBody build() { + return new GetMetadataChildrenResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountRequestBuilder.java index 06344b2e..a1b1ae3e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetMyPlexAccount; import java.lang.Exception; public class GetMyPlexAccountRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk; + private final SDKConfiguration sdkConfiguration; - public GetMyPlexAccountRequestBuilder(SDKMethodInterfaces.MethodCallGetMyPlexAccount sdk) { - this.sdk = sdk; + public GetMyPlexAccountRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetMyPlexAccountResponse call() throws Exception { + + RequestlessOperation operation + = new GetMyPlexAccount.Sync(sdkConfiguration); - return sdk.getMyPlexAccountDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountResponse.java index dcd3d761..2963f49d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetMyPlexAccountResponse implements Response { +public class GetMyPlexAccountResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetMyPlexAccountResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetMyPlexAccountResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetMyPlexAccountResponse implements Response { return this; } + /** * MyPlex Account */ @@ -143,7 +145,6 @@ public class GetMyPlexAccountResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetMyPlexAccountResponse implements Response { } GetMyPlexAccountResponse other = (GetMyPlexAccountResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetMyPlexAccountResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetMyPlexAccountResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetMyPlexAccountResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetMyPlexAccountResponse implements Response { return this; } + /** * MyPlex Account */ @@ -236,13 +240,13 @@ public class GetMyPlexAccountResponse implements Response { this.object = object; return this; } - + public GetMyPlexAccountResponse build() { + return new GetMyPlexAccountResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountResponseBody.java index f37f1e42..98c9591c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetMyPlexAccountResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetMyPlexAccountResponseBody { return (Optional) myPlex; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetMyPlexAccountResponseBody withMyPlex(MyPlex myPlex) { Utils.checkNotNull(myPlex, "myPlex"); @@ -53,13 +53,13 @@ public class GetMyPlexAccountResponseBody { return this; } + public GetMyPlexAccountResponseBody withMyPlex(Optional myPlex) { Utils.checkNotNull(myPlex, "myPlex"); this.myPlex = myPlex; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetMyPlexAccountResponseBody { } GetMyPlexAccountResponseBody other = (GetMyPlexAccountResponseBody) o; return - Objects.deepEquals(this.myPlex, other.myPlex); + Utils.enhancedDeepEquals(this.myPlex, other.myPlex); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( myPlex); } @@ -84,15 +84,17 @@ public class GetMyPlexAccountResponseBody { return Utils.toString(GetMyPlexAccountResponseBody.class, "myPlex", myPlex); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional myPlex = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder myPlex(MyPlex myPlex) { Utils.checkNotNull(myPlex, "myPlex"); this.myPlex = Optional.ofNullable(myPlex); @@ -104,10 +106,12 @@ public class GetMyPlexAccountResponseBody { this.myPlex = myPlex; return this; } - + public GetMyPlexAccountResponseBody build() { + return new GetMyPlexAccountResponseBody( myPlex); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPinAuthPinContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPinAuthPinContainer.java index d3d9fe7f..25fb5d7c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinAuthPinContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinAuthPinContainer.java @@ -18,7 +18,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -32,16 +31,20 @@ public class GetPinAuthPinContainer { @JsonProperty("id") private long id; + @JsonProperty("code") private String code; + @JsonProperty("product") private String product; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("trusted") private Optional trusted; + @JsonProperty("qr") private String qr; @@ -64,16 +67,20 @@ public class GetPinAuthPinContainer { @JsonProperty("expiresIn") private Optional expiresIn; + @JsonProperty("createdAt") private OffsetDateTime createdAt; + @JsonProperty("expiresAt") private OffsetDateTime expiresAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("authToken") private JsonNullable authToken; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("newRegistration") private JsonNullable newRegistration; @@ -127,7 +134,10 @@ public class GetPinAuthPinContainer { GeoData location, OffsetDateTime createdAt, OffsetDateTime expiresAt) { - this(id, code, product, Optional.empty(), qr, clientIdentifier, location, Optional.empty(), createdAt, expiresAt, JsonNullable.undefined(), JsonNullable.undefined()); + this(id, code, product, + Optional.empty(), qr, clientIdentifier, + location, Optional.empty(), createdAt, + expiresAt, JsonNullable.undefined(), JsonNullable.undefined()); } @JsonIgnore @@ -200,9 +210,10 @@ public class GetPinAuthPinContainer { return (JsonNullable) newRegistration; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPinAuthPinContainer withId(long id) { Utils.checkNotNull(id, "id"); @@ -228,6 +239,7 @@ public class GetPinAuthPinContainer { return this; } + public GetPinAuthPinContainer withTrusted(Optional trusted) { Utils.checkNotNull(trusted, "trusted"); this.trusted = trusted; @@ -267,6 +279,7 @@ public class GetPinAuthPinContainer { return this; } + /** * The number of seconds this pin expires, by default 900 seconds */ @@ -312,7 +325,6 @@ public class GetPinAuthPinContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -323,35 +335,27 @@ public class GetPinAuthPinContainer { } GetPinAuthPinContainer other = (GetPinAuthPinContainer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.product, other.product) && - Objects.deepEquals(this.trusted, other.trusted) && - Objects.deepEquals(this.qr, other.qr) && - Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.expiresIn, other.expiresIn) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.expiresAt, other.expiresAt) && - Objects.deepEquals(this.authToken, other.authToken) && - Objects.deepEquals(this.newRegistration, other.newRegistration); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.product, other.product) && + Utils.enhancedDeepEquals(this.trusted, other.trusted) && + Utils.enhancedDeepEquals(this.qr, other.qr) && + Utils.enhancedDeepEquals(this.clientIdentifier, other.clientIdentifier) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.expiresIn, other.expiresIn) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.expiresAt, other.expiresAt) && + Utils.enhancedDeepEquals(this.authToken, other.authToken) && + Utils.enhancedDeepEquals(this.newRegistration, other.newRegistration); } @Override public int hashCode() { - return Objects.hash( - id, - code, - product, - trusted, - qr, - clientIdentifier, - location, - expiresIn, - createdAt, - expiresAt, - authToken, - newRegistration); + return Utils.enhancedHash( + id, code, product, + trusted, qr, clientIdentifier, + location, expiresIn, createdAt, + expiresAt, authToken, newRegistration); } @Override @@ -370,55 +374,60 @@ public class GetPinAuthPinContainer { "authToken", authToken, "newRegistration", newRegistration); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String code; - + private String product; - + private Optional trusted; - + private String qr; - + private String clientIdentifier; - + private GeoData location; - + private Optional expiresIn; - + private OffsetDateTime createdAt; - + private OffsetDateTime expiresAt; - + private JsonNullable authToken = JsonNullable.undefined(); - + private JsonNullable newRegistration = JsonNullable.undefined(); - + private Builder() { // force use of static builder() method } + public Builder id(long id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + public Builder code(String code) { Utils.checkNotNull(code, "code"); this.code = code; return this; } + public Builder product(String product) { Utils.checkNotNull(product, "product"); this.product = product; return this; } + public Builder trusted(boolean trusted) { Utils.checkNotNull(trusted, "trusted"); this.trusted = Optional.ofNullable(trusted); @@ -431,12 +440,14 @@ public class GetPinAuthPinContainer { return this; } + public Builder qr(String qr) { Utils.checkNotNull(qr, "qr"); this.qr = qr; return this; } + /** * The X-Client-Identifier used in the request */ @@ -446,6 +457,7 @@ public class GetPinAuthPinContainer { return this; } + /** * Geo location data */ @@ -455,6 +467,7 @@ public class GetPinAuthPinContainer { return this; } + /** * The number of seconds this pin expires, by default 900 seconds */ @@ -473,18 +486,21 @@ public class GetPinAuthPinContainer { return this; } + public Builder createdAt(OffsetDateTime createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } + public Builder expiresAt(OffsetDateTime expiresAt) { Utils.checkNotNull(expiresAt, "expiresAt"); this.expiresAt = expiresAt; return this; } + public Builder authToken(String authToken) { Utils.checkNotNull(authToken, "authToken"); this.authToken = JsonNullable.of(authToken); @@ -497,6 +513,7 @@ public class GetPinAuthPinContainer { return this; } + public Builder newRegistration(Object newRegistration) { Utils.checkNotNull(newRegistration, "newRegistration"); this.newRegistration = JsonNullable.of(newRegistration); @@ -508,7 +525,7 @@ public class GetPinAuthPinContainer { this.newRegistration = newRegistration; return this; } - + public GetPinAuthPinContainer build() { if (trusted == null) { trusted = _SINGLETON_VALUE_Trusted.value(); @@ -516,21 +533,15 @@ public class GetPinAuthPinContainer { if (expiresIn == null) { expiresIn = _SINGLETON_VALUE_ExpiresIn.value(); } + return new GetPinAuthPinContainer( - id, - code, - product, - trusted, - qr, - clientIdentifier, - location, - expiresIn, - createdAt, - expiresAt, - authToken, - newRegistration); + id, code, product, + trusted, qr, clientIdentifier, + location, expiresIn, createdAt, + expiresAt, authToken, newRegistration); } + private static final LazySingletonValue> _SINGLETON_VALUE_Trusted = new LazySingletonValue<>( "trusted", 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 ef12cedb..a6b8777f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequest.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetPinRequest { +public class GetPinRequest { /** * Determines the kind of code returned by the API call * Strong codes are used for Pin authentication flows @@ -79,7 +78,8 @@ public class GetPinRequest { public GetPinRequest( String clientID) { - this(Optional.empty(), clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), clientID, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -132,9 +132,10 @@ public class GetPinRequest { return platform; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Determines the kind of code returned by the API call @@ -147,6 +148,7 @@ public class GetPinRequest { return this; } + /** * Determines the kind of code returned by the API call * Strong codes are used for Pin authentication flows @@ -176,6 +178,7 @@ public class GetPinRequest { return this; } + /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -194,6 +197,7 @@ public class GetPinRequest { return this; } + /** * A relatively friendly name for the client device */ @@ -212,6 +216,7 @@ public class GetPinRequest { return this; } + /** * The version of the client application. */ @@ -230,6 +235,7 @@ public class GetPinRequest { return this; } + /** * The platform of the client application. */ @@ -239,7 +245,6 @@ public class GetPinRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -250,23 +255,19 @@ 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.deviceNickname, other.deviceNickname) && - Objects.deepEquals(this.clientVersion, other.clientVersion) && - Objects.deepEquals(this.platform, other.platform); + Utils.enhancedDeepEquals(this.strong, other.strong) && + Utils.enhancedDeepEquals(this.clientID, other.clientID) && + Utils.enhancedDeepEquals(this.clientName, other.clientName) && + Utils.enhancedDeepEquals(this.deviceNickname, other.deviceNickname) && + Utils.enhancedDeepEquals(this.clientVersion, other.clientVersion) && + Utils.enhancedDeepEquals(this.platform, other.platform); } @Override public int hashCode() { - return Objects.hash( - strong, - clientID, - clientName, - deviceNickname, - clientVersion, - platform); + return Utils.enhancedHash( + strong, clientID, clientName, + deviceNickname, clientVersion, platform); } @Override @@ -279,25 +280,27 @@ public class GetPinRequest { "clientVersion", clientVersion, "platform", platform); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional strong; - + private String clientID; - + private Optional clientName = Optional.empty(); - + private Optional deviceNickname = Optional.empty(); - + private Optional clientVersion = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Determines the kind of code returned by the API call * Strong codes are used for Pin authentication flows @@ -320,6 +323,7 @@ public class GetPinRequest { return this; } + /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @@ -329,6 +333,7 @@ public class GetPinRequest { return this; } + /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -347,6 +352,7 @@ public class GetPinRequest { return this; } + /** * A relatively friendly name for the client device */ @@ -365,6 +371,7 @@ public class GetPinRequest { return this; } + /** * The version of the client application. */ @@ -383,6 +390,7 @@ public class GetPinRequest { return this; } + /** * The platform of the client application. */ @@ -400,20 +408,18 @@ public class GetPinRequest { this.platform = platform; return this; } - + public GetPinRequest build() { if (strong == null) { strong = _SINGLETON_VALUE_Strong.value(); } + return new GetPinRequest( - strong, - clientID, - clientName, - deviceNickname, - clientVersion, - platform); + strong, clientID, clientName, + deviceNickname, clientVersion, platform); } + private static final LazySingletonValue> _SINGLETON_VALUE_Strong = new LazySingletonValue<>( "strong", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java index 29458ab6..7fdc0573 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetPin; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class GetPinRequestBuilder { private GetPinRequest request; private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetPin sdk; + private final SDKConfiguration sdkConfiguration; - public GetPinRequestBuilder(SDKMethodInterfaces.MethodCallGetPin sdk) { - this.sdk = sdk; + public GetPinRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetPinRequestBuilder request(GetPinRequest request) { @@ -37,9 +41,10 @@ public class GetPinRequestBuilder { } public GetPinResponse call() throws Exception { + + RequestOperation operation + = new GetPin.Sync(sdkConfiguration, serverURL); - return sdk.getPin( - request, - serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPinResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPinResponse.java index 100effe0..3dde0a90 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPinResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPinResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetPinResponse implements Response { +public class GetPinResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetPinResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetPinResponse implements Response { return (Optional) authPinContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetPinResponse implements Response { return this; } + /** * Requests a new pin id used in the authentication flow */ @@ -143,7 +145,6 @@ public class GetPinResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetPinResponse implements Response { } GetPinResponse other = (GetPinResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.authPinContainer, other.authPinContainer); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.authPinContainer, other.authPinContainer); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, authPinContainer); } @@ -177,21 +176,23 @@ public class GetPinResponse implements Response { "rawResponse", rawResponse, "authPinContainer", authPinContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional authPinContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetPinResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetPinResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetPinResponse implements Response { return this; } + /** * Requests a new pin id used in the authentication flow */ @@ -236,13 +240,13 @@ public class GetPinResponse implements Response { this.authPinContainer = authPinContainer; return this; } - + public GetPinResponse build() { + return new GetPinResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, authPinContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsCountry.java index fa17ba18..4e9ce96b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsCountry.java @@ -11,9 +11,9 @@ 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 GetPlaylistContentsCountry { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetPlaylistContentsCountry { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsCountry withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetPlaylistContentsCountry { return this; } + public GetPlaylistContentsCountry withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetPlaylistContentsCountry { } GetPlaylistContentsCountry other = (GetPlaylistContentsCountry) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetPlaylistContentsCountry { return Utils.toString(GetPlaylistContentsCountry.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetPlaylistContentsCountry { this.tag = tag; return this; } - + public GetPlaylistContentsCountry build() { + return new GetPlaylistContentsCountry( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsDirector.java index 97de03d5..7fbe8f0f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsDirector.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsDirector.java @@ -11,9 +11,9 @@ 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 GetPlaylistContentsDirector { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetPlaylistContentsDirector { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsDirector withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetPlaylistContentsDirector { return this; } + public GetPlaylistContentsDirector withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetPlaylistContentsDirector { } GetPlaylistContentsDirector other = (GetPlaylistContentsDirector) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetPlaylistContentsDirector { return Utils.toString(GetPlaylistContentsDirector.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetPlaylistContentsDirector { this.tag = tag; return this; } - + public GetPlaylistContentsDirector build() { + return new GetPlaylistContentsDirector( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsGenre.java index 771df81a..293c7aad 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsGenre.java @@ -11,9 +11,9 @@ 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 GetPlaylistContentsGenre { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetPlaylistContentsGenre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsGenre withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetPlaylistContentsGenre { return this; } + public GetPlaylistContentsGenre withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetPlaylistContentsGenre { } GetPlaylistContentsGenre other = (GetPlaylistContentsGenre) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetPlaylistContentsGenre { return Utils.toString(GetPlaylistContentsGenre.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetPlaylistContentsGenre { this.tag = tag; return this; } - + public GetPlaylistContentsGenre build() { + return new GetPlaylistContentsGenre( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMedia.java index abebe366..fc0c445c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMedia.java @@ -16,75 +16,91 @@ 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 GetPlaylistContentsMedia { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") private Optional bitrate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("width") private Optional width; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("height") private Optional height; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("aspectRatio") private Optional aspectRatio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") private Optional audioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoCodec") private Optional videoCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoResolution") private Optional videoResolution; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoFrameRate") private Optional videoFrameRate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Part") private Optional> part; @@ -145,7 +161,12 @@ public class GetPlaylistContentsMedia { } public GetPlaylistContentsMedia() { - 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()); + 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()); } @JsonIgnore @@ -234,9 +255,10 @@ public class GetPlaylistContentsMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsMedia withId(int id) { Utils.checkNotNull(id, "id"); @@ -244,6 +266,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -256,6 +279,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -268,6 +292,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; @@ -280,6 +305,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withWidth(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; @@ -292,6 +318,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withHeight(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; @@ -304,6 +331,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withAspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; @@ -316,6 +344,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; @@ -328,6 +357,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; @@ -340,6 +370,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withVideoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; @@ -352,6 +383,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withVideoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; @@ -364,6 +396,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -376,6 +409,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withVideoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; @@ -388,6 +422,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withOptimizedForStreaming(Optional optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = optimizedForStreaming; @@ -400,6 +435,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withAudioProfile(Optional audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = audioProfile; @@ -412,6 +448,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -424,6 +461,7 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; @@ -436,13 +474,13 @@ public class GetPlaylistContentsMedia { return this; } + public GetPlaylistContentsMedia withPart(Optional> part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -453,45 +491,34 @@ public class GetPlaylistContentsMedia { } GetPlaylistContentsMedia other = (GetPlaylistContentsMedia) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - optimizedForStreaming, - audioProfile, - has64bitOffsets, - videoProfile, - part); + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, audioCodec, videoCodec, + videoResolution, container, videoFrameRate, + optimizedForStreaming, audioProfile, has64bitOffsets, + videoProfile, part); } @Override @@ -515,47 +542,49 @@ public class GetPlaylistContentsMedia { "videoProfile", videoProfile, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -568,6 +597,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -580,6 +610,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder bitrate(int bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = Optional.ofNullable(bitrate); @@ -592,6 +623,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder width(int width) { Utils.checkNotNull(width, "width"); this.width = Optional.ofNullable(width); @@ -604,6 +636,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder height(int height) { Utils.checkNotNull(height, "height"); this.height = Optional.ofNullable(height); @@ -616,6 +649,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder aspectRatio(double aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = Optional.ofNullable(aspectRatio); @@ -628,6 +662,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder audioChannels(int audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = Optional.ofNullable(audioChannels); @@ -640,6 +675,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder audioCodec(String audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = Optional.ofNullable(audioCodec); @@ -652,6 +688,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder videoCodec(String videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = Optional.ofNullable(videoCodec); @@ -664,6 +701,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder videoResolution(String videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = Optional.ofNullable(videoResolution); @@ -676,6 +714,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -688,6 +727,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder videoFrameRate(String videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = Optional.ofNullable(videoFrameRate); @@ -700,6 +740,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder optimizedForStreaming(int optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); @@ -712,6 +753,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder audioProfile(String audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = Optional.ofNullable(audioProfile); @@ -724,6 +766,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -736,6 +779,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); @@ -748,6 +792,7 @@ public class GetPlaylistContentsMedia { return this; } + public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = Optional.ofNullable(part); @@ -759,26 +804,17 @@ public class GetPlaylistContentsMedia { this.part = part; return this; } - + public GetPlaylistContentsMedia build() { + return new GetPlaylistContentsMedia( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - optimizedForStreaming, - audioProfile, - has64bitOffsets, - videoProfile, - part); + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, audioCodec, videoCodec, + videoResolution, container, videoFrameRate, + optimizedForStreaming, audioProfile, has64bitOffsets, + videoProfile, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMediaContainer.java index a6479751..1863f1bd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMediaContainer.java @@ -15,43 +15,51 @@ 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 GetPlaylistContentsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("composite") private Optional composite; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("playlistType") private Optional playlistType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("smart") private Optional smart; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -88,7 +96,9 @@ public class GetPlaylistContentsMediaContainer { } public GetPlaylistContentsMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -137,9 +147,10 @@ public class GetPlaylistContentsMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -147,6 +158,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -159,6 +171,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withComposite(Optional composite) { Utils.checkNotNull(composite, "composite"); this.composite = composite; @@ -171,6 +184,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -183,6 +197,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -195,6 +210,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withPlaylistType(Optional playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = playlistType; @@ -207,6 +223,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -219,6 +236,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withSmart(Optional smart) { Utils.checkNotNull(smart, "smart"); this.smart = smart; @@ -231,6 +249,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -243,13 +262,13 @@ public class GetPlaylistContentsMediaContainer { return this; } + public GetPlaylistContentsMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -260,29 +279,23 @@ public class GetPlaylistContentsMediaContainer { } GetPlaylistContentsMediaContainer other = (GetPlaylistContentsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.composite, other.composite) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.playlistType, other.playlistType) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.smart, other.smart) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.composite, other.composite) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.playlistType, other.playlistType) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.smart, other.smart) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - composite, - duration, - leafCount, - playlistType, - ratingKey, - smart, - title, - metadata); + return Utils.enhancedHash( + size, composite, duration, + leafCount, playlistType, ratingKey, + smart, title, metadata); } @Override @@ -298,31 +311,33 @@ public class GetPlaylistContentsMediaContainer { "title", title, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional composite = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional playlistType = Optional.empty(); - + private Optional ratingKey = Optional.empty(); - + private Optional smart = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -335,6 +350,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public Builder composite(String composite) { Utils.checkNotNull(composite, "composite"); this.composite = Optional.ofNullable(composite); @@ -347,6 +363,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -359,6 +376,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -371,6 +389,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public Builder playlistType(String playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = Optional.ofNullable(playlistType); @@ -383,6 +402,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -395,6 +415,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public Builder smart(boolean smart) { Utils.checkNotNull(smart, "smart"); this.smart = Optional.ofNullable(smart); @@ -407,6 +428,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -419,6 +441,7 @@ public class GetPlaylistContentsMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -430,18 +453,14 @@ public class GetPlaylistContentsMediaContainer { this.metadata = metadata; return this; } - + public GetPlaylistContentsMediaContainer build() { + return new GetPlaylistContentsMediaContainer( - size, - composite, - duration, - leafCount, - playlistType, - ratingKey, - smart, - title, - metadata); + size, composite, duration, + leafCount, playlistType, ratingKey, + smart, title, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMetadata.java index 133493f4..df4b4fa9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsMetadata.java @@ -16,135 +16,166 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; + public class GetPlaylistContentsMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("studio") private Optional studio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("titleSort") private Optional titleSort; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionKey") private Optional librarySectionKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentRating") private Optional contentRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("rating") private Optional rating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRating") private Optional audienceRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("year") private Optional year; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagline") private Optional tagline; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRatingImage") private Optional audienceRatingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasPremiumExtras") private Optional hasPremiumExtras; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasPremiumPrimaryExtra") private Optional hasPremiumPrimaryExtra; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingImage") private Optional ratingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; @@ -250,7 +281,17 @@ public class GetPlaylistContentsMetadata { } public GetPlaylistContentsMetadata() { - 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()); + 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()); } @JsonIgnore @@ -419,9 +460,10 @@ public class GetPlaylistContentsMetadata { return (Optional>) role; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -429,6 +471,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -441,6 +484,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -453,6 +497,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -465,6 +510,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withStudio(Optional studio) { Utils.checkNotNull(studio, "studio"); this.studio = studio; @@ -477,6 +523,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -489,6 +536,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -501,6 +549,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withTitleSort(Optional titleSort) { Utils.checkNotNull(titleSort, "titleSort"); this.titleSort = titleSort; @@ -513,6 +562,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -525,6 +575,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -537,6 +588,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withLibrarySectionKey(Optional librarySectionKey) { Utils.checkNotNull(librarySectionKey, "librarySectionKey"); this.librarySectionKey = librarySectionKey; @@ -549,6 +601,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withContentRating(Optional contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = contentRating; @@ -561,6 +614,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -573,6 +627,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withRating(Optional rating) { Utils.checkNotNull(rating, "rating"); this.rating = rating; @@ -585,6 +640,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withAudienceRating(Optional audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = audienceRating; @@ -597,6 +653,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withYear(Optional year) { Utils.checkNotNull(year, "year"); this.year = year; @@ -609,6 +666,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withTagline(Optional tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = tagline; @@ -621,6 +679,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -633,6 +692,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -645,6 +705,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -657,6 +718,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = originallyAvailableAt; @@ -669,6 +731,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -681,6 +744,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -693,6 +757,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withAudienceRatingImage(Optional audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = audienceRatingImage; @@ -705,6 +770,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withHasPremiumExtras(Optional hasPremiumExtras) { Utils.checkNotNull(hasPremiumExtras, "hasPremiumExtras"); this.hasPremiumExtras = hasPremiumExtras; @@ -717,6 +783,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withHasPremiumPrimaryExtra(Optional hasPremiumPrimaryExtra) { Utils.checkNotNull(hasPremiumPrimaryExtra, "hasPremiumPrimaryExtra"); this.hasPremiumPrimaryExtra = hasPremiumPrimaryExtra; @@ -729,6 +796,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withRatingImage(Optional ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = ratingImage; @@ -741,6 +809,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -753,6 +822,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -765,6 +835,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -777,6 +848,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -789,6 +861,7 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -801,13 +874,13 @@ public class GetPlaylistContentsMetadata { return this; } + public GetPlaylistContentsMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -818,75 +891,54 @@ public class GetPlaylistContentsMetadata { } GetPlaylistContentsMetadata other = (GetPlaylistContentsMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.titleSort, other.titleSort) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.hasPremiumExtras, other.hasPremiumExtras) && - Objects.deepEquals(this.hasPremiumPrimaryExtra, other.hasPremiumPrimaryExtra) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.role, other.role); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.titleSort, other.titleSort) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.hasPremiumExtras, other.hasPremiumExtras) && + Utils.enhancedDeepEquals(this.hasPremiumPrimaryExtra, other.hasPremiumPrimaryExtra) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.role, other.role); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - studio, - type, - title, - titleSort, - librarySectionTitle, - librarySectionID, - librarySectionKey, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - hasPremiumExtras, - hasPremiumPrimaryExtra, - ratingImage, - media, - genre, - country, - director, - writer, - role); + return Utils.enhancedHash( + ratingKey, key, guid, + studio, type, title, + titleSort, librarySectionTitle, librarySectionID, + librarySectionKey, contentRating, summary, + rating, audienceRating, year, + tagline, thumb, art, + duration, originallyAvailableAt, addedAt, + updatedAt, audienceRatingImage, hasPremiumExtras, + hasPremiumPrimaryExtra, ratingImage, media, + genre, country, director, + writer, role); } @Override @@ -925,77 +977,79 @@ public class GetPlaylistContentsMetadata { "writer", writer, "role", role); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional studio = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional titleSort = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionKey = Optional.empty(); - + private Optional contentRating = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional rating = Optional.empty(); - + private Optional audienceRating = Optional.empty(); - + private Optional year = Optional.empty(); - + private Optional tagline = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional originallyAvailableAt = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional hasPremiumExtras = Optional.empty(); - + private Optional hasPremiumPrimaryExtra = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -1008,6 +1062,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -1020,6 +1075,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -1032,6 +1088,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder studio(String studio) { Utils.checkNotNull(studio, "studio"); this.studio = Optional.ofNullable(studio); @@ -1044,6 +1101,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -1056,6 +1114,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -1068,6 +1127,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder titleSort(String titleSort) { Utils.checkNotNull(titleSort, "titleSort"); this.titleSort = Optional.ofNullable(titleSort); @@ -1080,6 +1140,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -1092,6 +1153,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder librarySectionID(int librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -1104,6 +1166,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder librarySectionKey(String librarySectionKey) { Utils.checkNotNull(librarySectionKey, "librarySectionKey"); this.librarySectionKey = Optional.ofNullable(librarySectionKey); @@ -1116,6 +1179,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder contentRating(String contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = Optional.ofNullable(contentRating); @@ -1128,6 +1192,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -1140,6 +1205,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder rating(double rating) { Utils.checkNotNull(rating, "rating"); this.rating = Optional.ofNullable(rating); @@ -1152,6 +1218,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder audienceRating(double audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = Optional.ofNullable(audienceRating); @@ -1164,6 +1231,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder year(int year) { Utils.checkNotNull(year, "year"); this.year = Optional.ofNullable(year); @@ -1176,6 +1244,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder tagline(String tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = Optional.ofNullable(tagline); @@ -1188,6 +1257,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -1200,6 +1270,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -1212,6 +1283,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -1224,6 +1296,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder originallyAvailableAt(LocalDate originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); @@ -1236,6 +1309,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -1248,6 +1322,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -1260,6 +1335,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder audienceRatingImage(String audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); @@ -1272,6 +1348,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder hasPremiumExtras(String hasPremiumExtras) { Utils.checkNotNull(hasPremiumExtras, "hasPremiumExtras"); this.hasPremiumExtras = Optional.ofNullable(hasPremiumExtras); @@ -1284,6 +1361,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder hasPremiumPrimaryExtra(String hasPremiumPrimaryExtra) { Utils.checkNotNull(hasPremiumPrimaryExtra, "hasPremiumPrimaryExtra"); this.hasPremiumPrimaryExtra = Optional.ofNullable(hasPremiumPrimaryExtra); @@ -1296,6 +1374,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder ratingImage(String ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = Optional.ofNullable(ratingImage); @@ -1308,6 +1387,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -1320,6 +1400,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -1332,6 +1413,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -1344,6 +1426,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -1356,6 +1439,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -1368,6 +1452,7 @@ public class GetPlaylistContentsMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -1379,41 +1464,22 @@ public class GetPlaylistContentsMetadata { this.role = role; return this; } - + public GetPlaylistContentsMetadata build() { + return new GetPlaylistContentsMetadata( - ratingKey, - key, - guid, - studio, - type, - title, - titleSort, - librarySectionTitle, - librarySectionID, - librarySectionKey, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - hasPremiumExtras, - hasPremiumPrimaryExtra, - ratingImage, - media, - genre, - country, - director, - writer, - role); + ratingKey, key, guid, + studio, type, title, + titleSort, librarySectionTitle, librarySectionID, + librarySectionKey, contentRating, summary, + rating, audienceRating, year, + tagline, thumb, art, + duration, originallyAvailableAt, addedAt, + updatedAt, audienceRatingImage, hasPremiumExtras, + hasPremiumPrimaryExtra, ratingImage, media, + genre, country, director, + writer, role); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsPart.java index 9e4c7d1b..0317155b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsPart.java @@ -13,47 +13,56 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetPlaylistContentsPart { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("file") private Optional file; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; @@ -93,7 +102,10 @@ public class GetPlaylistContentsPart { } public GetPlaylistContentsPart() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -146,9 +158,10 @@ public class GetPlaylistContentsPart { return videoProfile; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsPart withId(int id) { Utils.checkNotNull(id, "id"); @@ -156,6 +169,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -168,6 +182,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -180,6 +195,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -192,6 +208,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withFile(Optional file) { Utils.checkNotNull(file, "file"); this.file = file; @@ -204,6 +221,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -216,6 +234,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withAudioProfile(Optional audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = audioProfile; @@ -228,6 +247,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -240,6 +260,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -252,6 +273,7 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withOptimizedForStreaming(Optional optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = optimizedForStreaming; @@ -264,13 +286,13 @@ public class GetPlaylistContentsPart { return this; } + public GetPlaylistContentsPart withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -281,30 +303,24 @@ public class GetPlaylistContentsPart { } GetPlaylistContentsPart other = (GetPlaylistContentsPart) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.videoProfile, other.videoProfile); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile); } @Override public int hashCode() { - return Objects.hash( - id, - key, - duration, - file, - size, - audioProfile, - container, - has64bitOffsets, - optimizedForStreaming, + return Utils.enhancedHash( + id, key, duration, + file, size, audioProfile, + container, has64bitOffsets, optimizedForStreaming, videoProfile); } @@ -322,33 +338,35 @@ public class GetPlaylistContentsPart { "optimizedForStreaming", optimizedForStreaming, "videoProfile", videoProfile); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional file = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -361,6 +379,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -373,6 +392,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -385,6 +405,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder file(String file) { Utils.checkNotNull(file, "file"); this.file = Optional.ofNullable(file); @@ -397,6 +418,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -409,6 +431,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder audioProfile(String audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = Optional.ofNullable(audioProfile); @@ -421,6 +444,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -433,6 +457,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -445,6 +470,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder optimizedForStreaming(boolean optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); @@ -457,6 +483,7 @@ public class GetPlaylistContentsPart { return this; } + public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); @@ -468,19 +495,15 @@ public class GetPlaylistContentsPart { this.videoProfile = videoProfile; return this; } - + public GetPlaylistContentsPart build() { + return new GetPlaylistContentsPart( - id, - key, - duration, - file, - size, - audioProfile, - container, - has64bitOffsets, - optimizedForStreaming, + id, key, duration, + file, size, audioProfile, + container, has64bitOffsets, optimizedForStreaming, videoProfile); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequest.java index 85d23361..afdd7016 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetPlaylistContentsRequest { - /** * the ID of the playlist */ @@ -62,9 +61,10 @@ public class GetPlaylistContentsRequest { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the ID of the playlist @@ -89,7 +89,6 @@ public class GetPlaylistContentsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -100,15 +99,14 @@ public class GetPlaylistContentsRequest { } GetPlaylistContentsRequest other = (GetPlaylistContentsRequest) o; return - Objects.deepEquals(this.playlistID, other.playlistID) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.playlistID, other.playlistID) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - playlistID, - type); + return Utils.enhancedHash( + playlistID, type); } @Override @@ -117,17 +115,19 @@ public class GetPlaylistContentsRequest { "playlistID", playlistID, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double playlistID; - + private GetPlaylistContentsQueryParamType type; - + private Builder() { // force use of static builder() method } + /** * the ID of the playlist */ @@ -137,6 +137,7 @@ public class GetPlaylistContentsRequest { return this; } + /** * The type of media to retrieve or filter by. * 1 = movie @@ -150,11 +151,12 @@ public class GetPlaylistContentsRequest { this.type = type; return this; } - + public GetPlaylistContentsRequest build() { + return new GetPlaylistContentsRequest( - playlistID, - type); + playlistID, type); } + } } 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 60a2f6cd..798b27e7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetPlaylistContents; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -11,10 +15,10 @@ public class GetPlaylistContentsRequestBuilder { private Double playlistID; private GetPlaylistContentsQueryParamType type; - private final SDKMethodInterfaces.MethodCallGetPlaylistContents sdk; + private final SDKConfiguration sdkConfiguration; - public GetPlaylistContentsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylistContents sdk) { - this.sdk = sdk; + public GetPlaylistContentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetPlaylistContentsRequestBuilder playlistID(double playlistID) { @@ -29,10 +33,21 @@ public class GetPlaylistContentsRequestBuilder { return this; } - public GetPlaylistContentsResponse call() throws Exception { - return sdk.getPlaylistContents( - playlistID, + private GetPlaylistContentsRequest buildRequest() { + + GetPlaylistContentsRequest request = new GetPlaylistContentsRequest(playlistID, type); + + return request; + } + + public GetPlaylistContentsResponse call() throws Exception { + + RequestOperation operation + = new GetPlaylistContents.Sync(sdkConfiguration); + GetPlaylistContentsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsResponse.java index 0f7517bc..3c36fea0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetPlaylistContentsResponse implements Response { +public class GetPlaylistContentsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetPlaylistContentsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetPlaylistContentsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetPlaylistContentsResponse implements Response { return this; } + /** * The playlist contents */ @@ -143,7 +145,6 @@ public class GetPlaylistContentsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetPlaylistContentsResponse implements Response { } GetPlaylistContentsResponse other = (GetPlaylistContentsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetPlaylistContentsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetPlaylistContentsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetPlaylistContentsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetPlaylistContentsResponse implements Response { return this; } + /** * The playlist contents */ @@ -236,13 +240,13 @@ public class GetPlaylistContentsResponse implements Response { this.object = object; return this; } - + public GetPlaylistContentsResponse build() { + return new GetPlaylistContentsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsResponseBody.java index c3429ab8..8479ced3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetPlaylistContentsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsResponseBody withMediaContainer(GetPlaylistContentsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetPlaylistContentsResponseBody { return this; } + public GetPlaylistContentsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetPlaylistContentsResponseBody { } GetPlaylistContentsResponseBody other = (GetPlaylistContentsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetPlaylistContentsResponseBody { return Utils.toString(GetPlaylistContentsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetPlaylistContentsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetPlaylistContentsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetPlaylistContentsResponseBody build() { + return new GetPlaylistContentsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRole.java index a4bdbec0..36095cd0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsRole.java @@ -11,9 +11,9 @@ 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 GetPlaylistContentsRole { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetPlaylistContentsRole { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsRole withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetPlaylistContentsRole { return this; } + public GetPlaylistContentsRole withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetPlaylistContentsRole { } GetPlaylistContentsRole other = (GetPlaylistContentsRole) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetPlaylistContentsRole { return Utils.toString(GetPlaylistContentsRole.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetPlaylistContentsRole { this.tag = tag; return this; } - + public GetPlaylistContentsRole build() { + return new GetPlaylistContentsRole( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsWriter.java index bec4656b..5d5ca0e8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsWriter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistContentsWriter.java @@ -11,9 +11,9 @@ 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 GetPlaylistContentsWriter { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetPlaylistContentsWriter { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistContentsWriter withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetPlaylistContentsWriter { return this; } + public GetPlaylistContentsWriter withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetPlaylistContentsWriter { } GetPlaylistContentsWriter other = (GetPlaylistContentsWriter) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetPlaylistContentsWriter { return Utils.toString(GetPlaylistContentsWriter.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetPlaylistContentsWriter { this.tag = tag; return this; } - + public GetPlaylistContentsWriter build() { + return new GetPlaylistContentsWriter( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistMediaContainer.java index da8faa77..0a569775 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistMediaContainer.java @@ -14,15 +14,16 @@ 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 GetPlaylistMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -52,9 +53,10 @@ public class GetPlaylistMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetPlaylistMediaContainer { return this; } + public GetPlaylistMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetPlaylistMediaContainer { return this; } + public GetPlaylistMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetPlaylistMediaContainer { } GetPlaylistMediaContainer other = (GetPlaylistMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - metadata); + return Utils.enhancedHash( + size, metadata); } @Override @@ -108,17 +110,19 @@ public class GetPlaylistMediaContainer { "size", size, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetPlaylistMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -142,11 +147,12 @@ public class GetPlaylistMediaContainer { this.metadata = metadata; return this; } - + public GetPlaylistMediaContainer build() { + return new GetPlaylistMediaContainer( - size, - metadata); + size, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistMetadata.java index fdb94e3b..a8b66cd8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistMetadata.java @@ -13,67 +13,81 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetPlaylistMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("content") private Optional content; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("smart") private Optional smart; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("playlistType") private Optional playlistType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("composite") private Optional composite; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("icon") private Optional icon; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; @@ -128,7 +142,11 @@ public class GetPlaylistMetadata { } public GetPlaylistMetadata() { - 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()); + 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()); } @JsonIgnore @@ -206,9 +224,10 @@ public class GetPlaylistMetadata { return updatedAt; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistMetadata withContent(String content) { Utils.checkNotNull(content, "content"); @@ -216,6 +235,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withContent(Optional content) { Utils.checkNotNull(content, "content"); this.content = content; @@ -228,6 +248,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -240,6 +261,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -252,6 +274,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -264,6 +287,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -276,6 +300,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -288,6 +313,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -300,6 +326,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withSmart(Optional smart) { Utils.checkNotNull(smart, "smart"); this.smart = smart; @@ -312,6 +339,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withPlaylistType(Optional playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = playlistType; @@ -324,6 +352,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withComposite(Optional composite) { Utils.checkNotNull(composite, "composite"); this.composite = composite; @@ -336,6 +365,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withIcon(Optional icon) { Utils.checkNotNull(icon, "icon"); this.icon = icon; @@ -348,6 +378,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -360,6 +391,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -372,6 +404,7 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -384,13 +417,13 @@ public class GetPlaylistMetadata { return this; } + public GetPlaylistMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -401,41 +434,31 @@ public class GetPlaylistMetadata { } GetPlaylistMetadata other = (GetPlaylistMetadata) o; return - Objects.deepEquals(this.content, other.content) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.smart, other.smart) && - Objects.deepEquals(this.playlistType, other.playlistType) && - Objects.deepEquals(this.composite, other.composite) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt); + Utils.enhancedDeepEquals(this.content, other.content) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.smart, other.smart) && + Utils.enhancedDeepEquals(this.playlistType, other.playlistType) && + Utils.enhancedDeepEquals(this.composite, other.composite) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt); } @Override public int hashCode() { - return Objects.hash( - content, - ratingKey, - key, - guid, - type, - title, - summary, - smart, - playlistType, - composite, - icon, - duration, - leafCount, - addedAt, - updatedAt); + return Utils.enhancedHash( + content, ratingKey, key, + guid, type, title, + summary, smart, playlistType, + composite, icon, duration, + leafCount, addedAt, updatedAt); } @Override @@ -457,43 +480,45 @@ public class GetPlaylistMetadata { "addedAt", addedAt, "updatedAt", updatedAt); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional content = Optional.empty(); - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional smart = Optional.empty(); - + private Optional playlistType = Optional.empty(); - + private Optional composite = Optional.empty(); - + private Optional icon = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder content(String content) { Utils.checkNotNull(content, "content"); this.content = Optional.ofNullable(content); @@ -506,6 +531,7 @@ public class GetPlaylistMetadata { return this; } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -518,6 +544,7 @@ public class GetPlaylistMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -530,6 +557,7 @@ public class GetPlaylistMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -542,6 +570,7 @@ public class GetPlaylistMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -554,6 +583,7 @@ public class GetPlaylistMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -566,6 +596,7 @@ public class GetPlaylistMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -578,6 +609,7 @@ public class GetPlaylistMetadata { return this; } + public Builder smart(boolean smart) { Utils.checkNotNull(smart, "smart"); this.smart = Optional.ofNullable(smart); @@ -590,6 +622,7 @@ public class GetPlaylistMetadata { return this; } + public Builder playlistType(String playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = Optional.ofNullable(playlistType); @@ -602,6 +635,7 @@ public class GetPlaylistMetadata { return this; } + public Builder composite(String composite) { Utils.checkNotNull(composite, "composite"); this.composite = Optional.ofNullable(composite); @@ -614,6 +648,7 @@ public class GetPlaylistMetadata { return this; } + public Builder icon(String icon) { Utils.checkNotNull(icon, "icon"); this.icon = Optional.ofNullable(icon); @@ -626,6 +661,7 @@ public class GetPlaylistMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -638,6 +674,7 @@ public class GetPlaylistMetadata { return this; } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -650,6 +687,7 @@ public class GetPlaylistMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -662,6 +700,7 @@ public class GetPlaylistMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -673,24 +712,16 @@ public class GetPlaylistMetadata { this.updatedAt = updatedAt; return this; } - + public GetPlaylistMetadata build() { + return new GetPlaylistMetadata( - content, - ratingKey, - key, - guid, - type, - title, - summary, - smart, - playlistType, - composite, - icon, - duration, - leafCount, - addedAt, - updatedAt); + content, ratingKey, key, + guid, type, title, + summary, smart, playlistType, + composite, icon, duration, + leafCount, addedAt, updatedAt); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequest.java index 1be8de04..cd491acf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetPlaylistRequest { - /** * the ID of the playlist */ @@ -35,9 +34,10 @@ public class GetPlaylistRequest { return playlistID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the ID of the playlist @@ -48,7 +48,6 @@ public class GetPlaylistRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,12 +58,12 @@ public class GetPlaylistRequest { } GetPlaylistRequest other = (GetPlaylistRequest) o; return - Objects.deepEquals(this.playlistID, other.playlistID); + Utils.enhancedDeepEquals(this.playlistID, other.playlistID); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( playlistID); } @@ -73,15 +72,17 @@ public class GetPlaylistRequest { return Utils.toString(GetPlaylistRequest.class, "playlistID", playlistID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double playlistID; - + private Builder() { // force use of static builder() method } + /** * the ID of the playlist */ @@ -90,10 +91,12 @@ public class GetPlaylistRequest { this.playlistID = playlistID; return this; } - + public GetPlaylistRequest build() { + return new GetPlaylistRequest( playlistID); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequestBuilder.java index e9773895..f99a1382 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetPlaylist; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -10,10 +14,10 @@ import java.lang.Exception; public class GetPlaylistRequestBuilder { private Double playlistID; - private final SDKMethodInterfaces.MethodCallGetPlaylist sdk; + private final SDKConfiguration sdkConfiguration; - public GetPlaylistRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylist sdk) { - this.sdk = sdk; + public GetPlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetPlaylistRequestBuilder playlistID(double playlistID) { @@ -22,9 +26,20 @@ public class GetPlaylistRequestBuilder { return this; } - public GetPlaylistResponse call() throws Exception { - return sdk.getPlaylist( - playlistID); + private GetPlaylistRequest buildRequest() { + + GetPlaylistRequest request = new GetPlaylistRequest(playlistID); + + return request; + } + + public GetPlaylistResponse call() throws Exception { + + RequestOperation operation + = new GetPlaylist.Sync(sdkConfiguration); + GetPlaylistRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistResponse.java index 2bda7632..530fa6dd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetPlaylistResponse implements Response { +public class GetPlaylistResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetPlaylistResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetPlaylistResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetPlaylistResponse implements Response { return this; } + /** * The playlist */ @@ -143,7 +145,6 @@ public class GetPlaylistResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetPlaylistResponse implements Response { } GetPlaylistResponse other = (GetPlaylistResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetPlaylistResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetPlaylistResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetPlaylistResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetPlaylistResponse implements Response { return this; } + /** * The playlist */ @@ -236,13 +240,13 @@ public class GetPlaylistResponse implements Response { this.object = object; return this; } - + public GetPlaylistResponse build() { + return new GetPlaylistResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistResponseBody.java index 5e115739..6f312c2b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetPlaylistResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistResponseBody withMediaContainer(GetPlaylistMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetPlaylistResponseBody { return this; } + public GetPlaylistResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetPlaylistResponseBody { } GetPlaylistResponseBody other = (GetPlaylistResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetPlaylistResponseBody { return Utils.toString(GetPlaylistResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetPlaylistMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetPlaylistResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetPlaylistResponseBody build() { + return new GetPlaylistResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsMediaContainer.java index ce0ed103..19781a91 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsMediaContainer.java @@ -14,15 +14,16 @@ 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 GetPlaylistsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -52,9 +53,10 @@ public class GetPlaylistsMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetPlaylistsMediaContainer { return this; } + public GetPlaylistsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetPlaylistsMediaContainer { return this; } + public GetPlaylistsMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetPlaylistsMediaContainer { } GetPlaylistsMediaContainer other = (GetPlaylistsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - metadata); + return Utils.enhancedHash( + size, metadata); } @Override @@ -108,17 +110,19 @@ public class GetPlaylistsMediaContainer { "size", size, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetPlaylistsMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -142,11 +147,12 @@ public class GetPlaylistsMediaContainer { this.metadata = metadata; return this; } - + public GetPlaylistsMediaContainer build() { + return new GetPlaylistsMediaContainer( - size, - metadata); + size, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsMetadata.java index d52f4e29..d3aab9c2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsMetadata.java @@ -13,71 +13,86 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetPlaylistsMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("smart") private Optional smart; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("playlistType") private Optional playlistType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("composite") private Optional composite; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("icon") private Optional icon; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewCount") private Optional viewCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("lastViewedAt") private Optional lastViewedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; @@ -135,7 +150,12 @@ public class GetPlaylistsMetadata { } public GetPlaylistsMetadata() { - 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()); + 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()); } @JsonIgnore @@ -218,9 +238,10 @@ public class GetPlaylistsMetadata { return updatedAt; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistsMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -228,6 +249,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -240,6 +262,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -252,6 +275,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -264,6 +288,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -276,6 +301,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -288,6 +314,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -300,6 +327,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withSmart(Optional smart) { Utils.checkNotNull(smart, "smart"); this.smart = smart; @@ -312,6 +340,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withPlaylistType(Optional playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = playlistType; @@ -324,6 +353,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withComposite(Optional composite) { Utils.checkNotNull(composite, "composite"); this.composite = composite; @@ -336,6 +366,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withIcon(Optional icon) { Utils.checkNotNull(icon, "icon"); this.icon = icon; @@ -348,6 +379,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withViewCount(Optional viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = viewCount; @@ -360,6 +392,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withLastViewedAt(Optional lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = lastViewedAt; @@ -372,6 +405,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -384,6 +418,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -396,6 +431,7 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -408,13 +444,13 @@ public class GetPlaylistsMetadata { return this; } + public GetPlaylistsMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -425,42 +461,32 @@ public class GetPlaylistsMetadata { } GetPlaylistsMetadata other = (GetPlaylistsMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.smart, other.smart) && - Objects.deepEquals(this.playlistType, other.playlistType) && - Objects.deepEquals(this.composite, other.composite) && - Objects.deepEquals(this.icon, other.icon) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.smart, other.smart) && + Utils.enhancedDeepEquals(this.playlistType, other.playlistType) && + Utils.enhancedDeepEquals(this.composite, other.composite) && + Utils.enhancedDeepEquals(this.icon, other.icon) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - type, - title, - summary, - smart, - playlistType, - composite, - icon, - viewCount, - lastViewedAt, - duration, - leafCount, - addedAt, + return Utils.enhancedHash( + ratingKey, key, guid, + type, title, summary, + smart, playlistType, composite, + icon, viewCount, lastViewedAt, + duration, leafCount, addedAt, updatedAt); } @@ -484,45 +510,47 @@ public class GetPlaylistsMetadata { "addedAt", addedAt, "updatedAt", updatedAt); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional smart = Optional.empty(); - + private Optional playlistType = Optional.empty(); - + private Optional composite = Optional.empty(); - + private Optional icon = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -535,6 +563,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -547,6 +576,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -559,6 +589,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -571,6 +602,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -583,6 +615,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -595,6 +628,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder smart(boolean smart) { Utils.checkNotNull(smart, "smart"); this.smart = Optional.ofNullable(smart); @@ -607,6 +641,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder playlistType(String playlistType) { Utils.checkNotNull(playlistType, "playlistType"); this.playlistType = Optional.ofNullable(playlistType); @@ -619,6 +654,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder composite(String composite) { Utils.checkNotNull(composite, "composite"); this.composite = Optional.ofNullable(composite); @@ -631,6 +667,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder icon(String icon) { Utils.checkNotNull(icon, "icon"); this.icon = Optional.ofNullable(icon); @@ -643,6 +680,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder viewCount(int viewCount) { Utils.checkNotNull(viewCount, "viewCount"); this.viewCount = Optional.ofNullable(viewCount); @@ -655,6 +693,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder lastViewedAt(int lastViewedAt) { Utils.checkNotNull(lastViewedAt, "lastViewedAt"); this.lastViewedAt = Optional.ofNullable(lastViewedAt); @@ -667,6 +706,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -679,6 +719,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -691,6 +732,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -703,6 +745,7 @@ public class GetPlaylistsMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -714,25 +757,17 @@ public class GetPlaylistsMetadata { this.updatedAt = updatedAt; return this; } - + public GetPlaylistsMetadata build() { + return new GetPlaylistsMetadata( - ratingKey, - key, - guid, - type, - title, - summary, - smart, - playlistType, - composite, - icon, - viewCount, - lastViewedAt, - duration, - leafCount, - addedAt, + ratingKey, key, guid, + type, title, summary, + smart, playlistType, composite, + icon, viewCount, lastViewedAt, + duration, leafCount, addedAt, updatedAt); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequest.java index 3a2fe0ae..fa1de942 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequest.java @@ -10,11 +10,10 @@ 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 GetPlaylistsRequest { +public class GetPlaylistsRequest { /** * limit to a type of playlist. */ @@ -59,9 +58,10 @@ public class GetPlaylistsRequest { return (Optional) smart; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * limit to a type of playlist. @@ -72,6 +72,7 @@ public class GetPlaylistsRequest { return this; } + /** * limit to a type of playlist. */ @@ -90,6 +91,7 @@ public class GetPlaylistsRequest { return this; } + /** * type of playlists to return (default is all). */ @@ -99,7 +101,6 @@ public class GetPlaylistsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,15 +111,14 @@ public class GetPlaylistsRequest { } GetPlaylistsRequest other = (GetPlaylistsRequest) o; return - Objects.deepEquals(this.playlistType, other.playlistType) && - Objects.deepEquals(this.smart, other.smart); + Utils.enhancedDeepEquals(this.playlistType, other.playlistType) && + Utils.enhancedDeepEquals(this.smart, other.smart); } @Override public int hashCode() { - return Objects.hash( - playlistType, - smart); + return Utils.enhancedHash( + playlistType, smart); } @Override @@ -127,17 +127,19 @@ public class GetPlaylistsRequest { "playlistType", playlistType, "smart", smart); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional playlistType = Optional.empty(); - + private Optional smart = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * limit to a type of playlist. */ @@ -156,6 +158,7 @@ public class GetPlaylistsRequest { return this; } + /** * type of playlists to return (default is all). */ @@ -173,11 +176,12 @@ public class GetPlaylistsRequest { this.smart = smart; return this; } - + public GetPlaylistsRequest build() { + return new GetPlaylistsRequest( - playlistType, - smart); + playlistType, smart); } + } } 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 c7e64356..7468df3a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetPlaylists; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.util.Optional; @@ -11,10 +15,10 @@ public class GetPlaylistsRequestBuilder { private Optional playlistType = Optional.empty(); private Optional smart = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetPlaylists sdk; + private final SDKConfiguration sdkConfiguration; - public GetPlaylistsRequestBuilder(SDKMethodInterfaces.MethodCallGetPlaylists sdk) { - this.sdk = sdk; + public GetPlaylistsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetPlaylistsRequestBuilder playlistType(PlaylistType playlistType) { @@ -41,10 +45,21 @@ public class GetPlaylistsRequestBuilder { return this; } - public GetPlaylistsResponse call() throws Exception { - return sdk.getPlaylists( - playlistType, + private GetPlaylistsRequest buildRequest() { + + GetPlaylistsRequest request = new GetPlaylistsRequest(playlistType, smart); + + return request; + } + + public GetPlaylistsResponse call() throws Exception { + + RequestOperation operation + = new GetPlaylists.Sync(sdkConfiguration); + GetPlaylistsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsResponse.java index 5aaf3754..32dbe392 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetPlaylistsResponse implements Response { +public class GetPlaylistsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetPlaylistsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetPlaylistsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetPlaylistsResponse implements Response { return this; } + /** * returns all playlists */ @@ -143,7 +145,6 @@ public class GetPlaylistsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetPlaylistsResponse implements Response { } GetPlaylistsResponse other = (GetPlaylistsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetPlaylistsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetPlaylistsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetPlaylistsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetPlaylistsResponse implements Response { return this; } + /** * returns all playlists */ @@ -236,13 +240,13 @@ public class GetPlaylistsResponse implements Response { this.object = object; return this; } - + public GetPlaylistsResponse build() { + return new GetPlaylistsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsResponseBody.java index 14554090..e5855396 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetPlaylistsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetPlaylistsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetPlaylistsResponseBody withMediaContainer(GetPlaylistsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetPlaylistsResponseBody { return this; } + public GetPlaylistsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetPlaylistsResponseBody { } GetPlaylistsResponseBody other = (GetPlaylistsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetPlaylistsResponseBody { return Utils.toString(GetPlaylistsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetPlaylistsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetPlaylistsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetPlaylistsResponseBody build() { + return new GetPlaylistsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedActiveDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedActiveDirection.java index 68bcb45b..7c6d4b53 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedActiveDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedActiveDirection.java @@ -20,7 +20,7 @@ public enum GetRecentlyAddedActiveDirection { @JsonValue private final String value; - private GetRecentlyAddedActiveDirection(String value) { + GetRecentlyAddedActiveDirection(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedDefaultDirection.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedDefaultDirection.java index 81bc75e8..f992a6c3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedDefaultDirection.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedDefaultDirection.java @@ -20,7 +20,7 @@ public enum GetRecentlyAddedDefaultDirection { @JsonValue private final String value; - private GetRecentlyAddedDefaultDirection(String value) { + GetRecentlyAddedDefaultDirection(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedField.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedField.java index cc82986d..e700f146 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedField.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedField.java @@ -11,20 +11,23 @@ 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 GetRecentlyAddedField { @JsonProperty("key") private String key; + @JsonProperty("title") private String title; + @JsonProperty("type") private String type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subType") private Optional subType; @@ -49,7 +52,8 @@ public class GetRecentlyAddedField { String key, String title, String type) { - this(key, title, type, Optional.empty()); + this(key, title, type, + Optional.empty()); } @JsonIgnore @@ -72,9 +76,10 @@ public class GetRecentlyAddedField { return subType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedField withKey(String key) { Utils.checkNotNull(key, "key"); @@ -100,13 +105,13 @@ public class GetRecentlyAddedField { return this; } + public GetRecentlyAddedField withSubType(Optional subType) { Utils.checkNotNull(subType, "subType"); this.subType = subType; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -117,18 +122,16 @@ public class GetRecentlyAddedField { } GetRecentlyAddedField other = (GetRecentlyAddedField) 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subType, other.subType); } @Override public int hashCode() { - return Objects.hash( - key, - title, - type, + return Utils.enhancedHash( + key, title, type, subType); } @@ -140,39 +143,44 @@ public class GetRecentlyAddedField { "type", type, "subType", subType); } - + + @SuppressWarnings("UnusedReturnValue") 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); @@ -184,13 +192,13 @@ public class GetRecentlyAddedField { this.subType = subType; return this; } - + public GetRecentlyAddedField build() { + return new GetRecentlyAddedField( - key, - title, - type, + key, title, type, subType); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedFieldType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedFieldType.java index 1990a084..cda02f01 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedFieldType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedFieldType.java @@ -10,13 +10,14 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; + public class GetRecentlyAddedFieldType { @JsonProperty("type") private String type; + @JsonProperty("Operator") private List operator; @@ -40,9 +41,10 @@ public class GetRecentlyAddedFieldType { return operator; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedFieldType withType(String type) { Utils.checkNotNull(type, "type"); @@ -56,7 +58,6 @@ public class GetRecentlyAddedFieldType { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,15 +68,14 @@ public class GetRecentlyAddedFieldType { } GetRecentlyAddedFieldType other = (GetRecentlyAddedFieldType) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.operator, other.operator); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.operator, other.operator); } @Override public int hashCode() { - return Objects.hash( - type, - operator); + return Utils.enhancedHash( + type, operator); } @Override @@ -84,33 +84,37 @@ public class GetRecentlyAddedFieldType { "type", type, "operator", operator); } - + + @SuppressWarnings("UnusedReturnValue") 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 GetRecentlyAddedFieldType build() { + return new GetRecentlyAddedFieldType( - type, - operator); + type, operator); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedFilter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedFilter.java index afe6022f..e7f47ad1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedFilter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedFilter.java @@ -12,26 +12,31 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetRecentlyAddedFilter { @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; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("advanced") private Optional advanced; @@ -64,7 +69,8 @@ public class GetRecentlyAddedFilter { String key, String title, String type) { - this(filter, filterType, key, title, type, Optional.empty()); + this(filter, filterType, key, + title, type, Optional.empty()); } @JsonIgnore @@ -97,9 +103,10 @@ public class GetRecentlyAddedFilter { return advanced; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedFilter withFilter(String filter) { Utils.checkNotNull(filter, "filter"); @@ -137,13 +144,13 @@ public class GetRecentlyAddedFilter { return this; } + public GetRecentlyAddedFilter withAdvanced(Optional advanced) { Utils.checkNotNull(advanced, "advanced"); this.advanced = advanced; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,23 +161,19 @@ public class GetRecentlyAddedFilter { } GetRecentlyAddedFilter other = (GetRecentlyAddedFilter) 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) && - Objects.deepEquals(this.advanced, other.advanced); + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.filterType, other.filterType) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.advanced, other.advanced); } @Override public int hashCode() { - return Objects.hash( - filter, - filterType, - key, - title, - type, - advanced); + return Utils.enhancedHash( + filter, filterType, key, + title, type, advanced); } @Override @@ -183,55 +186,62 @@ public class GetRecentlyAddedFilter { "type", type, "advanced", advanced); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String filter; - + private String filterType; - + private String key; - + private String title; - + private String type; - + private Optional advanced = Optional.empty(); - + 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 Builder advanced(boolean advanced) { Utils.checkNotNull(advanced, "advanced"); this.advanced = Optional.ofNullable(advanced); @@ -243,15 +253,13 @@ public class GetRecentlyAddedFilter { this.advanced = advanced; return this; } - + public GetRecentlyAddedFilter build() { + return new GetRecentlyAddedFilter( - filter, - filterType, - key, - title, - type, - advanced); + filter, filterType, key, + title, type, advanced); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedImage.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedImage.java index 4bb081bb..3d29e59e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedImage.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedImage.java @@ -9,16 +9,18 @@ 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 GetRecentlyAddedImage { @JsonProperty("alt") private String alt; + @JsonProperty("type") private GetRecentlyAddedHubsResponseType type; + @JsonProperty("url") private String url; @@ -50,9 +52,10 @@ public class GetRecentlyAddedImage { return url; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedImage withAlt(String alt) { Utils.checkNotNull(alt, "alt"); @@ -72,7 +75,6 @@ public class GetRecentlyAddedImage { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -83,17 +85,15 @@ public class GetRecentlyAddedImage { } GetRecentlyAddedImage other = (GetRecentlyAddedImage) o; return - Objects.deepEquals(this.alt, other.alt) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.alt, other.alt) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( - alt, - type, - url); + return Utils.enhancedHash( + alt, type, url); } @Override @@ -103,42 +103,46 @@ public class GetRecentlyAddedImage { "type", type, "url", url); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String alt; - + private GetRecentlyAddedHubsResponseType type; - + private String url; - + private Builder() { // force use of static builder() method } + public Builder alt(String alt) { Utils.checkNotNull(alt, "alt"); this.alt = alt; return this; } + public Builder type(GetRecentlyAddedHubsResponseType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder url(String url) { Utils.checkNotNull(url, "url"); this.url = url; return this; } - + public GetRecentlyAddedImage build() { + return new GetRecentlyAddedImage( - alt, - type, - url); + alt, type, url); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryCountry.java index b0813527..96d74990 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryCountry.java @@ -11,9 +11,9 @@ 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 GetRecentlyAddedLibraryCountry { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetRecentlyAddedLibraryCountry { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryCountry withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetRecentlyAddedLibraryCountry { return this; } + public GetRecentlyAddedLibraryCountry withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetRecentlyAddedLibraryCountry { } GetRecentlyAddedLibraryCountry other = (GetRecentlyAddedLibraryCountry) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetRecentlyAddedLibraryCountry { return Utils.toString(GetRecentlyAddedLibraryCountry.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetRecentlyAddedLibraryCountry { this.tag = tag; return this; } - + public GetRecentlyAddedLibraryCountry build() { + return new GetRecentlyAddedLibraryCountry( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryDirector.java index 6fab3195..4961f0de 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryDirector.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryDirector.java @@ -11,9 +11,9 @@ 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 GetRecentlyAddedLibraryDirector { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetRecentlyAddedLibraryDirector { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryDirector withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetRecentlyAddedLibraryDirector { return this; } + public GetRecentlyAddedLibraryDirector withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetRecentlyAddedLibraryDirector { } GetRecentlyAddedLibraryDirector other = (GetRecentlyAddedLibraryDirector) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetRecentlyAddedLibraryDirector { return Utils.toString(GetRecentlyAddedLibraryDirector.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetRecentlyAddedLibraryDirector { this.tag = tag; return this; } - + public GetRecentlyAddedLibraryDirector build() { + return new GetRecentlyAddedLibraryDirector( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryFilter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryFilter.java index 71d9f08b..dd2f3f41 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryFilter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryFilter.java @@ -12,26 +12,31 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetRecentlyAddedLibraryFilter { @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; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("advanced") private Optional advanced; @@ -64,7 +69,8 @@ public class GetRecentlyAddedLibraryFilter { String key, String title, String type) { - this(filter, filterType, key, title, type, Optional.empty()); + this(filter, filterType, key, + title, type, Optional.empty()); } @JsonIgnore @@ -97,9 +103,10 @@ public class GetRecentlyAddedLibraryFilter { return advanced; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryFilter withFilter(String filter) { Utils.checkNotNull(filter, "filter"); @@ -137,13 +144,13 @@ public class GetRecentlyAddedLibraryFilter { return this; } + public GetRecentlyAddedLibraryFilter withAdvanced(Optional advanced) { Utils.checkNotNull(advanced, "advanced"); this.advanced = advanced; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,23 +161,19 @@ public class GetRecentlyAddedLibraryFilter { } GetRecentlyAddedLibraryFilter other = (GetRecentlyAddedLibraryFilter) 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) && - Objects.deepEquals(this.advanced, other.advanced); + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.filterType, other.filterType) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.advanced, other.advanced); } @Override public int hashCode() { - return Objects.hash( - filter, - filterType, - key, - title, - type, - advanced); + return Utils.enhancedHash( + filter, filterType, key, + title, type, advanced); } @Override @@ -183,55 +186,62 @@ public class GetRecentlyAddedLibraryFilter { "type", type, "advanced", advanced); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String filter; - + private String filterType; - + private String key; - + private String title; - + private String type; - + private Optional advanced = Optional.empty(); - + 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 Builder advanced(boolean advanced) { Utils.checkNotNull(advanced, "advanced"); this.advanced = Optional.ofNullable(advanced); @@ -243,15 +253,13 @@ public class GetRecentlyAddedLibraryFilter { this.advanced = advanced; return this; } - + public GetRecentlyAddedLibraryFilter build() { + return new GetRecentlyAddedLibraryFilter( - filter, - filterType, - key, - title, - type, - advanced); + filter, filterType, key, + title, type, advanced); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryGenre.java index 8a0b832b..3384a554 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryGenre.java @@ -11,9 +11,9 @@ 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 GetRecentlyAddedLibraryGenre { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetRecentlyAddedLibraryGenre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryGenre withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetRecentlyAddedLibraryGenre { return this; } + public GetRecentlyAddedLibraryGenre withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetRecentlyAddedLibraryGenre { } GetRecentlyAddedLibraryGenre other = (GetRecentlyAddedLibraryGenre) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetRecentlyAddedLibraryGenre { return Utils.toString(GetRecentlyAddedLibraryGenre.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetRecentlyAddedLibraryGenre { this.tag = tag; return this; } - + public GetRecentlyAddedLibraryGenre build() { + return new GetRecentlyAddedLibraryGenre( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMedia.java index 34105970..ba1afdb1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMedia.java @@ -15,71 +15,86 @@ 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 GetRecentlyAddedLibraryMedia { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") private Optional bitrate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("width") private Optional width; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("height") private Optional height; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("aspectRatio") private Optional aspectRatio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") private Optional audioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoCodec") private Optional videoCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoResolution") private Optional videoResolution; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoFrameRate") private Optional videoFrameRate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Part") private Optional> part; @@ -137,7 +152,12 @@ public class GetRecentlyAddedLibraryMedia { } public GetRecentlyAddedLibraryMedia() { - 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()); + 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()); } @JsonIgnore @@ -221,9 +241,10 @@ public class GetRecentlyAddedLibraryMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryMedia withId(double id) { Utils.checkNotNull(id, "id"); @@ -231,6 +252,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -243,6 +265,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -255,6 +278,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; @@ -267,6 +291,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withWidth(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; @@ -279,6 +304,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withHeight(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; @@ -291,6 +317,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withAspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; @@ -303,6 +330,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; @@ -315,6 +343,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; @@ -327,6 +356,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withVideoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; @@ -339,6 +369,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withVideoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; @@ -351,6 +382,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -363,6 +395,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withVideoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; @@ -375,6 +408,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withOptimizedForStreaming(Optional optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = optimizedForStreaming; @@ -387,6 +421,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -399,6 +434,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; @@ -411,13 +447,13 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public GetRecentlyAddedLibraryMedia withPart(Optional> part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -428,42 +464,32 @@ public class GetRecentlyAddedLibraryMedia { } GetRecentlyAddedLibraryMedia other = (GetRecentlyAddedLibraryMedia) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - optimizedForStreaming, - has64bitOffsets, - videoProfile, + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, audioCodec, videoCodec, + videoResolution, container, videoFrameRate, + optimizedForStreaming, has64bitOffsets, videoProfile, part); } @@ -487,45 +513,47 @@ public class GetRecentlyAddedLibraryMedia { "videoProfile", videoProfile, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(double id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -538,6 +566,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder duration(double duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -550,6 +579,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder bitrate(double bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = Optional.ofNullable(bitrate); @@ -562,6 +592,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder width(double width) { Utils.checkNotNull(width, "width"); this.width = Optional.ofNullable(width); @@ -574,6 +605,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder height(double height) { Utils.checkNotNull(height, "height"); this.height = Optional.ofNullable(height); @@ -586,6 +618,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder aspectRatio(double aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = Optional.ofNullable(aspectRatio); @@ -598,6 +631,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder audioChannels(double audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = Optional.ofNullable(audioChannels); @@ -610,6 +644,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder audioCodec(String audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = Optional.ofNullable(audioCodec); @@ -622,6 +657,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder videoCodec(String videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = Optional.ofNullable(videoCodec); @@ -634,6 +670,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder videoResolution(double videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = Optional.ofNullable(videoResolution); @@ -646,6 +683,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -658,6 +696,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder videoFrameRate(String videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = Optional.ofNullable(videoFrameRate); @@ -670,6 +709,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder optimizedForStreaming(double optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); @@ -682,6 +722,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -694,6 +735,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); @@ -706,6 +748,7 @@ public class GetRecentlyAddedLibraryMedia { return this; } + public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = Optional.ofNullable(part); @@ -717,25 +760,17 @@ public class GetRecentlyAddedLibraryMedia { this.part = part; return this; } - + public GetRecentlyAddedLibraryMedia build() { + return new GetRecentlyAddedLibraryMedia( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - optimizedForStreaming, - has64bitOffsets, - videoProfile, + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, audioCodec, videoCodec, + videoResolution, container, videoFrameRate, + optimizedForStreaming, has64bitOffsets, videoProfile, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMediaContainer.java index c057f2cf..d3f2b899 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMediaContainer.java @@ -15,7 +15,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -29,34 +28,42 @@ public class GetRecentlyAddedLibraryMediaContainer { @JsonProperty("Type") private Optional> type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("FieldType") private Optional> fieldType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagPrefix") private Optional mediaTagPrefix; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagVersion") private Optional mediaTagVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mixedParents") private Optional mixedParents; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -93,7 +100,9 @@ public class GetRecentlyAddedLibraryMediaContainer { } public GetRecentlyAddedLibraryMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @SuppressWarnings("unchecked") @@ -144,9 +153,10 @@ public class GetRecentlyAddedLibraryMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryMediaContainer withType(List type) { Utils.checkNotNull(type, "type"); @@ -154,6 +164,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withType(Optional> type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -166,6 +177,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withFieldType(Optional> fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = fieldType; @@ -178,6 +190,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -190,6 +203,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -202,6 +216,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -214,6 +229,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withMediaTagPrefix(Optional mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = mediaTagPrefix; @@ -226,6 +242,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withMediaTagVersion(Optional mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = mediaTagVersion; @@ -238,6 +255,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withMixedParents(Optional mixedParents) { Utils.checkNotNull(mixedParents, "mixedParents"); this.mixedParents = mixedParents; @@ -250,13 +268,13 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public GetRecentlyAddedLibraryMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -267,29 +285,23 @@ public class GetRecentlyAddedLibraryMediaContainer { } GetRecentlyAddedLibraryMediaContainer other = (GetRecentlyAddedLibraryMediaContainer) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.fieldType, other.fieldType) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.mixedParents, other.mixedParents) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.fieldType, other.fieldType) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.mixedParents, other.mixedParents) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - type, - fieldType, - size, - allowSync, - identifier, - mediaTagPrefix, - mediaTagVersion, - mixedParents, - metadata); + return Utils.enhancedHash( + type, fieldType, size, + allowSync, identifier, mediaTagPrefix, + mediaTagVersion, mixedParents, metadata); } @Override @@ -305,31 +317,33 @@ public class GetRecentlyAddedLibraryMediaContainer { "mixedParents", mixedParents, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> type = Optional.empty(); - + private Optional> fieldType = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional allowSync = Optional.empty(); - + private Optional identifier = Optional.empty(); - + private Optional mediaTagPrefix = Optional.empty(); - + private Optional mediaTagVersion = Optional.empty(); - + private Optional mixedParents = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder type(List type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -342,6 +356,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public Builder fieldType(List fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = Optional.ofNullable(fieldType); @@ -354,6 +369,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public Builder size(double size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -366,6 +382,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -378,6 +395,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -390,6 +408,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public Builder mediaTagPrefix(String mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); @@ -402,6 +421,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public Builder mediaTagVersion(double mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); @@ -414,6 +434,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public Builder mixedParents(boolean mixedParents) { Utils.checkNotNull(mixedParents, "mixedParents"); this.mixedParents = Optional.ofNullable(mixedParents); @@ -426,6 +447,7 @@ public class GetRecentlyAddedLibraryMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -437,18 +459,14 @@ public class GetRecentlyAddedLibraryMediaContainer { this.metadata = metadata; return this; } - + public GetRecentlyAddedLibraryMediaContainer build() { + return new GetRecentlyAddedLibraryMediaContainer( - type, - fieldType, - size, - allowSync, - identifier, - mediaTagPrefix, - mediaTagVersion, - mixedParents, - metadata); + type, fieldType, size, + allowSync, identifier, mediaTagPrefix, + mediaTagVersion, mixedParents, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMetadata.java index d212ed24..a929c501 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryMetadata.java @@ -16,135 +16,166 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; + public class GetRecentlyAddedLibraryMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionUUID") private Optional librarySectionUUID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("studio") private Optional studio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentRating") private Optional contentRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("rating") private Optional rating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRating") private Optional audienceRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("year") private Optional year; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagline") private Optional tagline; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRatingImage") private Optional audienceRatingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("chapterSource") private Optional chapterSource; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("primaryExtraKey") private Optional primaryExtraKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingImage") private Optional ratingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; @@ -250,7 +281,17 @@ public class GetRecentlyAddedLibraryMetadata { } public GetRecentlyAddedLibraryMetadata() { - 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()); + 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()); } @JsonIgnore @@ -419,9 +460,10 @@ public class GetRecentlyAddedLibraryMetadata { return (Optional>) role; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryMetadata withAllowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); @@ -429,6 +471,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -441,6 +484,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -453,6 +497,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -465,6 +510,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withLibrarySectionUUID(Optional librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = librarySectionUUID; @@ -477,6 +523,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -489,6 +536,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -501,6 +549,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -513,6 +562,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withStudio(Optional studio) { Utils.checkNotNull(studio, "studio"); this.studio = studio; @@ -525,6 +575,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -537,6 +588,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -549,6 +601,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withContentRating(Optional contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = contentRating; @@ -561,6 +614,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -573,6 +627,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withRating(Optional rating) { Utils.checkNotNull(rating, "rating"); this.rating = rating; @@ -585,6 +640,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withAudienceRating(Optional audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = audienceRating; @@ -597,6 +653,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withYear(Optional year) { Utils.checkNotNull(year, "year"); this.year = year; @@ -609,6 +666,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withTagline(Optional tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = tagline; @@ -621,6 +679,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -633,6 +692,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -645,6 +705,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -657,6 +718,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = originallyAvailableAt; @@ -669,6 +731,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -681,6 +744,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -693,6 +757,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withAudienceRatingImage(Optional audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = audienceRatingImage; @@ -705,6 +770,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withChapterSource(Optional chapterSource) { Utils.checkNotNull(chapterSource, "chapterSource"); this.chapterSource = chapterSource; @@ -717,6 +783,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withPrimaryExtraKey(Optional primaryExtraKey) { Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); this.primaryExtraKey = primaryExtraKey; @@ -729,6 +796,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withRatingImage(Optional ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = ratingImage; @@ -741,6 +809,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -753,6 +822,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -765,6 +835,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -777,6 +848,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -789,6 +861,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -801,13 +874,13 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public GetRecentlyAddedLibraryMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -818,75 +891,54 @@ public class GetRecentlyAddedLibraryMetadata { } GetRecentlyAddedLibraryMetadata other = (GetRecentlyAddedLibraryMetadata) o; return - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.chapterSource, other.chapterSource) && - Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.role, other.role); + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionUUID, other.librarySectionUUID) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.chapterSource, other.chapterSource) && + Utils.enhancedDeepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.role, other.role); } @Override public int hashCode() { - return Objects.hash( - allowSync, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - ratingKey, - key, - guid, - studio, - type, - title, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - ratingImage, - media, - genre, - director, - writer, - country, - role); + return Utils.enhancedHash( + allowSync, librarySectionID, librarySectionTitle, + librarySectionUUID, ratingKey, key, + guid, studio, type, + title, contentRating, summary, + rating, audienceRating, year, + tagline, thumb, art, + duration, originallyAvailableAt, addedAt, + updatedAt, audienceRatingImage, chapterSource, + primaryExtraKey, ratingImage, media, + genre, director, writer, + country, role); } @Override @@ -925,77 +977,79 @@ public class GetRecentlyAddedLibraryMetadata { "country", country, "role", role); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional allowSync = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionUUID = Optional.empty(); - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional studio = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional contentRating = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional rating = Optional.empty(); - + private Optional audienceRating = Optional.empty(); - + private Optional year = Optional.empty(); - + private Optional tagline = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional originallyAvailableAt = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional chapterSource = Optional.empty(); - + private Optional primaryExtraKey = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -1008,6 +1062,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder librarySectionID(double librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -1020,6 +1075,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -1032,6 +1088,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder librarySectionUUID(String librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); @@ -1044,6 +1101,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder ratingKey(double ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -1056,6 +1114,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -1068,6 +1127,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -1080,6 +1140,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder studio(String studio) { Utils.checkNotNull(studio, "studio"); this.studio = Optional.ofNullable(studio); @@ -1092,6 +1153,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -1104,6 +1166,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -1116,6 +1179,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder contentRating(String contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = Optional.ofNullable(contentRating); @@ -1128,6 +1192,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -1140,6 +1205,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder rating(double rating) { Utils.checkNotNull(rating, "rating"); this.rating = Optional.ofNullable(rating); @@ -1152,6 +1218,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder audienceRating(double audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = Optional.ofNullable(audienceRating); @@ -1164,6 +1231,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder year(double year) { Utils.checkNotNull(year, "year"); this.year = Optional.ofNullable(year); @@ -1176,6 +1244,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder tagline(String tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = Optional.ofNullable(tagline); @@ -1188,6 +1257,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -1200,6 +1270,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -1212,6 +1283,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder duration(double duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -1224,6 +1296,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder originallyAvailableAt(OffsetDateTime originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); @@ -1236,6 +1309,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder addedAt(double addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -1248,6 +1322,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder updatedAt(double updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -1260,6 +1335,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder audienceRatingImage(String audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); @@ -1272,6 +1348,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder chapterSource(String chapterSource) { Utils.checkNotNull(chapterSource, "chapterSource"); this.chapterSource = Optional.ofNullable(chapterSource); @@ -1284,6 +1361,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder primaryExtraKey(String primaryExtraKey) { Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); @@ -1296,6 +1374,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder ratingImage(String ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = Optional.ofNullable(ratingImage); @@ -1308,6 +1387,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -1320,6 +1400,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -1332,6 +1413,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -1344,6 +1426,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -1356,6 +1439,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -1368,6 +1452,7 @@ public class GetRecentlyAddedLibraryMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -1379,41 +1464,22 @@ public class GetRecentlyAddedLibraryMetadata { this.role = role; return this; } - + public GetRecentlyAddedLibraryMetadata build() { + return new GetRecentlyAddedLibraryMetadata( - allowSync, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - ratingKey, - key, - guid, - studio, - type, - title, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - ratingImage, - media, - genre, - director, - writer, - country, - role); + allowSync, librarySectionID, librarySectionTitle, + librarySectionUUID, ratingKey, key, + guid, studio, type, + title, contentRating, summary, + rating, audienceRating, year, + tagline, thumb, art, + duration, originallyAvailableAt, addedAt, + updatedAt, audienceRatingImage, chapterSource, + primaryExtraKey, ratingImage, media, + genre, director, writer, + country, role); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryPart.java index 8a1602dc..0e8082b4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryPart.java @@ -13,47 +13,56 @@ import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetRecentlyAddedLibraryPart { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("file") private Optional file; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasThumbnail") private Optional hasThumbnail; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; @@ -93,7 +102,10 @@ public class GetRecentlyAddedLibraryPart { } public GetRecentlyAddedLibraryPart() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -146,9 +158,10 @@ public class GetRecentlyAddedLibraryPart { return videoProfile; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryPart withId(double id) { Utils.checkNotNull(id, "id"); @@ -156,6 +169,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -168,6 +182,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -180,6 +195,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -192,6 +208,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withFile(Optional file) { Utils.checkNotNull(file, "file"); this.file = file; @@ -204,6 +221,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -216,6 +234,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -228,6 +247,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -240,6 +260,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withHasThumbnail(Optional hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = hasThumbnail; @@ -252,6 +273,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withOptimizedForStreaming(Optional optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = optimizedForStreaming; @@ -264,13 +286,13 @@ public class GetRecentlyAddedLibraryPart { return this; } + public GetRecentlyAddedLibraryPart withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -281,30 +303,24 @@ public class GetRecentlyAddedLibraryPart { } GetRecentlyAddedLibraryPart other = (GetRecentlyAddedLibraryPart) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.hasThumbnail, other.hasThumbnail) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.videoProfile, other.videoProfile); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.hasThumbnail, other.hasThumbnail) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile); } @Override public int hashCode() { - return Objects.hash( - id, - key, - duration, - file, - size, - container, - has64bitOffsets, - hasThumbnail, - optimizedForStreaming, + return Utils.enhancedHash( + id, key, duration, + file, size, container, + has64bitOffsets, hasThumbnail, optimizedForStreaming, videoProfile); } @@ -322,33 +338,35 @@ public class GetRecentlyAddedLibraryPart { "optimizedForStreaming", optimizedForStreaming, "videoProfile", videoProfile); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional file = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional hasThumbnail = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(double id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -361,6 +379,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -373,6 +392,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder duration(double duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -385,6 +405,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder file(String file) { Utils.checkNotNull(file, "file"); this.file = Optional.ofNullable(file); @@ -397,6 +418,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder size(double size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -409,6 +431,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -421,6 +444,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -433,6 +457,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder hasThumbnail(double hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = Optional.ofNullable(hasThumbnail); @@ -445,6 +470,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder optimizedForStreaming(boolean optimizedForStreaming) { Utils.checkNotNull(optimizedForStreaming, "optimizedForStreaming"); this.optimizedForStreaming = Optional.ofNullable(optimizedForStreaming); @@ -457,6 +483,7 @@ public class GetRecentlyAddedLibraryPart { return this; } + public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); @@ -468,19 +495,15 @@ public class GetRecentlyAddedLibraryPart { this.videoProfile = videoProfile; return this; } - + public GetRecentlyAddedLibraryPart build() { + return new GetRecentlyAddedLibraryPart( - id, - key, - duration, - file, - size, - container, - has64bitOffsets, - hasThumbnail, - optimizedForStreaming, + id, key, duration, + file, size, container, + has64bitOffsets, hasThumbnail, optimizedForStreaming, videoProfile); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequest.java index bcd46fc4..d862f065 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequest.java @@ -15,14 +15,15 @@ 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 GetRecentlyAddedLibraryRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=contentDirectoryID") private Optional contentDirectoryID; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=pinnedContentDirectoryID") private Optional> pinnedContentDirectoryID; @@ -92,7 +93,9 @@ public class GetRecentlyAddedLibraryRequest { public GetRecentlyAddedLibraryRequest( QueryParamType type) { - this(Optional.empty(), Optional.empty(), Optional.empty(), type, Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + type, Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -156,9 +159,10 @@ public class GetRecentlyAddedLibraryRequest { return xPlexContainerSize; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryRequest withContentDirectoryID(long contentDirectoryID) { Utils.checkNotNull(contentDirectoryID, "contentDirectoryID"); @@ -166,6 +170,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + public GetRecentlyAddedLibraryRequest withContentDirectoryID(Optional contentDirectoryID) { Utils.checkNotNull(contentDirectoryID, "contentDirectoryID"); this.contentDirectoryID = contentDirectoryID; @@ -178,6 +183,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + public GetRecentlyAddedLibraryRequest withPinnedContentDirectoryID(Optional> pinnedContentDirectoryID) { Utils.checkNotNull(pinnedContentDirectoryID, "pinnedContentDirectoryID"); this.pinnedContentDirectoryID = pinnedContentDirectoryID; @@ -193,6 +199,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * The library section ID for filtering content. */ @@ -225,6 +232,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * Adds the Meta object to the response */ @@ -245,6 +253,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -267,6 +276,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -278,7 +288,6 @@ public class GetRecentlyAddedLibraryRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -289,24 +298,20 @@ public class GetRecentlyAddedLibraryRequest { } GetRecentlyAddedLibraryRequest other = (GetRecentlyAddedLibraryRequest) o; return - Objects.deepEquals(this.contentDirectoryID, other.contentDirectoryID) && - Objects.deepEquals(this.pinnedContentDirectoryID, other.pinnedContentDirectoryID) && - Objects.deepEquals(this.sectionID, other.sectionID) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.includeMeta, other.includeMeta) && - Objects.deepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && - Objects.deepEquals(this.xPlexContainerSize, other.xPlexContainerSize); + Utils.enhancedDeepEquals(this.contentDirectoryID, other.contentDirectoryID) && + Utils.enhancedDeepEquals(this.pinnedContentDirectoryID, other.pinnedContentDirectoryID) && + Utils.enhancedDeepEquals(this.sectionID, other.sectionID) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.includeMeta, other.includeMeta) && + Utils.enhancedDeepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && + Utils.enhancedDeepEquals(this.xPlexContainerSize, other.xPlexContainerSize); } @Override public int hashCode() { - return Objects.hash( - contentDirectoryID, - pinnedContentDirectoryID, - sectionID, - type, - includeMeta, - xPlexContainerStart, + return Utils.enhancedHash( + contentDirectoryID, pinnedContentDirectoryID, sectionID, + type, includeMeta, xPlexContainerStart, xPlexContainerSize); } @@ -321,27 +326,29 @@ public class GetRecentlyAddedLibraryRequest { "xPlexContainerStart", xPlexContainerStart, "xPlexContainerSize", xPlexContainerSize); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional contentDirectoryID = Optional.empty(); - + private Optional> pinnedContentDirectoryID = Optional.empty(); - + private Optional sectionID = Optional.empty(); - + private QueryParamType type; - + private Optional includeMeta; - + private Optional xPlexContainerStart; - + private Optional xPlexContainerSize; - + private Builder() { // force use of static builder() method } + public Builder contentDirectoryID(long contentDirectoryID) { Utils.checkNotNull(contentDirectoryID, "contentDirectoryID"); this.contentDirectoryID = Optional.ofNullable(contentDirectoryID); @@ -354,6 +361,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + public Builder pinnedContentDirectoryID(List pinnedContentDirectoryID) { Utils.checkNotNull(pinnedContentDirectoryID, "pinnedContentDirectoryID"); this.pinnedContentDirectoryID = Optional.ofNullable(pinnedContentDirectoryID); @@ -366,6 +374,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * The library section ID for filtering content. */ @@ -384,6 +393,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * The type of media to retrieve or filter by. * 1 = movie @@ -398,6 +408,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * Adds the Meta object to the response */ @@ -416,6 +427,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -438,6 +450,7 @@ public class GetRecentlyAddedLibraryRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -459,7 +472,7 @@ public class GetRecentlyAddedLibraryRequest { this.xPlexContainerSize = xPlexContainerSize; return this; } - + public GetRecentlyAddedLibraryRequest build() { if (includeMeta == null) { includeMeta = _SINGLETON_VALUE_IncludeMeta.value(); @@ -470,16 +483,14 @@ public class GetRecentlyAddedLibraryRequest { if (xPlexContainerSize == null) { xPlexContainerSize = _SINGLETON_VALUE_XPlexContainerSize.value(); } + return new GetRecentlyAddedLibraryRequest( - contentDirectoryID, - pinnedContentDirectoryID, - sectionID, - type, - includeMeta, - xPlexContainerStart, + contentDirectoryID, pinnedContentDirectoryID, sectionID, + type, includeMeta, xPlexContainerStart, xPlexContainerSize); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeMeta = new LazySingletonValue<>( "includeMeta", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequestBuilder.java index a7a1c2da..28bc60c8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetRecentlyAddedLibrary; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetRecentlyAddedLibraryRequestBuilder { private GetRecentlyAddedLibraryRequest request; - private final SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk; + private final SDKConfiguration sdkConfiguration; - public GetRecentlyAddedLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAddedLibrary sdk) { - this.sdk = sdk; + public GetRecentlyAddedLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetRecentlyAddedLibraryRequestBuilder request(GetRecentlyAddedLibraryRequest request) { @@ -22,8 +26,10 @@ public class GetRecentlyAddedLibraryRequestBuilder { } public GetRecentlyAddedLibraryResponse call() throws Exception { + + RequestOperation operation + = new GetRecentlyAddedLibrary.Sync(sdkConfiguration); - return sdk.getRecentlyAddedLibrary( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryResponse.java index 7366b02a..1e0f9ab7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetRecentlyAddedLibraryResponse implements Response { +public class GetRecentlyAddedLibraryResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetRecentlyAddedLibraryResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetRecentlyAddedLibraryResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetRecentlyAddedLibraryResponse implements Response { return this; } + /** * The recently added content */ @@ -143,7 +145,6 @@ public class GetRecentlyAddedLibraryResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetRecentlyAddedLibraryResponse implements Response { } GetRecentlyAddedLibraryResponse other = (GetRecentlyAddedLibraryResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetRecentlyAddedLibraryResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetRecentlyAddedLibraryResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetRecentlyAddedLibraryResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetRecentlyAddedLibraryResponse implements Response { return this; } + /** * The recently added content */ @@ -236,13 +240,13 @@ public class GetRecentlyAddedLibraryResponse implements Response { this.object = object; return this; } - + public GetRecentlyAddedLibraryResponse build() { + return new GetRecentlyAddedLibraryResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryResponseBody.java index 8fcadd46..4b7c83bb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetRecentlyAddedLibraryResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryResponseBody withMediaContainer(GetRecentlyAddedLibraryMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetRecentlyAddedLibraryResponseBody { return this; } + public GetRecentlyAddedLibraryResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetRecentlyAddedLibraryResponseBody { } GetRecentlyAddedLibraryResponseBody other = (GetRecentlyAddedLibraryResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetRecentlyAddedLibraryResponseBody { return Utils.toString(GetRecentlyAddedLibraryResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetRecentlyAddedLibraryMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetRecentlyAddedLibraryResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetRecentlyAddedLibraryResponseBody build() { + return new GetRecentlyAddedLibraryResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRole.java index 5c5d0397..973bc516 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryRole.java @@ -11,9 +11,9 @@ 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 GetRecentlyAddedLibraryRole { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetRecentlyAddedLibraryRole { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryRole withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetRecentlyAddedLibraryRole { return this; } + public GetRecentlyAddedLibraryRole withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetRecentlyAddedLibraryRole { } GetRecentlyAddedLibraryRole other = (GetRecentlyAddedLibraryRole) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetRecentlyAddedLibraryRole { return Utils.toString(GetRecentlyAddedLibraryRole.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetRecentlyAddedLibraryRole { this.tag = tag; return this; } - + public GetRecentlyAddedLibraryRole build() { + return new GetRecentlyAddedLibraryRole( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryType.java index 05942c55..5a2ff0f9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryType.java @@ -14,35 +14,42 @@ 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 GetRecentlyAddedLibraryType { @JsonProperty("key") private String key; + @JsonProperty("type") private String type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtype") private Optional subtype; + @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; @@ -80,7 +87,9 @@ public class GetRecentlyAddedLibraryType { String type, String title, boolean active) { - this(key, type, Optional.empty(), title, active, Optional.empty(), Optional.empty(), Optional.empty()); + this(key, type, Optional.empty(), + title, active, Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -126,9 +135,10 @@ public class GetRecentlyAddedLibraryType { return (Optional>) field; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryType withKey(String key) { Utils.checkNotNull(key, "key"); @@ -148,6 +158,7 @@ public class GetRecentlyAddedLibraryType { return this; } + public GetRecentlyAddedLibraryType withSubtype(Optional subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = subtype; @@ -172,6 +183,7 @@ public class GetRecentlyAddedLibraryType { return this; } + public GetRecentlyAddedLibraryType withFilter(Optional> filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -184,6 +196,7 @@ public class GetRecentlyAddedLibraryType { return this; } + public GetRecentlyAddedLibraryType withSort(Optional> sort) { Utils.checkNotNull(sort, "sort"); this.sort = sort; @@ -196,13 +209,13 @@ public class GetRecentlyAddedLibraryType { return this; } + public GetRecentlyAddedLibraryType withField(Optional> field) { Utils.checkNotNull(field, "field"); this.field = field; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -213,27 +226,22 @@ public class GetRecentlyAddedLibraryType { } GetRecentlyAddedLibraryType other = (GetRecentlyAddedLibraryType) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.subtype, other.subtype) && - 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.field, other.field); } @Override public int hashCode() { - return Objects.hash( - key, - type, - subtype, - title, - active, - filter, - sort, - field); + return Utils.enhancedHash( + key, type, subtype, + title, active, filter, + sort, field); } @Override @@ -248,41 +256,45 @@ public class GetRecentlyAddedLibraryType { "sort", sort, "field", field); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String key; - + private String type; - + private Optional subtype = Optional.empty(); - + 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 subtype(String subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = Optional.ofNullable(subtype); @@ -295,18 +307,21 @@ public class GetRecentlyAddedLibraryType { 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); @@ -319,6 +334,7 @@ public class GetRecentlyAddedLibraryType { return this; } + public Builder sort(List sort) { Utils.checkNotNull(sort, "sort"); this.sort = Optional.ofNullable(sort); @@ -331,6 +347,7 @@ public class GetRecentlyAddedLibraryType { return this; } + public Builder field(List field) { Utils.checkNotNull(field, "field"); this.field = Optional.ofNullable(field); @@ -342,17 +359,14 @@ public class GetRecentlyAddedLibraryType { this.field = field; return this; } - + public GetRecentlyAddedLibraryType build() { + return new GetRecentlyAddedLibraryType( - key, - type, - subtype, - title, - active, - filter, - sort, - field); + key, type, subtype, + title, active, filter, + sort, field); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryWriter.java index 8bcf983c..186e8d26 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryWriter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedLibraryWriter.java @@ -11,9 +11,9 @@ 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 GetRecentlyAddedLibraryWriter { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetRecentlyAddedLibraryWriter { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedLibraryWriter withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetRecentlyAddedLibraryWriter { return this; } + public GetRecentlyAddedLibraryWriter withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetRecentlyAddedLibraryWriter { } GetRecentlyAddedLibraryWriter other = (GetRecentlyAddedLibraryWriter) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetRecentlyAddedLibraryWriter { return Utils.toString(GetRecentlyAddedLibraryWriter.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetRecentlyAddedLibraryWriter { this.tag = tag; return this; } - + public GetRecentlyAddedLibraryWriter build() { + return new GetRecentlyAddedLibraryWriter( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMediaContainer.java index ca37310b..95a2d0d7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMediaContainer.java @@ -16,11 +16,10 @@ 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 GetRecentlyAddedMediaContainer { +public class GetRecentlyAddedMediaContainer { /** * Number of media items returned in this response. */ @@ -96,7 +95,9 @@ public class GetRecentlyAddedMediaContainer { long offset, boolean allowSync, String identifier) { - this(size, totalSize, offset, allowSync, identifier, Optional.empty(), Optional.empty()); + this(size, totalSize, offset, + allowSync, identifier, Optional.empty(), + Optional.empty()); } /** @@ -157,9 +158,10 @@ public class GetRecentlyAddedMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -215,6 +217,7 @@ public class GetRecentlyAddedMediaContainer { return this; } + /** * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. */ @@ -233,6 +236,7 @@ public class GetRecentlyAddedMediaContainer { return this; } + /** * An array of metadata items. */ @@ -242,7 +246,6 @@ public class GetRecentlyAddedMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -253,24 +256,20 @@ public class GetRecentlyAddedMediaContainer { } GetRecentlyAddedMediaContainer other = (GetRecentlyAddedMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.totalSize, other.totalSize) && - Objects.deepEquals(this.offset, other.offset) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.meta, other.meta) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.totalSize, other.totalSize) && + Utils.enhancedDeepEquals(this.offset, other.offset) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.meta, other.meta) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - totalSize, - offset, - allowSync, - identifier, - meta, + return Utils.enhancedHash( + size, totalSize, offset, + allowSync, identifier, meta, metadata); } @@ -285,27 +284,29 @@ public class GetRecentlyAddedMediaContainer { "meta", meta, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Integer totalSize; - + private Long offset; - + private Boolean allowSync; - + private String identifier; - + private Optional meta = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -315,6 +316,7 @@ public class GetRecentlyAddedMediaContainer { return this; } + /** * Total number of media items in the library. */ @@ -324,6 +326,7 @@ public class GetRecentlyAddedMediaContainer { return this; } + /** * Offset value for pagination. */ @@ -333,6 +336,7 @@ public class GetRecentlyAddedMediaContainer { return this; } + /** * Indicates whether syncing is allowed. */ @@ -342,6 +346,7 @@ public class GetRecentlyAddedMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -351,6 +356,7 @@ public class GetRecentlyAddedMediaContainer { return this; } + /** * The Meta object is only included in the response if the `includeMeta` parameter is set to `1`. */ @@ -369,6 +375,7 @@ public class GetRecentlyAddedMediaContainer { return this; } + /** * An array of metadata items. */ @@ -386,16 +393,14 @@ public class GetRecentlyAddedMediaContainer { this.metadata = metadata; return this; } - + public GetRecentlyAddedMediaContainer build() { + return new GetRecentlyAddedMediaContainer( - size, - totalSize, - offset, - allowSync, - identifier, - meta, + size, totalSize, offset, + allowSync, identifier, meta, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java index debb9742..dc67c4b4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedMetadata.java @@ -18,7 +18,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -383,6 +382,7 @@ public class GetRecentlyAddedMetadata { @JsonProperty("title") private String title; + @JsonProperty("type") private GetRecentlyAddedHubsType type; @@ -428,58 +428,72 @@ public class GetRecentlyAddedMetadata { @JsonProperty("year") private Optional year; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Image") private Optional> image; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("UltraBlurColors") private Optional ultraBlurColors; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Guid") private Optional> guids; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Producer") private Optional> producer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Rating") private Optional> rating1; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Similar") private Optional> similar; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Location") private Optional> location; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Collection") private Optional> collection; @@ -735,7 +749,31 @@ public class GetRecentlyAddedMetadata { String titleSort, String title, GetRecentlyAddedHubsType type) { - this(addedAt, art, Optional.empty(), audienceRating, Optional.empty(), childCount, Optional.empty(), Optional.empty(), Optional.empty(), duration, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), guid, index, key, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), parentStudio, parentTheme, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), ratingKey, rating, seasonCount, Optional.empty(), slug, Optional.empty(), Optional.empty(), summary, tagline, theme, thumb, titleSort, title, type, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(addedAt, art, Optional.empty(), + audienceRating, Optional.empty(), childCount, + Optional.empty(), Optional.empty(), Optional.empty(), + duration, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + guid, index, key, + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), parentStudio, parentTheme, + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), ratingKey, + rating, seasonCount, Optional.empty(), + slug, Optional.empty(), Optional.empty(), + summary, tagline, theme, + thumb, titleSort, title, + type, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + 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 @@ -1304,9 +1342,10 @@ public class GetRecentlyAddedMetadata { return (Optional>) collection; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedMetadata withAddedAt(long addedAt) { Utils.checkNotNull(addedAt, "addedAt"); @@ -1332,6 +1371,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -1359,6 +1399,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -1386,6 +1427,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The content rating for the media item. */ @@ -1404,6 +1446,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -1422,6 +1465,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -1449,6 +1493,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -1467,6 +1512,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -1485,6 +1531,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -1503,6 +1550,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -1521,6 +1569,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -1539,6 +1588,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -1557,6 +1607,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -1575,6 +1626,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -1620,6 +1672,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -1638,6 +1691,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -1656,6 +1710,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -1674,6 +1729,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The identifier for the library section. */ @@ -1692,6 +1748,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The key corresponding to the library section. */ @@ -1710,6 +1767,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The title of the library section. */ @@ -1728,6 +1786,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -1746,6 +1805,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The original release date of the media item. */ @@ -1764,6 +1824,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -1782,6 +1843,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The index position of the parent media item. */ @@ -1800,6 +1862,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The key of the parent media item. */ @@ -1818,6 +1881,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -1836,6 +1900,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The slug for the parent media item. */ @@ -1872,6 +1937,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -1890,6 +1956,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The title of the parent media item. */ @@ -1908,6 +1975,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The release year of the parent media item. */ @@ -1926,6 +1994,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -1944,6 +2013,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The URL for the rating image. */ @@ -1989,6 +2059,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -2016,6 +2087,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The studio that produced the media item. */ @@ -2034,6 +2106,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -2112,6 +2185,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * Unix epoch datetime in seconds */ @@ -2130,6 +2204,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -2148,6 +2223,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -2166,6 +2242,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -2184,6 +2261,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -2202,6 +2280,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The release year of the media item. */ @@ -2217,6 +2296,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withImage(Optional> image) { Utils.checkNotNull(image, "image"); this.image = image; @@ -2229,6 +2309,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withUltraBlurColors(Optional ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = ultraBlurColors; @@ -2241,6 +2322,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withGuids(Optional> guids) { Utils.checkNotNull(guids, "guids"); this.guids = guids; @@ -2253,6 +2335,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -2265,6 +2348,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -2277,6 +2361,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -2289,6 +2374,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -2301,6 +2387,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -2313,6 +2400,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; @@ -2325,6 +2413,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withProducer(Optional> producer) { Utils.checkNotNull(producer, "producer"); this.producer = producer; @@ -2337,6 +2426,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withRating1(Optional> rating1) { Utils.checkNotNull(rating1, "rating1"); this.rating1 = rating1; @@ -2349,6 +2439,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withSimilar(Optional> similar) { Utils.checkNotNull(similar, "similar"); this.similar = similar; @@ -2361,6 +2452,7 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withLocation(Optional> location) { Utils.checkNotNull(location, "location"); this.location = location; @@ -2373,13 +2465,13 @@ public class GetRecentlyAddedMetadata { return this; } + public GetRecentlyAddedMetadata withCollection(Optional> collection) { Utils.checkNotNull(collection, "collection"); this.collection = collection; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -2390,161 +2482,111 @@ public class GetRecentlyAddedMetadata { } GetRecentlyAddedMetadata other = (GetRecentlyAddedMetadata) o; return - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.chapterSource, other.chapterSource) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && - Objects.deepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.grandparentArt, other.grandparentArt) && - Objects.deepEquals(this.grandparentGuid, other.grandparentGuid) && - Objects.deepEquals(this.grandparentKey, other.grandparentKey) && - Objects.deepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && - Objects.deepEquals(this.grandparentSlug, other.grandparentSlug) && - Objects.deepEquals(this.grandparentTheme, other.grandparentTheme) && - Objects.deepEquals(this.grandparentThumb, other.grandparentThumb) && - Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.lastRatedAt, other.lastRatedAt) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.originalTitle, other.originalTitle) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.parentGuid, other.parentGuid) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && - Objects.deepEquals(this.parentSlug, other.parentSlug) && - Objects.deepEquals(this.parentStudio, other.parentStudio) && - Objects.deepEquals(this.parentTheme, other.parentTheme) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.parentYear, other.parentYear) && - Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.seasonCount, other.seasonCount) && - Objects.deepEquals(this.skipCount, other.skipCount) && - Objects.deepEquals(this.slug, other.slug) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.subtype, other.subtype) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.theme, other.theme) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.titleSort, other.titleSort) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.userRating, other.userRating) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.viewOffset, other.viewOffset) && - Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) && - Objects.deepEquals(this.guids, other.guids) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.producer, other.producer) && - Objects.deepEquals(this.rating1, other.rating1) && - Objects.deepEquals(this.similar, other.similar) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.collection, other.collection); + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.chapterSource, other.chapterSource) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && + Utils.enhancedDeepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.grandparentArt, other.grandparentArt) && + Utils.enhancedDeepEquals(this.grandparentGuid, other.grandparentGuid) && + Utils.enhancedDeepEquals(this.grandparentKey, other.grandparentKey) && + Utils.enhancedDeepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && + Utils.enhancedDeepEquals(this.grandparentSlug, other.grandparentSlug) && + Utils.enhancedDeepEquals(this.grandparentTheme, other.grandparentTheme) && + Utils.enhancedDeepEquals(this.grandparentThumb, other.grandparentThumb) && + Utils.enhancedDeepEquals(this.grandparentTitle, other.grandparentTitle) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.lastRatedAt, other.lastRatedAt) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.originalTitle, other.originalTitle) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.parentGuid, other.parentGuid) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.parentRatingKey, other.parentRatingKey) && + Utils.enhancedDeepEquals(this.parentSlug, other.parentSlug) && + Utils.enhancedDeepEquals(this.parentStudio, other.parentStudio) && + Utils.enhancedDeepEquals(this.parentTheme, other.parentTheme) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.parentYear, other.parentYear) && + Utils.enhancedDeepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.seasonCount, other.seasonCount) && + Utils.enhancedDeepEquals(this.skipCount, other.skipCount) && + Utils.enhancedDeepEquals(this.slug, other.slug) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.theme, other.theme) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.titleSort, other.titleSort) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.userRating, other.userRating) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.viewOffset, other.viewOffset) && + Utils.enhancedDeepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.ultraBlurColors, other.ultraBlurColors) && + Utils.enhancedDeepEquals(this.guids, other.guids) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.producer, other.producer) && + Utils.enhancedDeepEquals(this.rating1, other.rating1) && + Utils.enhancedDeepEquals(this.similar, other.similar) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.collection, other.collection); } @Override public int hashCode() { - return Objects.hash( - addedAt, - art, - audienceRatingImage, - audienceRating, - chapterSource, - childCount, - contentRating, - createdAtAccuracy, - createdAtTZOffset, - duration, - grandparentArt, - grandparentGuid, - grandparentKey, - grandparentRatingKey, - grandparentSlug, - grandparentTheme, - grandparentThumb, - grandparentTitle, - guid, - index, - key, - lastRatedAt, - lastViewedAt, - leafCount, - librarySectionID, - librarySectionKey, - librarySectionTitle, - originalTitle, - originallyAvailableAt, - parentGuid, - parentIndex, - parentKey, - parentRatingKey, - parentSlug, - parentStudio, - parentTheme, - parentThumb, - parentTitle, - parentYear, - primaryExtraKey, - ratingImage, - ratingKey, - rating, - seasonCount, - skipCount, - slug, - studio, - subtype, - summary, - tagline, - theme, - thumb, - titleSort, - title, - type, - updatedAt, - userRating, - viewCount, - viewOffset, - viewedLeafCount, - year, - image, - ultraBlurColors, - guids, - media, - genre, - country, - director, - writer, - role, - producer, - rating1, - similar, - location, - collection); + return Utils.enhancedHash( + addedAt, art, audienceRatingImage, + audienceRating, chapterSource, childCount, + contentRating, createdAtAccuracy, createdAtTZOffset, + duration, grandparentArt, grandparentGuid, + grandparentKey, grandparentRatingKey, grandparentSlug, + grandparentTheme, grandparentThumb, grandparentTitle, + guid, index, key, + lastRatedAt, lastViewedAt, leafCount, + librarySectionID, librarySectionKey, librarySectionTitle, + originalTitle, originallyAvailableAt, parentGuid, + parentIndex, parentKey, parentRatingKey, + parentSlug, parentStudio, parentTheme, + parentThumb, parentTitle, parentYear, + primaryExtraKey, ratingImage, ratingKey, + rating, seasonCount, skipCount, + slug, studio, subtype, + summary, tagline, theme, + thumb, titleSort, title, + type, updatedAt, userRating, + viewCount, viewOffset, viewedLeafCount, + year, image, ultraBlurColors, + guids, media, genre, + country, director, writer, + role, producer, rating1, + similar, location, collection); } @Override @@ -2626,169 +2668,172 @@ public class GetRecentlyAddedMetadata { "location", location, "collection", collection); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long addedAt; - + private String art; - + private Optional audienceRatingImage = Optional.empty(); - + private Double audienceRating; - + private Optional chapterSource = Optional.empty(); - + private Integer childCount; - + private Optional contentRating = Optional.empty(); - + private Optional createdAtAccuracy = Optional.empty(); - + private Optional createdAtTZOffset = Optional.empty(); - + private Integer duration; - + private Optional grandparentArt = Optional.empty(); - + private Optional grandparentGuid = Optional.empty(); - + private Optional grandparentKey = Optional.empty(); - + private Optional grandparentRatingKey = Optional.empty(); - + private Optional grandparentSlug = Optional.empty(); - + private Optional grandparentTheme = Optional.empty(); - + private Optional grandparentThumb = Optional.empty(); - + private Optional grandparentTitle = Optional.empty(); - + private String guid; - + private Integer index; - + private String key; - + private Optional lastRatedAt = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionKey = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional originalTitle = Optional.empty(); - + private Optional originallyAvailableAt = Optional.empty(); - + private Optional parentGuid = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional parentRatingKey = Optional.empty(); - + private Optional parentSlug = Optional.empty(); - + private String parentStudio; - + private String parentTheme; - + private Optional parentThumb = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional parentYear = Optional.empty(); - + private Optional primaryExtraKey = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private String ratingKey; - + private Float rating; - + private Integer seasonCount; - + private Optional skipCount = Optional.empty(); - + private String slug; - + private Optional studio = Optional.empty(); - + private Optional subtype = Optional.empty(); - + private String summary; - + private String tagline; - + private String theme; - + private String thumb; - + private String titleSort; - + private String title; - + private GetRecentlyAddedHubsType type; - + private Optional updatedAt = Optional.empty(); - + private Optional userRating = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional viewOffset = Optional.empty(); - + private Optional viewedLeafCount = Optional.empty(); - + private Optional year = Optional.empty(); - + private Optional> image = Optional.empty(); - + private Optional ultraBlurColors = Optional.empty(); - + private Optional> guids = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Optional> producer = Optional.empty(); - + private Optional> rating1 = Optional.empty(); - + private Optional> similar = Optional.empty(); - + private Optional> location = Optional.empty(); - + private Optional> collection = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder addedAt(long addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; return this; } + /** * The art image URL for the media item. */ @@ -2798,6 +2843,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -2816,6 +2862,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The audience rating for the media item. */ @@ -2825,6 +2872,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -2843,6 +2891,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of child items associated with this media item. */ @@ -2852,6 +2901,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The content rating for the media item. */ @@ -2870,6 +2920,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -2888,6 +2939,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -2906,6 +2958,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The duration of the media item in milliseconds. */ @@ -2915,6 +2968,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -2933,6 +2987,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -2951,6 +3006,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -2969,6 +3025,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -2987,6 +3044,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -3005,6 +3063,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -3023,6 +3082,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -3041,6 +3101,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -3059,6 +3120,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The globally unique identifier for the media item. */ @@ -3068,6 +3130,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The index position of the media item. */ @@ -3077,6 +3140,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The unique key for the media item. */ @@ -3086,6 +3150,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -3104,6 +3169,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -3122,6 +3188,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -3140,6 +3207,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The identifier for the library section. */ @@ -3158,6 +3226,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The key corresponding to the library section. */ @@ -3176,6 +3245,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The title of the library section. */ @@ -3194,6 +3264,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -3212,6 +3283,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The original release date of the media item. */ @@ -3230,6 +3302,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -3248,6 +3321,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The index position of the parent media item. */ @@ -3266,6 +3340,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The key of the parent media item. */ @@ -3284,6 +3359,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -3302,6 +3378,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The slug for the parent media item. */ @@ -3320,6 +3397,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The studio of the parent media item. */ @@ -3329,6 +3407,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The theme URL for the parent media item. */ @@ -3338,6 +3417,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -3356,6 +3436,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The title of the parent media item. */ @@ -3374,6 +3455,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The release year of the parent media item. */ @@ -3392,6 +3474,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -3410,6 +3493,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The URL for the rating image. */ @@ -3428,6 +3512,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -3437,6 +3522,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The critic rating for the media item. */ @@ -3446,6 +3532,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The total number of seasons (for TV shows). */ @@ -3455,6 +3542,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -3473,6 +3561,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * A URL‐friendly version of the media title. */ @@ -3482,6 +3571,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The studio that produced the media item. */ @@ -3500,6 +3590,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -3518,6 +3609,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * A synopsis of the media item. */ @@ -3527,6 +3619,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * A brief tagline for the media item. */ @@ -3536,6 +3629,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The theme URL for the media item. */ @@ -3545,6 +3639,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The thumbnail image URL for the media item. */ @@ -3554,6 +3649,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The sort title used for ordering media items. */ @@ -3563,6 +3659,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The title of the media item. */ @@ -3572,12 +3669,14 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder type(GetRecentlyAddedHubsType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + /** * Unix epoch datetime in seconds */ @@ -3596,6 +3695,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -3614,6 +3714,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -3632,6 +3733,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -3650,6 +3752,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -3668,6 +3771,7 @@ public class GetRecentlyAddedMetadata { return this; } + /** * The release year of the media item. */ @@ -3686,6 +3790,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder image(List image) { Utils.checkNotNull(image, "image"); this.image = Optional.ofNullable(image); @@ -3698,6 +3803,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder ultraBlurColors(UltraBlurColors ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = Optional.ofNullable(ultraBlurColors); @@ -3710,6 +3816,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder guids(List guids) { Utils.checkNotNull(guids, "guids"); this.guids = Optional.ofNullable(guids); @@ -3722,6 +3829,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -3734,6 +3842,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -3746,6 +3855,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -3758,6 +3868,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -3770,6 +3881,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -3782,6 +3894,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -3794,6 +3907,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder producer(List producer) { Utils.checkNotNull(producer, "producer"); this.producer = Optional.ofNullable(producer); @@ -3806,6 +3920,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder rating1(List rating1) { Utils.checkNotNull(rating1, "rating1"); this.rating1 = Optional.ofNullable(rating1); @@ -3818,6 +3933,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder similar(List similar) { Utils.checkNotNull(similar, "similar"); this.similar = Optional.ofNullable(similar); @@ -3830,6 +3946,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder location(List location) { Utils.checkNotNull(location, "location"); this.location = Optional.ofNullable(location); @@ -3842,6 +3959,7 @@ public class GetRecentlyAddedMetadata { return this; } + public Builder collection(List collection) { Utils.checkNotNull(collection, "collection"); this.collection = Optional.ofNullable(collection); @@ -3853,84 +3971,36 @@ public class GetRecentlyAddedMetadata { this.collection = collection; return this; } - + public GetRecentlyAddedMetadata build() { + return new GetRecentlyAddedMetadata( - addedAt, - art, - audienceRatingImage, - audienceRating, - chapterSource, - childCount, - contentRating, - createdAtAccuracy, - createdAtTZOffset, - duration, - grandparentArt, - grandparentGuid, - grandparentKey, - grandparentRatingKey, - grandparentSlug, - grandparentTheme, - grandparentThumb, - grandparentTitle, - guid, - index, - key, - lastRatedAt, - lastViewedAt, - leafCount, - librarySectionID, - librarySectionKey, - librarySectionTitle, - originalTitle, - originallyAvailableAt, - parentGuid, - parentIndex, - parentKey, - parentRatingKey, - parentSlug, - parentStudio, - parentTheme, - parentThumb, - parentTitle, - parentYear, - primaryExtraKey, - ratingImage, - ratingKey, - rating, - seasonCount, - skipCount, - slug, - studio, - subtype, - summary, - tagline, - theme, - thumb, - titleSort, - title, - type, - updatedAt, - userRating, - viewCount, - viewOffset, - viewedLeafCount, - year, - image, - ultraBlurColors, - guids, - media, - genre, - country, - director, - writer, - role, - producer, - rating1, - similar, - location, - collection); + addedAt, art, audienceRatingImage, + audienceRating, chapterSource, childCount, + contentRating, createdAtAccuracy, createdAtTZOffset, + duration, grandparentArt, grandparentGuid, + grandparentKey, grandparentRatingKey, grandparentSlug, + grandparentTheme, grandparentThumb, grandparentTitle, + guid, index, key, + lastRatedAt, lastViewedAt, leafCount, + librarySectionID, librarySectionKey, librarySectionTitle, + originalTitle, originallyAvailableAt, parentGuid, + parentIndex, parentKey, parentRatingKey, + parentSlug, parentStudio, parentTheme, + parentThumb, parentTitle, parentYear, + primaryExtraKey, ratingImage, ratingKey, + rating, seasonCount, skipCount, + slug, studio, subtype, + summary, tagline, theme, + thumb, titleSort, title, + type, updatedAt, userRating, + viewCount, viewOffset, viewedLeafCount, + year, image, ultraBlurColors, + guids, media, genre, + country, director, writer, + role, producer, rating1, + similar, location, collection); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOperator.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOperator.java index 1019ff74..b4a868b1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOperator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOperator.java @@ -9,13 +9,14 @@ 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 GetRecentlyAddedOperator { @JsonProperty("key") private String key; + @JsonProperty("title") private String title; @@ -39,9 +40,10 @@ public class GetRecentlyAddedOperator { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedOperator withKey(String key) { Utils.checkNotNull(key, "key"); @@ -55,7 +57,6 @@ public class GetRecentlyAddedOperator { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,15 +67,14 @@ public class GetRecentlyAddedOperator { } GetRecentlyAddedOperator other = (GetRecentlyAddedOperator) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - key, - title); + return Utils.enhancedHash( + key, title); } @Override @@ -83,33 +83,37 @@ public class GetRecentlyAddedOperator { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") 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 GetRecentlyAddedOperator build() { + return new GetRecentlyAddedOperator( - key, - title); + key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOptimizedForStreaming.java index 70e00c28..8c633f07 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetRecentlyAddedOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetRecentlyAddedOptimizedForStreaming { return false; } GetRecentlyAddedOptimizedForStreaming other = (GetRecentlyAddedOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOptimizedForStreaming1.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOptimizedForStreaming1.java index f7e38767..a517ce5d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOptimizedForStreaming1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedOptimizedForStreaming1.java @@ -14,7 +14,7 @@ public enum GetRecentlyAddedOptimizedForStreaming1 { @JsonValue private final int value; - private GetRecentlyAddedOptimizedForStreaming1(int value) { + GetRecentlyAddedOptimizedForStreaming1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequest.java index 0e7baa50..b1c3137c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequest.java @@ -14,11 +14,10 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetRecentlyAddedRequest { +public class GetRecentlyAddedRequest { /** * The content directory ID. */ @@ -98,7 +97,9 @@ public class GetRecentlyAddedRequest { public GetRecentlyAddedRequest( long contentDirectoryID, Type type) { - this(contentDirectoryID, Optional.empty(), Optional.empty(), type, Optional.empty(), Optional.empty(), Optional.empty()); + this(contentDirectoryID, Optional.empty(), Optional.empty(), + type, Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -167,9 +168,10 @@ public class GetRecentlyAddedRequest { return xPlexContainerSize; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The content directory ID. @@ -189,6 +191,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * Comma-separated list of pinned content directory IDs. */ @@ -207,6 +210,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * The library section ID for filtering content. */ @@ -239,6 +243,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * Adds the Meta object to the response */ @@ -259,6 +264,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -281,6 +287,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -292,7 +299,6 @@ public class GetRecentlyAddedRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -303,24 +309,20 @@ public class GetRecentlyAddedRequest { } GetRecentlyAddedRequest other = (GetRecentlyAddedRequest) o; return - Objects.deepEquals(this.contentDirectoryID, other.contentDirectoryID) && - Objects.deepEquals(this.pinnedContentDirectoryID, other.pinnedContentDirectoryID) && - Objects.deepEquals(this.sectionID, other.sectionID) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.includeMeta, other.includeMeta) && - Objects.deepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && - Objects.deepEquals(this.xPlexContainerSize, other.xPlexContainerSize); + Utils.enhancedDeepEquals(this.contentDirectoryID, other.contentDirectoryID) && + Utils.enhancedDeepEquals(this.pinnedContentDirectoryID, other.pinnedContentDirectoryID) && + Utils.enhancedDeepEquals(this.sectionID, other.sectionID) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.includeMeta, other.includeMeta) && + Utils.enhancedDeepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && + Utils.enhancedDeepEquals(this.xPlexContainerSize, other.xPlexContainerSize); } @Override public int hashCode() { - return Objects.hash( - contentDirectoryID, - pinnedContentDirectoryID, - sectionID, - type, - includeMeta, - xPlexContainerStart, + return Utils.enhancedHash( + contentDirectoryID, pinnedContentDirectoryID, sectionID, + type, includeMeta, xPlexContainerStart, xPlexContainerSize); } @@ -335,27 +337,29 @@ public class GetRecentlyAddedRequest { "xPlexContainerStart", xPlexContainerStart, "xPlexContainerSize", xPlexContainerSize); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long contentDirectoryID; - + private Optional pinnedContentDirectoryID = Optional.empty(); - + private Optional sectionID = Optional.empty(); - + private Type type; - + private Optional includeMeta; - + private Optional xPlexContainerStart; - + private Optional xPlexContainerSize; - + private Builder() { // force use of static builder() method } + /** * The content directory ID. */ @@ -365,6 +369,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * Comma-separated list of pinned content directory IDs. */ @@ -383,6 +388,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * The library section ID for filtering content. */ @@ -401,6 +407,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * The type of media to retrieve or filter by. * 1 = movie @@ -415,6 +422,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * Adds the Meta object to the response */ @@ -433,6 +441,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -455,6 +464,7 @@ public class GetRecentlyAddedRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -476,7 +486,7 @@ public class GetRecentlyAddedRequest { this.xPlexContainerSize = xPlexContainerSize; return this; } - + public GetRecentlyAddedRequest build() { if (includeMeta == null) { includeMeta = _SINGLETON_VALUE_IncludeMeta.value(); @@ -487,16 +497,14 @@ public class GetRecentlyAddedRequest { if (xPlexContainerSize == null) { xPlexContainerSize = _SINGLETON_VALUE_XPlexContainerSize.value(); } + return new GetRecentlyAddedRequest( - contentDirectoryID, - pinnedContentDirectoryID, - sectionID, - type, - includeMeta, - xPlexContainerStart, + contentDirectoryID, pinnedContentDirectoryID, sectionID, + type, includeMeta, xPlexContainerStart, xPlexContainerSize); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeMeta = new LazySingletonValue<>( "includeMeta", 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 2597e1f5..f5683442 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetRecentlyAdded; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetRecentlyAddedRequestBuilder { private GetRecentlyAddedRequest request; - private final SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk; + private final SDKConfiguration sdkConfiguration; - public GetRecentlyAddedRequestBuilder(SDKMethodInterfaces.MethodCallGetRecentlyAdded sdk) { - this.sdk = sdk; + public GetRecentlyAddedRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetRecentlyAddedRequestBuilder request(GetRecentlyAddedRequest request) { @@ -22,8 +26,10 @@ public class GetRecentlyAddedRequestBuilder { } public GetRecentlyAddedResponse call() throws Exception { + + RequestOperation operation + = new GetRecentlyAdded.Sync(sdkConfiguration); - return sdk.getRecentlyAdded( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedResponse.java index 411d1d0b..9102cdd8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetRecentlyAddedResponse implements Response { +public class GetRecentlyAddedResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetRecentlyAddedResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetRecentlyAddedResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetRecentlyAddedResponse implements Response { return this; } + /** * A successful response with recently added content. */ @@ -143,7 +145,6 @@ public class GetRecentlyAddedResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetRecentlyAddedResponse implements Response { } GetRecentlyAddedResponse other = (GetRecentlyAddedResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetRecentlyAddedResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetRecentlyAddedResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetRecentlyAddedResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetRecentlyAddedResponse implements Response { return this; } + /** * A successful response with recently added content. */ @@ -236,13 +240,13 @@ public class GetRecentlyAddedResponse implements Response { this.object = object; return this; } - + public GetRecentlyAddedResponse build() { + return new GetRecentlyAddedResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedResponseBody.java index 0e173a71..d263fe87 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetRecentlyAddedResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedResponseBody withMediaContainer(GetRecentlyAddedMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetRecentlyAddedResponseBody { return this; } + public GetRecentlyAddedResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetRecentlyAddedResponseBody { } GetRecentlyAddedResponseBody other = (GetRecentlyAddedResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetRecentlyAddedResponseBody { return Utils.toString(GetRecentlyAddedResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetRecentlyAddedMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetRecentlyAddedResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetRecentlyAddedResponseBody build() { + return new GetRecentlyAddedResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedSort.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedSort.java index ddc281fa..a35f8511 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedSort.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedSort.java @@ -15,15 +15,16 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; + public class GetRecentlyAddedSort { @JsonInclude(Include.NON_ABSENT) @JsonProperty("default") private Optional default_; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("active") private Optional active; @@ -42,17 +43,21 @@ public class GetRecentlyAddedSort { @JsonProperty("defaultDirection") private Optional 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; @@ -87,7 +92,9 @@ public class GetRecentlyAddedSort { public GetRecentlyAddedSort( String key, String title) { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), key, title); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + key, title); } @JsonIgnore @@ -138,9 +145,10 @@ public class GetRecentlyAddedSort { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedSort withDefault(String default_) { Utils.checkNotNull(default_, "default_"); @@ -148,6 +156,7 @@ public class GetRecentlyAddedSort { return this; } + public GetRecentlyAddedSort withDefault(Optional default_) { Utils.checkNotNull(default_, "default_"); this.default_ = default_; @@ -160,6 +169,7 @@ public class GetRecentlyAddedSort { return this; } + public GetRecentlyAddedSort withActive(Optional active) { Utils.checkNotNull(active, "active"); this.active = active; @@ -175,6 +185,7 @@ public class GetRecentlyAddedSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -193,6 +204,7 @@ public class GetRecentlyAddedSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -208,6 +220,7 @@ public class GetRecentlyAddedSort { return this; } + public GetRecentlyAddedSort withDescKey(Optional descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = descKey; @@ -220,6 +233,7 @@ public class GetRecentlyAddedSort { return this; } + public GetRecentlyAddedSort withFirstCharacterKey(Optional firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = firstCharacterKey; @@ -238,7 +252,6 @@ public class GetRecentlyAddedSort { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -249,27 +262,22 @@ public class GetRecentlyAddedSort { } GetRecentlyAddedSort other = (GetRecentlyAddedSort) o; return - Objects.deepEquals(this.default_, other.default_) && - Objects.deepEquals(this.active, other.active) && - Objects.deepEquals(this.activeDirection, other.activeDirection) && - 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); + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.activeDirection, other.activeDirection) && + Utils.enhancedDeepEquals(this.defaultDirection, other.defaultDirection) && + Utils.enhancedDeepEquals(this.descKey, other.descKey) && + Utils.enhancedDeepEquals(this.firstCharacterKey, other.firstCharacterKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - default_, - active, - activeDirection, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + return Utils.enhancedHash( + default_, active, activeDirection, + defaultDirection, descKey, firstCharacterKey, + key, title); } @Override @@ -284,29 +292,31 @@ public class GetRecentlyAddedSort { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional default_ = Optional.empty(); - + private Optional active = Optional.empty(); - + private Optional activeDirection; - + private Optional 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_); @@ -319,6 +329,7 @@ public class GetRecentlyAddedSort { return this; } + public Builder active(boolean active) { Utils.checkNotNull(active, "active"); this.active = Optional.ofNullable(active); @@ -331,6 +342,7 @@ public class GetRecentlyAddedSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -349,6 +361,7 @@ public class GetRecentlyAddedSort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -367,6 +380,7 @@ public class GetRecentlyAddedSort { return this; } + public Builder descKey(String descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = Optional.ofNullable(descKey); @@ -379,6 +393,7 @@ public class GetRecentlyAddedSort { return this; } + public Builder firstCharacterKey(String firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = Optional.ofNullable(firstCharacterKey); @@ -391,18 +406,20 @@ public class GetRecentlyAddedSort { 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 GetRecentlyAddedSort build() { if (activeDirection == null) { activeDirection = _SINGLETON_VALUE_ActiveDirection.value(); @@ -410,17 +427,14 @@ public class GetRecentlyAddedSort { if (defaultDirection == null) { defaultDirection = _SINGLETON_VALUE_DefaultDirection.value(); } + return new GetRecentlyAddedSort( - default_, - active, - activeDirection, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + default_, active, activeDirection, + defaultDirection, descKey, firstCharacterKey, + key, title); } + private static final LazySingletonValue> _SINGLETON_VALUE_ActiveDirection = new LazySingletonValue<>( "activeDirection", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedType.java index b3996cc7..90a0a4f1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRecentlyAddedType.java @@ -14,35 +14,42 @@ 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 GetRecentlyAddedType { @JsonProperty("key") private String key; + @JsonProperty("type") private String type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtype") private Optional subtype; + @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; @@ -80,7 +87,9 @@ public class GetRecentlyAddedType { String type, String title, boolean active) { - this(key, type, Optional.empty(), title, active, Optional.empty(), Optional.empty(), Optional.empty()); + this(key, type, Optional.empty(), + title, active, Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -126,9 +135,10 @@ public class GetRecentlyAddedType { return (Optional>) field; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetRecentlyAddedType withKey(String key) { Utils.checkNotNull(key, "key"); @@ -148,6 +158,7 @@ public class GetRecentlyAddedType { return this; } + public GetRecentlyAddedType withSubtype(Optional subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = subtype; @@ -172,6 +183,7 @@ public class GetRecentlyAddedType { return this; } + public GetRecentlyAddedType withFilter(Optional> filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -184,6 +196,7 @@ public class GetRecentlyAddedType { return this; } + public GetRecentlyAddedType withSort(Optional> sort) { Utils.checkNotNull(sort, "sort"); this.sort = sort; @@ -196,13 +209,13 @@ public class GetRecentlyAddedType { return this; } + public GetRecentlyAddedType withField(Optional> field) { Utils.checkNotNull(field, "field"); this.field = field; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -213,27 +226,22 @@ public class GetRecentlyAddedType { } GetRecentlyAddedType other = (GetRecentlyAddedType) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.subtype, other.subtype) && - 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); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.field, other.field); } @Override public int hashCode() { - return Objects.hash( - key, - type, - subtype, - title, - active, - filter, - sort, - field); + return Utils.enhancedHash( + key, type, subtype, + title, active, filter, + sort, field); } @Override @@ -248,41 +256,45 @@ public class GetRecentlyAddedType { "sort", sort, "field", field); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String key; - + private String type; - + private Optional subtype = Optional.empty(); - + 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 subtype(String subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = Optional.ofNullable(subtype); @@ -295,18 +307,21 @@ public class GetRecentlyAddedType { 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); @@ -319,6 +334,7 @@ public class GetRecentlyAddedType { return this; } + public Builder sort(List sort) { Utils.checkNotNull(sort, "sort"); this.sort = Optional.ofNullable(sort); @@ -331,6 +347,7 @@ public class GetRecentlyAddedType { return this; } + public Builder field(List field) { Utils.checkNotNull(field, "field"); this.field = Optional.ofNullable(field); @@ -342,17 +359,14 @@ public class GetRecentlyAddedType { this.field = field; return this; } - + public GetRecentlyAddedType build() { + return new GetRecentlyAddedType( - key, - type, - subtype, - title, - active, - filter, - sort, - field); + key, type, subtype, + title, active, filter, + sort, field); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequest.java index 71618eb1..f60869af 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequest.java @@ -11,11 +11,10 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetRefreshLibraryMetadataRequest { +public class GetRefreshLibraryMetadataRequest { /** * Force the refresh even if the library is already being refreshed. */ @@ -62,9 +61,10 @@ public class GetRefreshLibraryMetadataRequest { return sectionKey; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Force the refresh even if the library is already being refreshed. @@ -75,6 +75,7 @@ public class GetRefreshLibraryMetadataRequest { return this; } + /** * Force the refresh even if the library is already being refreshed. */ @@ -94,7 +95,6 @@ public class GetRefreshLibraryMetadataRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -105,15 +105,14 @@ public class GetRefreshLibraryMetadataRequest { } GetRefreshLibraryMetadataRequest other = (GetRefreshLibraryMetadataRequest) o; return - Objects.deepEquals(this.force, other.force) && - Objects.deepEquals(this.sectionKey, other.sectionKey); + Utils.enhancedDeepEquals(this.force, other.force) && + Utils.enhancedDeepEquals(this.sectionKey, other.sectionKey); } @Override public int hashCode() { - return Objects.hash( - force, - sectionKey); + return Utils.enhancedHash( + force, sectionKey); } @Override @@ -122,17 +121,19 @@ public class GetRefreshLibraryMetadataRequest { "force", force, "sectionKey", sectionKey); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional force = Optional.empty(); - + private Integer sectionKey; - + private Builder() { // force use of static builder() method } + /** * Force the refresh even if the library is already being refreshed. */ @@ -151,6 +152,7 @@ public class GetRefreshLibraryMetadataRequest { return this; } + /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -160,11 +162,12 @@ public class GetRefreshLibraryMetadataRequest { this.sectionKey = sectionKey; return this; } - + public GetRefreshLibraryMetadataRequest build() { + return new GetRefreshLibraryMetadataRequest( - force, - sectionKey); + force, sectionKey); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java index 7673993a..7de9ae8d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetRefreshLibraryMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Integer; @@ -12,10 +16,10 @@ public class GetRefreshLibraryMetadataRequestBuilder { private Optional force = Optional.empty(); private Integer sectionKey; - private final SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk; + private final SDKConfiguration sdkConfiguration; - public GetRefreshLibraryMetadataRequestBuilder(SDKMethodInterfaces.MethodCallGetRefreshLibraryMetadata sdk) { - this.sdk = sdk; + public GetRefreshLibraryMetadataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetRefreshLibraryMetadataRequestBuilder force(Force force) { @@ -36,10 +40,21 @@ public class GetRefreshLibraryMetadataRequestBuilder { return this; } - public GetRefreshLibraryMetadataResponse call() throws Exception { - return sdk.getRefreshLibraryMetadata( - force, + private GetRefreshLibraryMetadataRequest buildRequest() { + + GetRefreshLibraryMetadataRequest request = new GetRefreshLibraryMetadataRequest(force, sectionKey); + + return request; + } + + public GetRefreshLibraryMetadataResponse call() throws Exception { + + RequestOperation operation + = new GetRefreshLibraryMetadata.Sync(sdkConfiguration); + GetRefreshLibraryMetadataRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataResponse.java index 2fa4f37f..311c1467 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetRefreshLibraryMetadataResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class GetRefreshLibraryMetadataResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class GetRefreshLibraryMetadataResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class GetRefreshLibraryMetadataResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class GetRefreshLibraryMetadataResponse implements Response { } GetRefreshLibraryMetadataResponse other = (GetRefreshLibraryMetadataResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class GetRefreshLibraryMetadataResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class GetRefreshLibraryMetadataResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class GetRefreshLibraryMetadataResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class GetRefreshLibraryMetadataResponse implements Response { this.rawResponse = rawResponse; return this; } - + public GetRefreshLibraryMetadataResponse build() { + return new GetRefreshLibraryMetadataResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequest.java index 88a7a4c0..ac428947 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequest.java @@ -13,10 +13,9 @@ import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetResizedPhotoRequest { - /** * The width for the resized photo */ @@ -140,9 +139,10 @@ public class GetResizedPhotoRequest { return url; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The width for the resized photo @@ -207,7 +207,6 @@ public class GetResizedPhotoRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -218,24 +217,20 @@ public class GetResizedPhotoRequest { } GetResizedPhotoRequest other = (GetResizedPhotoRequest) o; return - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.opacity, other.opacity) && - Objects.deepEquals(this.blur, other.blur) && - Objects.deepEquals(this.minSize, other.minSize) && - Objects.deepEquals(this.upscale, other.upscale) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.opacity, other.opacity) && + Utils.enhancedDeepEquals(this.blur, other.blur) && + Utils.enhancedDeepEquals(this.minSize, other.minSize) && + Utils.enhancedDeepEquals(this.upscale, other.upscale) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( - width, - height, - opacity, - blur, - minSize, - upscale, + return Utils.enhancedHash( + width, height, opacity, + blur, minSize, upscale, url); } @@ -250,27 +245,29 @@ public class GetResizedPhotoRequest { "upscale", upscale, "url", url); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double width; - + private Double height; - + private Long opacity; - + private Double blur; - + private MinSize minSize; - + private Upscale upscale; - + private String url; - + private Builder() { // force use of static builder() method } + /** * The width for the resized photo */ @@ -280,6 +277,7 @@ public class GetResizedPhotoRequest { return this; } + /** * The height for the resized photo */ @@ -289,6 +287,7 @@ public class GetResizedPhotoRequest { return this; } + /** * The opacity for the resized photo */ @@ -298,6 +297,7 @@ public class GetResizedPhotoRequest { return this; } + /** * The width for the resized photo */ @@ -307,6 +307,7 @@ public class GetResizedPhotoRequest { return this; } + /** * images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. */ @@ -316,6 +317,7 @@ public class GetResizedPhotoRequest { return this; } + /** * allow images to be resized beyond native dimensions. */ @@ -325,6 +327,7 @@ public class GetResizedPhotoRequest { return this; } + /** * path to image within Plex */ @@ -333,21 +336,19 @@ public class GetResizedPhotoRequest { this.url = url; return this; } - + public GetResizedPhotoRequest build() { if (opacity == null) { opacity = _SINGLETON_VALUE_Opacity.value(); } + return new GetResizedPhotoRequest( - width, - height, - opacity, - blur, - minSize, - upscale, + width, height, opacity, + blur, minSize, upscale, url); } + private static final LazySingletonValue _SINGLETON_VALUE_Opacity = new LazySingletonValue<>( "opacity", 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 0e46b97b..3fd430da 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetResizedPhoto; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetResizedPhotoRequestBuilder { private GetResizedPhotoRequest request; - private final SDKMethodInterfaces.MethodCallGetResizedPhoto sdk; + private final SDKConfiguration sdkConfiguration; - public GetResizedPhotoRequestBuilder(SDKMethodInterfaces.MethodCallGetResizedPhoto sdk) { - this.sdk = sdk; + public GetResizedPhotoRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetResizedPhotoRequestBuilder request(GetResizedPhotoRequest request) { @@ -22,8 +26,10 @@ public class GetResizedPhotoRequestBuilder { } public GetResizedPhotoResponse call() throws Exception { + + RequestOperation operation + = new GetResizedPhoto.Sync(sdkConfiguration); - return sdk.getResizedPhoto( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoResponse.java index 9ac709fd..62e2e41a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResizedPhotoResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class GetResizedPhotoResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class GetResizedPhotoResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class GetResizedPhotoResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class GetResizedPhotoResponse implements Response { } GetResizedPhotoResponse other = (GetResizedPhotoResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class GetResizedPhotoResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class GetResizedPhotoResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class GetResizedPhotoResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class GetResizedPhotoResponse implements Response { this.rawResponse = rawResponse; return this; } - + public GetResizedPhotoResponse build() { + return new GetResizedPhotoResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsMediaContainer.java index f3e64980..fc7a59a8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsMediaContainer.java @@ -14,15 +14,16 @@ 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 GetResourcesStatisticsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("StatisticsResources") private Optional> statisticsResources; @@ -52,9 +53,10 @@ public class GetResourcesStatisticsMediaContainer { return (Optional>) statisticsResources; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResourcesStatisticsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetResourcesStatisticsMediaContainer { return this; } + public GetResourcesStatisticsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetResourcesStatisticsMediaContainer { return this; } + public GetResourcesStatisticsMediaContainer withStatisticsResources(Optional> statisticsResources) { Utils.checkNotNull(statisticsResources, "statisticsResources"); this.statisticsResources = statisticsResources; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetResourcesStatisticsMediaContainer { } GetResourcesStatisticsMediaContainer other = (GetResourcesStatisticsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.statisticsResources, other.statisticsResources); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.statisticsResources, other.statisticsResources); } @Override public int hashCode() { - return Objects.hash( - size, - statisticsResources); + return Utils.enhancedHash( + size, statisticsResources); } @Override @@ -108,17 +110,19 @@ public class GetResourcesStatisticsMediaContainer { "size", size, "statisticsResources", statisticsResources); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> statisticsResources = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetResourcesStatisticsMediaContainer { return this; } + public Builder statisticsResources(List statisticsResources) { Utils.checkNotNull(statisticsResources, "statisticsResources"); this.statisticsResources = Optional.ofNullable(statisticsResources); @@ -142,11 +147,12 @@ public class GetResourcesStatisticsMediaContainer { this.statisticsResources = statisticsResources; return this; } - + public GetResourcesStatisticsMediaContainer build() { + return new GetResourcesStatisticsMediaContainer( - size, - statisticsResources); + size, statisticsResources); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequest.java index 316f880d..dcf43106 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetResourcesStatisticsRequest { +public class GetResourcesStatisticsRequest { /** * The timespan to retrieve statistics for * the exact meaning of this parameter is not known @@ -42,9 +41,10 @@ public class GetResourcesStatisticsRequest { return timespan; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The timespan to retrieve statistics for @@ -56,6 +56,7 @@ public class GetResourcesStatisticsRequest { return this; } + /** * The timespan to retrieve statistics for * the exact meaning of this parameter is not known @@ -66,7 +67,6 @@ public class GetResourcesStatisticsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,12 +77,12 @@ public class GetResourcesStatisticsRequest { } GetResourcesStatisticsRequest other = (GetResourcesStatisticsRequest) o; return - Objects.deepEquals(this.timespan, other.timespan); + Utils.enhancedDeepEquals(this.timespan, other.timespan); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timespan); } @@ -91,15 +91,17 @@ public class GetResourcesStatisticsRequest { return Utils.toString(GetResourcesStatisticsRequest.class, "timespan", timespan); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional timespan = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The timespan to retrieve statistics for * the exact meaning of this parameter is not known @@ -119,10 +121,12 @@ public class GetResourcesStatisticsRequest { this.timespan = timespan; return this; } - + public GetResourcesStatisticsRequest build() { + return new GetResourcesStatisticsRequest( timespan); } + } } 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 91381431..2c842975 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetResourcesStatistics; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -11,10 +15,10 @@ import java.util.Optional; public class GetResourcesStatisticsRequestBuilder { private Optional timespan = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk; + private final SDKConfiguration sdkConfiguration; - public GetResourcesStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetResourcesStatistics sdk) { - this.sdk = sdk; + public GetResourcesStatisticsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetResourcesStatisticsRequestBuilder timespan(long timespan) { @@ -29,9 +33,20 @@ public class GetResourcesStatisticsRequestBuilder { return this; } - public GetResourcesStatisticsResponse call() throws Exception { - return sdk.getResourcesStatistics( - timespan); + private GetResourcesStatisticsRequest buildRequest() { + + GetResourcesStatisticsRequest request = new GetResourcesStatisticsRequest(timespan); + + return request; + } + + public GetResourcesStatisticsResponse call() throws Exception { + + RequestOperation operation + = new GetResourcesStatistics.Sync(sdkConfiguration); + GetResourcesStatisticsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponse.java index 0b2d3954..ec8b33e4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetResourcesStatisticsResponse implements Response { +public class GetResourcesStatisticsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetResourcesStatisticsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetResourcesStatisticsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetResourcesStatisticsResponse implements Response { return this; } + /** * Resource Statistics */ @@ -143,7 +145,6 @@ public class GetResourcesStatisticsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetResourcesStatisticsResponse implements Response { } GetResourcesStatisticsResponse other = (GetResourcesStatisticsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetResourcesStatisticsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetResourcesStatisticsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetResourcesStatisticsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetResourcesStatisticsResponse implements Response { return this; } + /** * Resource Statistics */ @@ -236,13 +240,13 @@ public class GetResourcesStatisticsResponse implements Response { this.object = object; return this; } - + public GetResourcesStatisticsResponse build() { + return new GetResourcesStatisticsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponseBody.java index 5ba2a978..0d257b5c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetResourcesStatisticsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetResourcesStatisticsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetResourcesStatisticsResponseBody withMediaContainer(GetResourcesStatisticsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetResourcesStatisticsResponseBody { return this; } + public GetResourcesStatisticsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetResourcesStatisticsResponseBody { } GetResourcesStatisticsResponseBody other = (GetResourcesStatisticsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetResourcesStatisticsResponseBody { return Utils.toString(GetResourcesStatisticsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetResourcesStatisticsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetResourcesStatisticsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetResourcesStatisticsResponseBody build() { + return new GetResourcesStatisticsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCountry.java index 6a90567e..967772cf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesCountry.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetSearchAllLibrariesCountry { - /** * The unique identifier for the country. * NOTE: This is different for each Plex server and is not globally unique. @@ -54,9 +53,10 @@ public class GetSearchAllLibrariesCountry { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the country. @@ -77,7 +77,6 @@ public class GetSearchAllLibrariesCountry { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,15 +87,14 @@ public class GetSearchAllLibrariesCountry { } GetSearchAllLibrariesCountry other = (GetSearchAllLibrariesCountry) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - tag); + return Utils.enhancedHash( + id, tag); } @Override @@ -105,17 +103,19 @@ public class GetSearchAllLibrariesCountry { "id", id, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the country. * NOTE: This is different for each Plex server and is not globally unique. @@ -126,6 +126,7 @@ public class GetSearchAllLibrariesCountry { return this; } + /** * The country of origin of this media item */ @@ -134,11 +135,12 @@ public class GetSearchAllLibrariesCountry { this.tag = tag; return this; } - + public GetSearchAllLibrariesCountry build() { + return new GetSearchAllLibrariesCountry( - id, - tag); + id, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirector.java index da9732b4..73689cd1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirector.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirector.java @@ -12,11 +12,10 @@ 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 GetSearchAllLibrariesDirector { +public class GetSearchAllLibrariesDirector { /** * Unique identifier for the director. */ @@ -79,9 +78,10 @@ public class GetSearchAllLibrariesDirector { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the director. @@ -110,6 +110,7 @@ public class GetSearchAllLibrariesDirector { return this; } + /** * The absolute URL of the thumbnail image for the director. */ @@ -119,7 +120,6 @@ public class GetSearchAllLibrariesDirector { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -130,17 +130,15 @@ public class GetSearchAllLibrariesDirector { } GetSearchAllLibrariesDirector other = (GetSearchAllLibrariesDirector) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - thumb); + return Utils.enhancedHash( + id, tag, thumb); } @Override @@ -150,19 +148,21 @@ public class GetSearchAllLibrariesDirector { "tag", tag, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the director. */ @@ -172,6 +172,7 @@ public class GetSearchAllLibrariesDirector { return this; } + /** * The role of Director */ @@ -181,6 +182,7 @@ public class GetSearchAllLibrariesDirector { return this; } + /** * The absolute URL of the thumbnail image for the director. */ @@ -198,12 +200,12 @@ public class GetSearchAllLibrariesDirector { this.thumb = thumb; return this; } - + public GetSearchAllLibrariesDirector build() { + return new GetSearchAllLibrariesDirector( - id, - tag, - thumb); + id, tag, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirectory.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirectory.java index 1462a737..4af310a5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirectory.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesDirectory.java @@ -14,11 +14,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetSearchAllLibrariesDirectory { +public class GetSearchAllLibrariesDirectory { /** * The unique identifier path for the search result item. */ @@ -43,6 +42,7 @@ public class GetSearchAllLibrariesDirectory { @JsonProperty("librarySectionTitle") private String librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionType") private Optional librarySectionType; @@ -53,6 +53,7 @@ public class GetSearchAllLibrariesDirectory { @JsonProperty("type") private String type; + @JsonProperty("id") private long id; @@ -63,6 +64,7 @@ public class GetSearchAllLibrariesDirectory { @JsonProperty("filter") private Optional filter; + @JsonProperty("tag") private String tag; @@ -141,7 +143,10 @@ public class GetSearchAllLibrariesDirectory { String type, long id, String tag) { - this(key, librarySectionID, librarySectionKey, librarySectionTitle, type, id, Optional.empty(), tag, Optional.empty(), Optional.empty(), Optional.empty()); + this(key, librarySectionID, librarySectionKey, + librarySectionTitle, type, id, + Optional.empty(), tag, Optional.empty(), + Optional.empty(), Optional.empty()); } /** @@ -239,9 +244,10 @@ public class GetSearchAllLibrariesDirectory { return count; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier path for the search result item. @@ -303,6 +309,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The filter string used to query this specific item in the library. */ @@ -327,6 +334,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The unique identifier for the tag associated with this search result. */ @@ -345,6 +353,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The URL to the thumbnail image associated with this search result. */ @@ -363,6 +372,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The number of items associated with this search result. */ @@ -372,7 +382,6 @@ public class GetSearchAllLibrariesDirectory { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -383,36 +392,28 @@ public class GetSearchAllLibrariesDirectory { } GetSearchAllLibrariesDirectory other = (GetSearchAllLibrariesDirectory) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionType, other.librarySectionType) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.tagType, other.tagType) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.count, other.count); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionType, other.librarySectionType) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.tagType, other.tagType) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.count, other.count); } @Override public int hashCode() { - return Objects.hash( - key, - librarySectionID, - librarySectionKey, - librarySectionTitle, - librarySectionType, - type, - id, - filter, - tag, - tagType, - tagKey, - thumb, + return Utils.enhancedHash( + key, librarySectionID, librarySectionKey, + librarySectionTitle, librarySectionType, type, + id, filter, tag, + tagType, tagKey, thumb, count); } @@ -433,35 +434,37 @@ public class GetSearchAllLibrariesDirectory { "thumb", thumb, "count", count); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String key; - + private Long librarySectionID; - + private String librarySectionKey; - + private String librarySectionTitle; - + private String type; - + private Long id; - + private Optional filter = Optional.empty(); - + private String tag; - + private Optional tagKey = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional count = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The unique identifier path for the search result item. */ @@ -471,6 +474,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The identifier for the library section. */ @@ -480,6 +484,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The key corresponding to the library section. */ @@ -489,6 +494,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The title of the library section. */ @@ -498,6 +504,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The type of the directory. */ @@ -507,12 +514,14 @@ public class GetSearchAllLibrariesDirectory { return this; } + public Builder id(long id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + /** * The filter string used to query this specific item in the library. */ @@ -531,12 +540,14 @@ public class GetSearchAllLibrariesDirectory { return this; } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } + /** * The unique identifier for the tag associated with this search result. */ @@ -555,6 +566,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The URL to the thumbnail image associated with this search result. */ @@ -573,6 +585,7 @@ public class GetSearchAllLibrariesDirectory { return this; } + /** * The number of items associated with this search result. */ @@ -590,22 +603,17 @@ public class GetSearchAllLibrariesDirectory { this.count = count; return this; } - + public GetSearchAllLibrariesDirectory build() { + return new GetSearchAllLibrariesDirectory( - key, - librarySectionID, - librarySectionKey, - librarySectionTitle, - type, - id, - filter, - tag, - tagKey, - thumb, - count); + key, librarySectionID, librarySectionKey, + librarySectionTitle, type, id, + filter, tag, tagKey, + thumb, count); } + private static final LazySingletonValue> _SINGLETON_VALUE_LibrarySectionType = new LazySingletonValue<>( "librarySectionType", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGenre.java index 29558a52..8c0b97b4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGenre.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetSearchAllLibrariesGenre { - /** * The unique identifier for the genre. * NOTE: This is different for each Plex server and is not globally unique. @@ -54,9 +53,10 @@ public class GetSearchAllLibrariesGenre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the genre. @@ -77,7 +77,6 @@ public class GetSearchAllLibrariesGenre { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,15 +87,14 @@ public class GetSearchAllLibrariesGenre { } GetSearchAllLibrariesGenre other = (GetSearchAllLibrariesGenre) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - tag); + return Utils.enhancedHash( + id, tag); } @Override @@ -105,17 +103,19 @@ public class GetSearchAllLibrariesGenre { "id", id, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the genre. * NOTE: This is different for each Plex server and is not globally unique. @@ -126,6 +126,7 @@ public class GetSearchAllLibrariesGenre { return this; } + /** * The genre name of this media-item */ @@ -134,11 +135,12 @@ public class GetSearchAllLibrariesGenre { this.tag = tag; return this; } - + public GetSearchAllLibrariesGenre build() { + return new GetSearchAllLibrariesGenre( - id, - tag); + id, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGuids.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGuids.java index d192f7b1..acd65bd2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesGuids.java @@ -9,10 +9,9 @@ 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 GetSearchAllLibrariesGuids { - /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -34,9 +33,10 @@ public class GetSearchAllLibrariesGuids { return id; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// @@ -47,7 +47,6 @@ public class GetSearchAllLibrariesGuids { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetSearchAllLibrariesGuids { } GetSearchAllLibrariesGuids other = (GetSearchAllLibrariesGuids) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } @@ -72,15 +71,17 @@ public class GetSearchAllLibrariesGuids { return Utils.toString(GetSearchAllLibrariesGuids.class, "id", id); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String id; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -89,10 +90,12 @@ public class GetSearchAllLibrariesGuids { this.id = id; return this; } - + public GetSearchAllLibrariesGuids build() { + return new GetSearchAllLibrariesGuids( id); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java index e0563c2c..d98a7c8e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesHasThumbnail.java @@ -20,7 +20,7 @@ public enum GetSearchAllLibrariesHasThumbnail { @JsonValue private final String value; - private GetSearchAllLibrariesHasThumbnail(String value) { + GetSearchAllLibrariesHasThumbnail(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesImage.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesImage.java index a3f71db5..5fd0a814 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesImage.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesImage.java @@ -9,16 +9,18 @@ import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetSearchAllLibrariesImage { @JsonProperty("alt") private String alt; + @JsonProperty("type") private GetSearchAllLibrariesLibraryType type; + @JsonProperty("url") private String url; @@ -50,9 +52,10 @@ public class GetSearchAllLibrariesImage { return url; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchAllLibrariesImage withAlt(String alt) { Utils.checkNotNull(alt, "alt"); @@ -72,7 +75,6 @@ public class GetSearchAllLibrariesImage { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -83,17 +85,15 @@ public class GetSearchAllLibrariesImage { } GetSearchAllLibrariesImage other = (GetSearchAllLibrariesImage) o; return - Objects.deepEquals(this.alt, other.alt) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.alt, other.alt) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( - alt, - type, - url); + return Utils.enhancedHash( + alt, type, url); } @Override @@ -103,42 +103,46 @@ public class GetSearchAllLibrariesImage { "type", type, "url", url); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String alt; - + private GetSearchAllLibrariesLibraryType type; - + private String url; - + private Builder() { // force use of static builder() method } + public Builder alt(String alt) { Utils.checkNotNull(alt, "alt"); this.alt = alt; return this; } + public Builder type(GetSearchAllLibrariesLibraryType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder url(String url) { Utils.checkNotNull(url, "url"); this.url = url; return this; } - + public GetSearchAllLibrariesImage build() { + return new GetSearchAllLibrariesImage( - alt, - type, - url); + alt, type, url); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryOptimizedForStreaming.java index c3a4b513..c8221eb4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLibraryOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetSearchAllLibrariesLibraryOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetSearchAllLibrariesLibraryOptimizedForStreaming { return false; } GetSearchAllLibrariesLibraryOptimizedForStreaming other = (GetSearchAllLibrariesLibraryOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLocation.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLocation.java index f8f439e8..c4499abe 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLocation.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesLocation.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetSearchAllLibrariesLocation @@ -33,9 +32,10 @@ public class GetSearchAllLibrariesLocation { return path; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchAllLibrariesLocation withPath(String path) { Utils.checkNotNull(path, "path"); @@ -43,7 +43,6 @@ public class GetSearchAllLibrariesLocation { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -54,12 +53,12 @@ public class GetSearchAllLibrariesLocation { } GetSearchAllLibrariesLocation other = (GetSearchAllLibrariesLocation) o; return - Objects.deepEquals(this.path, other.path); + Utils.enhancedDeepEquals(this.path, other.path); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( path); } @@ -68,24 +67,28 @@ public class GetSearchAllLibrariesLocation { return Utils.toString(GetSearchAllLibrariesLocation.class, "path", path); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String path; - + private Builder() { // force use of static builder() method } + public Builder path(String path) { Utils.checkNotNull(path, "path"); this.path = path; return this; } - + public GetSearchAllLibrariesLocation build() { + return new GetSearchAllLibrariesLocation( path); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMedia.java index f68bf693..17e9645e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMedia.java @@ -17,11 +17,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; -public class GetSearchAllLibrariesMedia { +public class GetSearchAllLibrariesMedia { /** * Unique media identifier. */ @@ -70,6 +69,7 @@ public class GetSearchAllLibrariesMedia { @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("displayOffset") private Optional displayOffset; @@ -145,6 +145,7 @@ public class GetSearchAllLibrariesMedia { @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Part") private Optional> part; @@ -212,7 +213,13 @@ public class GetSearchAllLibrariesMedia { public GetSearchAllLibrariesMedia( long id) { - this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -364,9 +371,10 @@ public class GetSearchAllLibrariesMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique media identifier. @@ -386,6 +394,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Duration of the media in milliseconds. */ @@ -404,6 +413,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Bitrate in bits per second. */ @@ -422,6 +432,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video width in pixels. */ @@ -440,6 +451,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video height in pixels. */ @@ -458,6 +470,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Aspect ratio of the video. */ @@ -476,6 +489,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Number of audio channels. */ @@ -491,6 +505,7 @@ public class GetSearchAllLibrariesMedia { return this; } + public GetSearchAllLibrariesMedia withDisplayOffset(Optional displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = displayOffset; @@ -506,6 +521,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Audio codec used. */ @@ -524,6 +540,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video codec used. */ @@ -542,6 +559,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video resolution (e.g., 4k). */ @@ -560,6 +578,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Container format of the media. */ @@ -578,6 +597,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -596,6 +616,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video profile (e.g., main 10). */ @@ -614,6 +635,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Indicates whether voice activity is detected. */ @@ -632,6 +654,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -650,6 +673,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -669,6 +693,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Indicates whether the media has 64-bit offsets. * This is relevant for media files that may require larger offsets than what 32-bit integers can provide. @@ -685,13 +710,13 @@ public class GetSearchAllLibrariesMedia { return this; } + public GetSearchAllLibrariesMedia withPart(Optional> part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -702,48 +727,36 @@ public class GetSearchAllLibrariesMedia { } GetSearchAllLibrariesMedia other = (GetSearchAllLibrariesMedia) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.displayOffset, other.displayOffset) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.displayOffset, other.displayOffset) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } @@ -770,51 +783,53 @@ public class GetSearchAllLibrariesMedia { "has64bitOffsets", has64bitOffsets, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional displayOffset = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional hasVoiceActivity = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique media identifier. */ @@ -824,6 +839,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Duration of the media in milliseconds. */ @@ -842,6 +858,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Bitrate in bits per second. */ @@ -860,6 +877,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video width in pixels. */ @@ -878,6 +896,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video height in pixels. */ @@ -896,6 +915,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Aspect ratio of the video. */ @@ -914,6 +934,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Number of audio channels. */ @@ -932,6 +953,7 @@ public class GetSearchAllLibrariesMedia { return this; } + public Builder displayOffset(int displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = Optional.ofNullable(displayOffset); @@ -944,6 +966,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Audio codec used. */ @@ -962,6 +985,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video codec used. */ @@ -980,6 +1004,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video resolution (e.g., 4k). */ @@ -998,6 +1023,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Container format of the media. */ @@ -1016,6 +1042,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -1034,6 +1061,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Video profile (e.g., main 10). */ @@ -1052,6 +1080,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Indicates whether voice activity is detected. */ @@ -1070,6 +1099,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -1088,6 +1118,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -1106,6 +1137,7 @@ public class GetSearchAllLibrariesMedia { return this; } + /** * Indicates whether the media has 64-bit offsets. * This is relevant for media files that may require larger offsets than what 32-bit integers can provide. @@ -1126,6 +1158,7 @@ public class GetSearchAllLibrariesMedia { return this; } + public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = Optional.ofNullable(part); @@ -1137,28 +1170,18 @@ public class GetSearchAllLibrariesMedia { this.part = part; return this; } - + public GetSearchAllLibrariesMedia build() { + return new GetSearchAllLibrariesMedia( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaContainer.java index 63dd847a..d5938b4a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMediaContainer.java @@ -15,11 +15,10 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; import java.util.Optional; -public class GetSearchAllLibrariesMediaContainer { +public class GetSearchAllLibrariesMediaContainer { /** * Number of media items returned in this response. */ @@ -71,6 +70,7 @@ public class GetSearchAllLibrariesMediaContainer { @JsonProperty("mediaTagVersion") private long mediaTagVersion; + @JsonProperty("SearchResult") private List searchResult; @@ -112,7 +112,9 @@ public class GetSearchAllLibrariesMediaContainer { String mediaTagPrefix, long mediaTagVersion, List searchResult) { - this(size, allowSync, identifier, Optional.empty(), Optional.empty(), Optional.empty(), mediaTagPrefix, mediaTagVersion, searchResult); + this(size, allowSync, identifier, + Optional.empty(), Optional.empty(), Optional.empty(), + mediaTagPrefix, mediaTagVersion, searchResult); } /** @@ -184,9 +186,10 @@ public class GetSearchAllLibrariesMediaContainer { return searchResult; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -224,6 +227,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * The unique identifier for the library section. */ @@ -242,6 +246,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * The title of the library section. */ @@ -260,6 +265,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * The universally unique identifier for the library section. */ @@ -293,7 +299,6 @@ public class GetSearchAllLibrariesMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -304,29 +309,23 @@ public class GetSearchAllLibrariesMediaContainer { } GetSearchAllLibrariesMediaContainer other = (GetSearchAllLibrariesMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.searchResult, other.searchResult); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionUUID, other.librarySectionUUID) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.searchResult, other.searchResult); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - searchResult); + return Utils.enhancedHash( + size, allowSync, identifier, + librarySectionID, librarySectionTitle, librarySectionUUID, + mediaTagPrefix, mediaTagVersion, searchResult); } @Override @@ -342,31 +341,33 @@ public class GetSearchAllLibrariesMediaContainer { "mediaTagVersion", mediaTagVersion, "searchResult", searchResult); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Boolean allowSync; - + private String identifier; - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionUUID = Optional.empty(); - + private String mediaTagPrefix; - + private Long mediaTagVersion; - + private List searchResult; - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -376,6 +377,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * Indicates whether syncing is allowed. */ @@ -385,6 +387,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -394,6 +397,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * The unique identifier for the library section. */ @@ -412,6 +416,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * The title of the library section. */ @@ -430,6 +435,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * The universally unique identifier for the library section. */ @@ -448,6 +454,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * The prefix used for media tag resource paths. */ @@ -457,6 +464,7 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + /** * The version number for media tags. */ @@ -466,23 +474,20 @@ public class GetSearchAllLibrariesMediaContainer { return this; } + public Builder searchResult(List searchResult) { Utils.checkNotNull(searchResult, "searchResult"); this.searchResult = searchResult; return this; } - + public GetSearchAllLibrariesMediaContainer build() { + return new GetSearchAllLibrariesMediaContainer( - size, - allowSync, - identifier, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - mediaTagPrefix, - mediaTagVersion, - searchResult); + size, allowSync, identifier, + librarySectionID, librarySectionTitle, librarySectionUUID, + mediaTagPrefix, mediaTagVersion, searchResult); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java index 92323f6e..61d4a1d0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesMetadata.java @@ -19,7 +19,6 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -28,7 +27,6 @@ import java.util.Optional; *

Unknown */ public class GetSearchAllLibrariesMetadata { - /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -60,6 +58,7 @@ public class GetSearchAllLibrariesMetadata { @JsonProperty("studio") private Optional studio; + @JsonProperty("type") private GetSearchAllLibrariesType type; @@ -182,6 +181,7 @@ public class GetSearchAllLibrariesMetadata { @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonProperty("addedAt") private long addedAt; @@ -395,14 +395,17 @@ public class GetSearchAllLibrariesMetadata { @JsonProperty("userRating") private Optional userRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Image") private Optional> image; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("UltraBlurColors") private Optional ultraBlurColors; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Guid") private Optional> guids; @@ -455,30 +458,37 @@ public class GetSearchAllLibrariesMetadata { @JsonProperty("skipChildren") private Optional skipChildren; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Location") private Optional> location; @@ -724,7 +734,30 @@ public class GetSearchAllLibrariesMetadata { int seasonCount, int duration, long addedAt) { - this(ratingKey, key, guid, slug, Optional.empty(), type, title, banner, titleSort, Optional.empty(), summary, rating, audienceRating, Optional.empty(), tagline, thumb, art, theme, index, Optional.empty(), Optional.empty(), childCount, seasonCount, duration, Optional.empty(), addedAt, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(ratingKey, key, guid, + slug, Optional.empty(), type, + title, banner, titleSort, + Optional.empty(), summary, rating, + audienceRating, Optional.empty(), tagline, + thumb, art, theme, + index, Optional.empty(), Optional.empty(), + childCount, seasonCount, duration, + Optional.empty(), addedAt, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -1285,9 +1318,10 @@ public class GetSearchAllLibrariesMetadata { return (Optional>) location; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. @@ -1334,6 +1368,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The studio that produced the media item. */ @@ -1385,6 +1420,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The content rating for the media item. */ @@ -1430,6 +1466,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The release year of the media item. */ @@ -1493,6 +1530,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -1511,6 +1549,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -1556,6 +1595,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The original release date of the media item. */ @@ -1580,6 +1620,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Unix epoch datetime in seconds */ @@ -1598,6 +1639,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The release year of the parent media item. */ @@ -1616,6 +1658,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -1634,6 +1677,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -1652,6 +1696,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -1670,6 +1715,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -1688,6 +1734,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -1706,6 +1753,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -1724,6 +1772,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -1742,6 +1791,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -1760,6 +1810,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -1778,6 +1829,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -1796,6 +1848,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The key of the parent media item. */ @@ -1814,6 +1867,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -1832,6 +1886,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -1850,6 +1905,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -1868,6 +1924,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -1886,6 +1943,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The title of the parent media item. */ @@ -1904,6 +1962,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The index position of the parent media item. */ @@ -1922,6 +1981,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -1940,6 +2000,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The URL for the rating image. */ @@ -1958,6 +2019,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -1976,6 +2038,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -1994,6 +2057,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -2012,6 +2076,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -2030,6 +2095,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -2048,6 +2114,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -2066,6 +2133,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -2084,6 +2152,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -2102,6 +2171,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -2117,6 +2187,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withImage(Optional> image) { Utils.checkNotNull(image, "image"); this.image = image; @@ -2129,6 +2200,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withUltraBlurColors(Optional ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = ultraBlurColors; @@ -2141,6 +2213,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withGuids(Optional> guids) { Utils.checkNotNull(guids, "guids"); this.guids = guids; @@ -2156,6 +2229,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The identifier for the library section. */ @@ -2174,6 +2248,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The title of the library section. */ @@ -2192,6 +2267,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The key corresponding to the library section. */ @@ -2216,6 +2292,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Setting that indicates the episode ordering for the show. * Options: @@ -2240,6 +2317,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). */ @@ -2258,6 +2336,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Indicates whether child items should be skipped. */ @@ -2273,6 +2352,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -2285,6 +2365,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -2297,6 +2378,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -2309,6 +2391,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -2321,6 +2404,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -2333,6 +2417,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; @@ -2345,13 +2430,13 @@ public class GetSearchAllLibrariesMetadata { return this; } + public GetSearchAllLibrariesMetadata withLocation(Optional> location) { Utils.checkNotNull(location, "location"); this.location = location; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -2362,155 +2447,107 @@ public class GetSearchAllLibrariesMetadata { } GetSearchAllLibrariesMetadata other = (GetSearchAllLibrariesMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.slug, other.slug) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.banner, other.banner) && - Objects.deepEquals(this.titleSort, other.titleSort) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.theme, other.theme) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.seasonCount, other.seasonCount) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.parentYear, other.parentYear) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.chapterSource, other.chapterSource) && - Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && - Objects.deepEquals(this.originalTitle, other.originalTitle) && - Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && - Objects.deepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && - Objects.deepEquals(this.parentGuid, other.parentGuid) && - Objects.deepEquals(this.grandparentGuid, other.grandparentGuid) && - Objects.deepEquals(this.grandparentSlug, other.grandparentSlug) && - Objects.deepEquals(this.grandparentKey, other.grandparentKey) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && - Objects.deepEquals(this.grandparentThumb, other.grandparentThumb) && - Objects.deepEquals(this.grandparentTheme, other.grandparentTheme) && - Objects.deepEquals(this.grandparentArt, other.grandparentArt) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.viewCount, other.viewCount) && - Objects.deepEquals(this.viewOffset, other.viewOffset) && - Objects.deepEquals(this.skipCount, other.skipCount) && - Objects.deepEquals(this.subtype, other.subtype) && - Objects.deepEquals(this.lastRatedAt, other.lastRatedAt) && - Objects.deepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && - Objects.deepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && - Objects.deepEquals(this.lastViewedAt, other.lastViewedAt) && - Objects.deepEquals(this.userRating, other.userRating) && - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.ultraBlurColors, other.ultraBlurColors) && - Objects.deepEquals(this.guids, other.guids) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.showOrdering, other.showOrdering) && - Objects.deepEquals(this.flattenSeasons, other.flattenSeasons) && - Objects.deepEquals(this.skipChildren, other.skipChildren) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.location, other.location); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.slug, other.slug) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.banner, other.banner) && + Utils.enhancedDeepEquals(this.titleSort, other.titleSort) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.theme, other.theme) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.seasonCount, other.seasonCount) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.parentYear, other.parentYear) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.chapterSource, other.chapterSource) && + Utils.enhancedDeepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Utils.enhancedDeepEquals(this.originalTitle, other.originalTitle) && + Utils.enhancedDeepEquals(this.parentRatingKey, other.parentRatingKey) && + Utils.enhancedDeepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && + Utils.enhancedDeepEquals(this.parentGuid, other.parentGuid) && + Utils.enhancedDeepEquals(this.grandparentGuid, other.grandparentGuid) && + Utils.enhancedDeepEquals(this.grandparentSlug, other.grandparentSlug) && + Utils.enhancedDeepEquals(this.grandparentKey, other.grandparentKey) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.grandparentTitle, other.grandparentTitle) && + Utils.enhancedDeepEquals(this.grandparentThumb, other.grandparentThumb) && + Utils.enhancedDeepEquals(this.grandparentTheme, other.grandparentTheme) && + Utils.enhancedDeepEquals(this.grandparentArt, other.grandparentArt) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.viewCount, other.viewCount) && + Utils.enhancedDeepEquals(this.viewOffset, other.viewOffset) && + Utils.enhancedDeepEquals(this.skipCount, other.skipCount) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.lastRatedAt, other.lastRatedAt) && + Utils.enhancedDeepEquals(this.createdAtAccuracy, other.createdAtAccuracy) && + Utils.enhancedDeepEquals(this.createdAtTZOffset, other.createdAtTZOffset) && + Utils.enhancedDeepEquals(this.lastViewedAt, other.lastViewedAt) && + Utils.enhancedDeepEquals(this.userRating, other.userRating) && + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.ultraBlurColors, other.ultraBlurColors) && + Utils.enhancedDeepEquals(this.guids, other.guids) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.showOrdering, other.showOrdering) && + Utils.enhancedDeepEquals(this.flattenSeasons, other.flattenSeasons) && + Utils.enhancedDeepEquals(this.skipChildren, other.skipChildren) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.location, other.location); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - banner, - titleSort, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - theme, - index, - leafCount, - viewedLeafCount, - childCount, - seasonCount, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - parentYear, - audienceRatingImage, - chapterSource, - primaryExtraKey, - originalTitle, - parentRatingKey, - grandparentRatingKey, - parentGuid, - grandparentGuid, - grandparentSlug, - grandparentKey, - parentKey, - grandparentTitle, - grandparentThumb, - grandparentTheme, - grandparentArt, - parentTitle, - parentIndex, - parentThumb, - ratingImage, - viewCount, - viewOffset, - skipCount, - subtype, - lastRatedAt, - createdAtAccuracy, - createdAtTZOffset, - lastViewedAt, - userRating, - image, - ultraBlurColors, - guids, - librarySectionID, - librarySectionTitle, - librarySectionKey, - showOrdering, - flattenSeasons, - skipChildren, - media, - genre, - country, - director, - writer, - role, - location); + return Utils.enhancedHash( + ratingKey, key, guid, + slug, studio, type, + title, banner, titleSort, + contentRating, summary, rating, + audienceRating, year, tagline, + thumb, art, theme, + index, leafCount, viewedLeafCount, + childCount, seasonCount, duration, + originallyAvailableAt, addedAt, updatedAt, + parentYear, audienceRatingImage, chapterSource, + primaryExtraKey, originalTitle, parentRatingKey, + grandparentRatingKey, parentGuid, grandparentGuid, + grandparentSlug, grandparentKey, parentKey, + grandparentTitle, grandparentThumb, grandparentTheme, + grandparentArt, parentTitle, parentIndex, + parentThumb, ratingImage, viewCount, + viewOffset, skipCount, subtype, + lastRatedAt, createdAtAccuracy, createdAtTZOffset, + lastViewedAt, userRating, image, + ultraBlurColors, guids, librarySectionID, + librarySectionTitle, librarySectionKey, showOrdering, + flattenSeasons, skipChildren, media, + genre, country, director, + writer, role, location); } @Override @@ -2589,157 +2626,159 @@ public class GetSearchAllLibrariesMetadata { "role", role, "location", location); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String ratingKey; - + private String key; - + private String guid; - + private String slug; - + private Optional studio = Optional.empty(); - + private GetSearchAllLibrariesType type; - + private String title; - + private String banner; - + private String titleSort; - + private Optional contentRating = Optional.empty(); - + private String summary; - + private Float rating; - + private Double audienceRating; - + private Optional year = Optional.empty(); - + private String tagline; - + private String thumb; - + private String art; - + private String theme; - + private Integer index; - + private Optional leafCount = Optional.empty(); - + private Optional viewedLeafCount = Optional.empty(); - + private Integer childCount; - + private Integer seasonCount; - + private Integer duration; - + private Optional originallyAvailableAt = Optional.empty(); - + private Long addedAt; - + private Optional updatedAt = Optional.empty(); - + private Optional parentYear = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional chapterSource = Optional.empty(); - + private Optional primaryExtraKey = Optional.empty(); - + private Optional originalTitle = Optional.empty(); - + private Optional parentRatingKey = Optional.empty(); - + private Optional grandparentRatingKey = Optional.empty(); - + private Optional parentGuid = Optional.empty(); - + private Optional grandparentGuid = Optional.empty(); - + private Optional grandparentSlug = Optional.empty(); - + private Optional grandparentKey = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional grandparentTitle = Optional.empty(); - + private Optional grandparentThumb = Optional.empty(); - + private Optional grandparentTheme = Optional.empty(); - + private Optional grandparentArt = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional parentThumb = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional viewCount = Optional.empty(); - + private Optional viewOffset = Optional.empty(); - + private Optional skipCount = Optional.empty(); - + private Optional subtype = Optional.empty(); - + private Optional lastRatedAt = Optional.empty(); - + private Optional createdAtAccuracy = Optional.empty(); - + private Optional createdAtTZOffset = Optional.empty(); - + private Optional lastViewedAt = Optional.empty(); - + private Optional userRating = Optional.empty(); - + private Optional> image = Optional.empty(); - + private Optional ultraBlurColors = Optional.empty(); - + private Optional> guids = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionKey = Optional.empty(); - + private Optional showOrdering = Optional.empty(); - + private Optional flattenSeasons = Optional.empty(); - + private Optional skipChildren = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Optional> location = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The rating key (Media ID) of this media item. Note: Although this is always an integer, it is represented as a string in the API. */ @@ -2749,6 +2788,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The unique key for the media item. */ @@ -2758,6 +2798,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The globally unique identifier for the media item. */ @@ -2767,6 +2808,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * A URL‐friendly version of the media title. */ @@ -2776,6 +2818,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The studio that produced the media item. */ @@ -2794,12 +2837,14 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder type(GetSearchAllLibrariesType type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + /** * The title of the media item. */ @@ -2809,6 +2854,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The banner image URL for the media item. */ @@ -2818,6 +2864,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The sort title used for ordering media items. */ @@ -2827,6 +2874,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The content rating for the media item. */ @@ -2845,6 +2893,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * A synopsis of the media item. */ @@ -2854,6 +2903,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The critic rating for the media item. */ @@ -2863,6 +2913,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The audience rating for the media item. */ @@ -2872,6 +2923,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The release year of the media item. */ @@ -2890,6 +2942,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * A brief tagline for the media item. */ @@ -2899,6 +2952,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The thumbnail image URL for the media item. */ @@ -2908,6 +2962,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The art image URL for the media item. */ @@ -2917,6 +2972,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The theme URL for the media item. */ @@ -2926,6 +2982,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The index position of the media item. */ @@ -2935,6 +2992,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of leaf items (end nodes) under this media item. */ @@ -2953,6 +3011,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of leaf items that have been viewed. */ @@ -2971,6 +3030,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of child items associated with this media item. */ @@ -2980,6 +3040,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The total number of seasons (for TV shows). */ @@ -2989,6 +3050,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The duration of the media item in milliseconds. */ @@ -2998,6 +3060,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The original release date of the media item. */ @@ -3016,12 +3079,14 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder addedAt(long addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; return this; } + /** * Unix epoch datetime in seconds */ @@ -3040,6 +3105,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The release year of the parent media item. */ @@ -3058,6 +3124,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The URL for the audience rating image. */ @@ -3076,6 +3143,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The source from which chapter data is derived. */ @@ -3094,6 +3162,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The primary extra key associated with this media item. */ @@ -3112,6 +3181,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The original title of the media item (if different). */ @@ -3130,6 +3200,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The rating key of the parent media item. */ @@ -3148,6 +3219,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The rating key of the grandparent media item. */ @@ -3166,6 +3238,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The GUID of the parent media item. */ @@ -3184,6 +3257,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The GUID of the grandparent media item. */ @@ -3202,6 +3276,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The slug for the grandparent media item. */ @@ -3220,6 +3295,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The key of the grandparent media item. */ @@ -3238,6 +3314,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The key of the parent media item. */ @@ -3256,6 +3333,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The title of the grandparent media item. */ @@ -3274,6 +3352,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The thumbnail URL for the grandparent media item. */ @@ -3292,6 +3371,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The theme URL for the grandparent media item. */ @@ -3310,6 +3390,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The art URL for the grandparent media item. */ @@ -3328,6 +3409,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The title of the parent media item. */ @@ -3346,6 +3428,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The index position of the parent media item. */ @@ -3364,6 +3447,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The thumbnail URL for the parent media item. */ @@ -3382,6 +3466,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The URL for the rating image. */ @@ -3400,6 +3485,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of times this media item has been viewed. */ @@ -3418,6 +3504,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The current playback offset (in milliseconds). */ @@ -3436,6 +3523,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The number of times this media item has been skipped. */ @@ -3454,6 +3542,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * A classification that further describes the type of media item. For example, 'clip' indicates that the item is a short video clip. */ @@ -3472,6 +3561,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The Unix timestamp representing the last time the item was rated. */ @@ -3490,6 +3580,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The accuracy of the creation timestamp. This value indicates the format(s) provided (for example, 'epoch,local' means both epoch and local time formats are available). */ @@ -3508,6 +3599,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The time zone offset for the creation timestamp, represented as a string. This offset indicates the difference from UTC. */ @@ -3526,6 +3618,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Unix timestamp for when the media item was last viewed. */ @@ -3544,6 +3637,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The rating provided by a user for the item. This value is expressed as a decimal number. */ @@ -3562,6 +3656,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder image(List image) { Utils.checkNotNull(image, "image"); this.image = Optional.ofNullable(image); @@ -3574,6 +3669,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder ultraBlurColors(GetSearchAllLibrariesUltraBlurColors ultraBlurColors) { Utils.checkNotNull(ultraBlurColors, "ultraBlurColors"); this.ultraBlurColors = Optional.ofNullable(ultraBlurColors); @@ -3586,6 +3682,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder guids(List guids) { Utils.checkNotNull(guids, "guids"); this.guids = Optional.ofNullable(guids); @@ -3598,6 +3695,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The identifier for the library section. */ @@ -3616,6 +3714,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The title of the library section. */ @@ -3634,6 +3733,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * The key corresponding to the library section. */ @@ -3652,6 +3752,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Setting that indicates the episode ordering for the show. * Options: @@ -3682,6 +3783,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show). */ @@ -3700,6 +3802,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + /** * Indicates whether child items should be skipped. */ @@ -3718,6 +3821,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -3730,6 +3834,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -3742,6 +3847,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -3754,6 +3860,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -3766,6 +3873,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -3778,6 +3886,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -3790,6 +3899,7 @@ public class GetSearchAllLibrariesMetadata { return this; } + public Builder location(List location) { Utils.checkNotNull(location, "location"); this.location = Optional.ofNullable(location); @@ -3801,81 +3911,35 @@ public class GetSearchAllLibrariesMetadata { this.location = location; return this; } - + public GetSearchAllLibrariesMetadata build() { + return new GetSearchAllLibrariesMetadata( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - banner, - titleSort, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - theme, - index, - leafCount, - viewedLeafCount, - childCount, - seasonCount, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - parentYear, - audienceRatingImage, - chapterSource, - primaryExtraKey, - originalTitle, - parentRatingKey, - grandparentRatingKey, - parentGuid, - grandparentGuid, - grandparentSlug, - grandparentKey, - parentKey, - grandparentTitle, - grandparentThumb, - grandparentTheme, - grandparentArt, - parentTitle, - parentIndex, - parentThumb, - ratingImage, - viewCount, - viewOffset, - skipCount, - subtype, - lastRatedAt, - createdAtAccuracy, - createdAtTZOffset, - lastViewedAt, - userRating, - image, - ultraBlurColors, - guids, - librarySectionID, - librarySectionTitle, - librarySectionKey, - showOrdering, - flattenSeasons, - skipChildren, - media, - genre, - country, - director, - writer, - role, - location); + ratingKey, key, guid, + slug, studio, type, + title, banner, titleSort, + contentRating, summary, rating, + audienceRating, year, tagline, + thumb, art, theme, + index, leafCount, viewedLeafCount, + childCount, seasonCount, duration, + originallyAvailableAt, addedAt, updatedAt, + parentYear, audienceRatingImage, chapterSource, + primaryExtraKey, originalTitle, parentRatingKey, + grandparentRatingKey, parentGuid, grandparentGuid, + grandparentSlug, grandparentKey, parentKey, + grandparentTitle, grandparentThumb, grandparentTheme, + grandparentArt, parentTitle, parentIndex, + parentThumb, ratingImage, viewCount, + viewOffset, skipCount, subtype, + lastRatedAt, createdAtAccuracy, createdAtTZOffset, + lastViewedAt, userRating, image, + ultraBlurColors, guids, librarySectionID, + librarySectionTitle, librarySectionKey, showOrdering, + flattenSeasons, skipChildren, media, + genre, country, director, + writer, role, location); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java index 78763824..deb5e292 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * GetSearchAllLibrariesOptimizedForStreaming @@ -73,12 +72,12 @@ public class GetSearchAllLibrariesOptimizedForStreaming { return false; } GetSearchAllLibrariesOptimizedForStreaming other = (GetSearchAllLibrariesOptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming1.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming1.java index dd15db18..ac7abd85 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreaming1.java @@ -14,7 +14,7 @@ public enum GetSearchAllLibrariesOptimizedForStreaming1 { @JsonValue private final int value; - private GetSearchAllLibrariesOptimizedForStreaming1(int value) { + GetSearchAllLibrariesOptimizedForStreaming1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreamingLibrary1.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreamingLibrary1.java index 266a6ccf..0226e04f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreamingLibrary1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesOptimizedForStreamingLibrary1.java @@ -14,7 +14,7 @@ public enum GetSearchAllLibrariesOptimizedForStreamingLibrary1 { @JsonValue private final int value; - private GetSearchAllLibrariesOptimizedForStreamingLibrary1(int value) { + GetSearchAllLibrariesOptimizedForStreamingLibrary1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesPart.java index 0198962e..209dd182 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesPart.java @@ -17,11 +17,10 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetSearchAllLibrariesPart { +public class GetSearchAllLibrariesPart { /** * Indicates if the part is accessible. */ @@ -49,6 +48,7 @@ public class GetSearchAllLibrariesPart { @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("indexes") private Optional indexes; @@ -74,6 +74,7 @@ public class GetSearchAllLibrariesPart { @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("packetLength") private Optional packetLength; @@ -99,6 +100,7 @@ public class GetSearchAllLibrariesPart { @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; @@ -110,6 +112,7 @@ public class GetSearchAllLibrariesPart { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasThumbnail") private Optional hasThumbnail; @@ -165,7 +168,11 @@ public class GetSearchAllLibrariesPart { public GetSearchAllLibrariesPart( long id) { - this(Optional.empty(), Optional.empty(), id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), id, + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -278,9 +285,10 @@ public class GetSearchAllLibrariesPart { return (Optional) hasThumbnail; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Indicates if the part is accessible. @@ -291,6 +299,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Indicates if the part is accessible. */ @@ -309,6 +318,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Indicates if the part exists. */ @@ -336,6 +346,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Key to access this part. */ @@ -351,6 +362,7 @@ public class GetSearchAllLibrariesPart { return this; } + public GetSearchAllLibrariesPart withIndexes(Optional indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = indexes; @@ -366,6 +378,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Duration of the part in milliseconds. */ @@ -384,6 +397,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * File path for the part. */ @@ -402,6 +416,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * File size in bytes. */ @@ -417,6 +432,7 @@ public class GetSearchAllLibrariesPart { return this; } + public GetSearchAllLibrariesPart withPacketLength(Optional packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = packetLength; @@ -432,6 +448,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Container format of the part. */ @@ -450,6 +467,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Video profile for the part. */ @@ -468,6 +486,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -483,6 +502,7 @@ public class GetSearchAllLibrariesPart { return this; } + public GetSearchAllLibrariesPart withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -498,6 +518,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -513,13 +534,13 @@ public class GetSearchAllLibrariesPart { return this; } + public GetSearchAllLibrariesPart withHasThumbnail(Optional hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = hasThumbnail; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -530,41 +551,31 @@ public class GetSearchAllLibrariesPart { } GetSearchAllLibrariesPart other = (GetSearchAllLibrariesPart) o; return - Objects.deepEquals(this.accessible, other.accessible) && - Objects.deepEquals(this.exists, other.exists) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.indexes, other.indexes) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.packetLength, other.packetLength) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.hasThumbnail, other.hasThumbnail); + Utils.enhancedDeepEquals(this.accessible, other.accessible) && + Utils.enhancedDeepEquals(this.exists, other.exists) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.indexes, other.indexes) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.packetLength, other.packetLength) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.hasThumbnail, other.hasThumbnail); } @Override public int hashCode() { - return Objects.hash( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail); + return Utils.enhancedHash( + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail); } @Override @@ -586,43 +597,45 @@ public class GetSearchAllLibrariesPart { "optimizedForStreaming", optimizedForStreaming, "hasThumbnail", hasThumbnail); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional accessible = Optional.empty(); - + private Optional exists = Optional.empty(); - + private Long id; - + private Optional key = Optional.empty(); - + private Optional indexes = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional file = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional packetLength = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional hasThumbnail; - + private Builder() { // force use of static builder() method } + /** * Indicates if the part is accessible. */ @@ -641,6 +654,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Indicates if the part exists. */ @@ -659,6 +673,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Unique part identifier. */ @@ -668,6 +683,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Key to access this part. */ @@ -686,6 +702,7 @@ public class GetSearchAllLibrariesPart { return this; } + public Builder indexes(String indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = Optional.ofNullable(indexes); @@ -698,6 +715,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Duration of the part in milliseconds. */ @@ -716,6 +734,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * File path for the part. */ @@ -734,6 +753,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * File size in bytes. */ @@ -752,6 +772,7 @@ public class GetSearchAllLibrariesPart { return this; } + public Builder packetLength(int packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = Optional.ofNullable(packetLength); @@ -764,6 +785,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Container format of the part. */ @@ -782,6 +804,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Video profile for the part. */ @@ -800,6 +823,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -818,6 +842,7 @@ public class GetSearchAllLibrariesPart { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -830,6 +855,7 @@ public class GetSearchAllLibrariesPart { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -848,6 +874,7 @@ public class GetSearchAllLibrariesPart { return this; } + public Builder hasThumbnail(GetSearchAllLibrariesHasThumbnail hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = Optional.ofNullable(hasThumbnail); @@ -859,29 +886,21 @@ public class GetSearchAllLibrariesPart { this.hasThumbnail = hasThumbnail; return this; } - + public GetSearchAllLibrariesPart build() { if (hasThumbnail == null) { hasThumbnail = _SINGLETON_VALUE_HasThumbnail.value(); } + return new GetSearchAllLibrariesPart( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail); + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail); } + private static final LazySingletonValue> _SINGLETON_VALUE_HasThumbnail = new LazySingletonValue<>( "hasThumbnail", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesQueryParamIncludeCollections.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesQueryParamIncludeCollections.java index 87cb1e13..bbe88c25 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesQueryParamIncludeCollections.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesQueryParamIncludeCollections.java @@ -19,7 +19,7 @@ public enum GetSearchAllLibrariesQueryParamIncludeCollections { @JsonValue private final int value; - private GetSearchAllLibrariesQueryParamIncludeCollections(int value) { + GetSearchAllLibrariesQueryParamIncludeCollections(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesQueryParamIncludeExternalMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesQueryParamIncludeExternalMedia.java index 28260b50..62af4299 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesQueryParamIncludeExternalMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesQueryParamIncludeExternalMedia.java @@ -19,7 +19,7 @@ public enum GetSearchAllLibrariesQueryParamIncludeExternalMedia { @JsonValue private final int value; - private GetSearchAllLibrariesQueryParamIncludeExternalMedia(int value) { + GetSearchAllLibrariesQueryParamIncludeExternalMedia(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java index b556c75c..ca8ab364 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequest.java @@ -14,11 +14,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; -public class GetSearchAllLibrariesRequest { +public class GetSearchAllLibrariesRequest { /** * The search query term. */ @@ -80,7 +79,8 @@ public class GetSearchAllLibrariesRequest { public GetSearchAllLibrariesRequest( String query, String clientID) { - this(query, clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(query, clientID, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -134,9 +134,10 @@ public class GetSearchAllLibrariesRequest { return (Optional) includeExternalMedia; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The search query term. @@ -165,6 +166,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * Limit the number of results returned. */ @@ -183,6 +185,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. */ @@ -201,6 +204,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * Whether to include collections in the search results. */ @@ -219,6 +223,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * Whether to include external media in the search results. */ @@ -228,7 +233,6 @@ public class GetSearchAllLibrariesRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -239,23 +243,19 @@ public class GetSearchAllLibrariesRequest { } GetSearchAllLibrariesRequest other = (GetSearchAllLibrariesRequest) o; return - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.clientID, other.clientID) && - Objects.deepEquals(this.limit, other.limit) && - Objects.deepEquals(this.searchTypes, other.searchTypes) && - Objects.deepEquals(this.includeCollections, other.includeCollections) && - Objects.deepEquals(this.includeExternalMedia, other.includeExternalMedia); + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.clientID, other.clientID) && + Utils.enhancedDeepEquals(this.limit, other.limit) && + Utils.enhancedDeepEquals(this.searchTypes, other.searchTypes) && + Utils.enhancedDeepEquals(this.includeCollections, other.includeCollections) && + Utils.enhancedDeepEquals(this.includeExternalMedia, other.includeExternalMedia); } @Override public int hashCode() { - return Objects.hash( - query, - clientID, - limit, - searchTypes, - includeCollections, - includeExternalMedia); + return Utils.enhancedHash( + query, clientID, limit, + searchTypes, includeCollections, includeExternalMedia); } @Override @@ -268,25 +268,27 @@ public class GetSearchAllLibrariesRequest { "includeCollections", includeCollections, "includeExternalMedia", includeExternalMedia); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String query; - + private String clientID; - + private Optional limit = Optional.empty(); - + private Optional> searchTypes = Optional.empty(); - + private Optional includeCollections; - + private Optional includeExternalMedia; - + private Builder() { // force use of static builder() method } + /** * The search query term. */ @@ -296,6 +298,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @@ -305,6 +308,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * Limit the number of results returned. */ @@ -323,6 +327,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv. */ @@ -341,6 +346,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * Whether to include collections in the search results. */ @@ -359,6 +365,7 @@ public class GetSearchAllLibrariesRequest { return this; } + /** * Whether to include external media in the search results. */ @@ -376,7 +383,7 @@ public class GetSearchAllLibrariesRequest { this.includeExternalMedia = includeExternalMedia; return this; } - + public GetSearchAllLibrariesRequest build() { if (includeCollections == null) { includeCollections = _SINGLETON_VALUE_IncludeCollections.value(); @@ -384,15 +391,13 @@ public class GetSearchAllLibrariesRequest { if (includeExternalMedia == null) { includeExternalMedia = _SINGLETON_VALUE_IncludeExternalMedia.value(); } + return new GetSearchAllLibrariesRequest( - query, - clientID, - limit, - searchTypes, - includeCollections, - includeExternalMedia); + query, clientID, limit, + searchTypes, includeCollections, includeExternalMedia); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeCollections = new LazySingletonValue<>( "includeCollections", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequestBuilder.java index c898b10f..94b685e6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetSearchAllLibraries; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetSearchAllLibrariesRequestBuilder { private GetSearchAllLibrariesRequest request; - private final SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk; + private final SDKConfiguration sdkConfiguration; - public GetSearchAllLibrariesRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchAllLibraries sdk) { - this.sdk = sdk; + public GetSearchAllLibrariesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetSearchAllLibrariesRequestBuilder request(GetSearchAllLibrariesRequest request) { @@ -22,8 +26,10 @@ public class GetSearchAllLibrariesRequestBuilder { } public GetSearchAllLibrariesResponse call() throws Exception { + + RequestOperation operation + = new GetSearchAllLibraries.Sync(sdkConfiguration); - return sdk.getSearchAllLibraries( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponse.java index bbd07b27..2d21346a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetSearchAllLibrariesResponse implements Response { +public class GetSearchAllLibrariesResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetSearchAllLibrariesResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetSearchAllLibrariesResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetSearchAllLibrariesResponse implements Response { return this; } + /** * The libraries available on the Server */ @@ -143,7 +145,6 @@ public class GetSearchAllLibrariesResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetSearchAllLibrariesResponse implements Response { } GetSearchAllLibrariesResponse other = (GetSearchAllLibrariesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetSearchAllLibrariesResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetSearchAllLibrariesResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetSearchAllLibrariesResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetSearchAllLibrariesResponse implements Response { return this; } + /** * The libraries available on the Server */ @@ -236,13 +240,13 @@ public class GetSearchAllLibrariesResponse implements Response { this.object = object; return this; } - + public GetSearchAllLibrariesResponse build() { + return new GetSearchAllLibrariesResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponseBody.java index 4ddabfde..c6817f07 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesResponseBody.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * GetSearchAllLibrariesResponseBody @@ -33,9 +32,10 @@ public class GetSearchAllLibrariesResponseBody { return mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchAllLibrariesResponseBody withMediaContainer(GetSearchAllLibrariesMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -43,7 +43,6 @@ public class GetSearchAllLibrariesResponseBody { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -54,12 +53,12 @@ public class GetSearchAllLibrariesResponseBody { } GetSearchAllLibrariesResponseBody other = (GetSearchAllLibrariesResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -68,24 +67,28 @@ public class GetSearchAllLibrariesResponseBody { return Utils.toString(GetSearchAllLibrariesResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private GetSearchAllLibrariesMediaContainer mediaContainer; - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetSearchAllLibrariesMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - + public GetSearchAllLibrariesResponseBody build() { + return new GetSearchAllLibrariesResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRole.java index d030e344..4e432501 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesRole.java @@ -12,11 +12,10 @@ 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 GetSearchAllLibrariesRole { +public class GetSearchAllLibrariesRole { /** * The unique identifier for the role. * NOTE: This is different for each Plex server and is not globally unique. @@ -63,7 +62,8 @@ public class GetSearchAllLibrariesRole { public GetSearchAllLibrariesRole( int id, String tag) { - this(id, tag, Optional.empty(), Optional.empty()); + this(id, tag, Optional.empty(), + Optional.empty()); } /** @@ -99,9 +99,10 @@ public class GetSearchAllLibrariesRole { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the role. @@ -131,6 +132,7 @@ public class GetSearchAllLibrariesRole { return this; } + /** * The role played by the actor in the media item. */ @@ -149,6 +151,7 @@ public class GetSearchAllLibrariesRole { return this; } + /** * The absolute URL of the thumbnail image for the actor. */ @@ -158,7 +161,6 @@ public class GetSearchAllLibrariesRole { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -169,18 +171,16 @@ public class GetSearchAllLibrariesRole { } GetSearchAllLibrariesRole other = (GetSearchAllLibrariesRole) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - role, + return Utils.enhancedHash( + id, tag, role, thumb); } @@ -192,21 +192,23 @@ public class GetSearchAllLibrariesRole { "role", role, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Optional role = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the role. * NOTE: This is different for each Plex server and is not globally unique. @@ -217,6 +219,7 @@ public class GetSearchAllLibrariesRole { return this; } + /** * The display tag for the actor (typically the actor's name). */ @@ -226,6 +229,7 @@ public class GetSearchAllLibrariesRole { return this; } + /** * The role played by the actor in the media item. */ @@ -244,6 +248,7 @@ public class GetSearchAllLibrariesRole { return this; } + /** * The absolute URL of the thumbnail image for the actor. */ @@ -261,13 +266,13 @@ public class GetSearchAllLibrariesRole { this.thumb = thumb; return this; } - + public GetSearchAllLibrariesRole build() { + return new GetSearchAllLibrariesRole( - id, - tag, - role, + id, tag, role, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesUltraBlurColors.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesUltraBlurColors.java index 6acc29be..9973ff82 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesUltraBlurColors.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesUltraBlurColors.java @@ -9,19 +9,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetSearchAllLibrariesUltraBlurColors { @JsonProperty("topLeft") private String topLeft; + @JsonProperty("topRight") private String topRight; + @JsonProperty("bottomRight") private String bottomRight; + @JsonProperty("bottomLeft") private String bottomLeft; @@ -61,9 +64,10 @@ public class GetSearchAllLibrariesUltraBlurColors { return bottomLeft; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchAllLibrariesUltraBlurColors withTopLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); @@ -89,7 +93,6 @@ public class GetSearchAllLibrariesUltraBlurColors { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -100,18 +103,16 @@ public class GetSearchAllLibrariesUltraBlurColors { } GetSearchAllLibrariesUltraBlurColors other = (GetSearchAllLibrariesUltraBlurColors) o; return - Objects.deepEquals(this.topLeft, other.topLeft) && - Objects.deepEquals(this.topRight, other.topRight) && - Objects.deepEquals(this.bottomRight, other.bottomRight) && - Objects.deepEquals(this.bottomLeft, other.bottomLeft); + Utils.enhancedDeepEquals(this.topLeft, other.topLeft) && + Utils.enhancedDeepEquals(this.topRight, other.topRight) && + Utils.enhancedDeepEquals(this.bottomRight, other.bottomRight) && + Utils.enhancedDeepEquals(this.bottomLeft, other.bottomLeft); } @Override public int hashCode() { - return Objects.hash( - topLeft, - topRight, - bottomRight, + return Utils.enhancedHash( + topLeft, topRight, bottomRight, bottomLeft); } @@ -123,51 +124,56 @@ public class GetSearchAllLibrariesUltraBlurColors { "bottomRight", bottomRight, "bottomLeft", bottomLeft); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String topLeft; - + private String topRight; - + private String bottomRight; - + private String bottomLeft; - + private Builder() { // force use of static builder() method } + public Builder topLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); this.topLeft = topLeft; return this; } + public Builder topRight(String topRight) { Utils.checkNotNull(topRight, "topRight"); this.topRight = topRight; return this; } + public Builder bottomRight(String bottomRight) { Utils.checkNotNull(bottomRight, "bottomRight"); this.bottomRight = bottomRight; return this; } + public Builder bottomLeft(String bottomLeft) { Utils.checkNotNull(bottomLeft, "bottomLeft"); this.bottomLeft = bottomLeft; return this; } - + public GetSearchAllLibrariesUltraBlurColors build() { + return new GetSearchAllLibrariesUltraBlurColors( - topLeft, - topRight, - bottomRight, + topLeft, topRight, bottomRight, bottomLeft); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesWriter.java index 6a2b7df8..cd35c34c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesWriter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchAllLibrariesWriter.java @@ -12,11 +12,10 @@ 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 GetSearchAllLibrariesWriter { +public class GetSearchAllLibrariesWriter { /** * Unique identifier for the writer. */ @@ -79,9 +78,10 @@ public class GetSearchAllLibrariesWriter { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the writer. @@ -110,6 +110,7 @@ public class GetSearchAllLibrariesWriter { return this; } + /** * The absolute URL of the thumbnail image for the writer. */ @@ -119,7 +120,6 @@ public class GetSearchAllLibrariesWriter { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -130,17 +130,15 @@ public class GetSearchAllLibrariesWriter { } GetSearchAllLibrariesWriter other = (GetSearchAllLibrariesWriter) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - tag, - thumb); + return Utils.enhancedHash( + id, tag, thumb); } @Override @@ -150,19 +148,21 @@ public class GetSearchAllLibrariesWriter { "tag", tag, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String tag; - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the writer. */ @@ -172,6 +172,7 @@ public class GetSearchAllLibrariesWriter { return this; } + /** * The role of Writer */ @@ -181,6 +182,7 @@ public class GetSearchAllLibrariesWriter { return this; } + /** * The absolute URL of the thumbnail image for the writer. */ @@ -198,12 +200,12 @@ public class GetSearchAllLibrariesWriter { this.thumb = thumb; return this; } - + public GetSearchAllLibrariesWriter build() { + return new GetSearchAllLibrariesWriter( - id, - tag, - thumb); + id, tag, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMediaContainer.java index 1f3de99f..2a1ea34f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMediaContainer.java @@ -15,59 +15,71 @@ 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 GetSearchLibraryMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagPrefix") private Optional mediaTagPrefix; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagVersion") private Optional mediaTagVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("nocache") private Optional nocache; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title1") private Optional title1; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title2") private Optional title2; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewGroup") private Optional viewGroup; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewMode") private Optional viewMode; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -116,7 +128,11 @@ public class GetSearchLibraryMediaContainer { } public GetSearchLibraryMediaContainer() { - 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()); + 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()); } @JsonIgnore @@ -185,9 +201,10 @@ public class GetSearchLibraryMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchLibraryMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -195,6 +212,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -207,6 +225,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -219,6 +238,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -231,6 +251,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -243,6 +264,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withMediaTagPrefix(Optional mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = mediaTagPrefix; @@ -255,6 +277,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withMediaTagVersion(Optional mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = mediaTagVersion; @@ -267,6 +290,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withNocache(Optional nocache) { Utils.checkNotNull(nocache, "nocache"); this.nocache = nocache; @@ -279,6 +303,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -291,6 +316,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withTitle1(Optional title1) { Utils.checkNotNull(title1, "title1"); this.title1 = title1; @@ -303,6 +329,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withTitle2(Optional title2) { Utils.checkNotNull(title2, "title2"); this.title2 = title2; @@ -315,6 +342,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withViewGroup(Optional viewGroup) { Utils.checkNotNull(viewGroup, "viewGroup"); this.viewGroup = viewGroup; @@ -327,6 +355,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withViewMode(Optional viewMode) { Utils.checkNotNull(viewMode, "viewMode"); this.viewMode = viewMode; @@ -339,13 +368,13 @@ public class GetSearchLibraryMediaContainer { return this; } + public GetSearchLibraryMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -356,36 +385,28 @@ public class GetSearchLibraryMediaContainer { } GetSearchLibraryMediaContainer other = (GetSearchLibraryMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.nocache, other.nocache) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title1, other.title1) && - Objects.deepEquals(this.title2, other.title2) && - Objects.deepEquals(this.viewGroup, other.viewGroup) && - Objects.deepEquals(this.viewMode, other.viewMode) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.nocache, other.nocache) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title1, other.title1) && + Utils.enhancedDeepEquals(this.title2, other.title2) && + Utils.enhancedDeepEquals(this.viewGroup, other.viewGroup) && + Utils.enhancedDeepEquals(this.viewMode, other.viewMode) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - art, - identifier, - mediaTagPrefix, - mediaTagVersion, - nocache, - thumb, - title1, - title2, - viewGroup, - viewMode, + return Utils.enhancedHash( + size, allowSync, art, + identifier, mediaTagPrefix, mediaTagVersion, + nocache, thumb, title1, + title2, viewGroup, viewMode, metadata); } @@ -406,39 +427,41 @@ public class GetSearchLibraryMediaContainer { "viewMode", viewMode, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional allowSync = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional identifier = Optional.empty(); - + private Optional mediaTagPrefix = Optional.empty(); - + private Optional mediaTagVersion = Optional.empty(); - + private Optional nocache = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional title1 = Optional.empty(); - + private Optional title2 = Optional.empty(); - + private Optional viewGroup = Optional.empty(); - + private Optional viewMode = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -451,6 +474,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -463,6 +487,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -475,6 +500,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -487,6 +513,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder mediaTagPrefix(String mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); @@ -499,6 +526,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder mediaTagVersion(int mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); @@ -511,6 +539,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder nocache(boolean nocache) { Utils.checkNotNull(nocache, "nocache"); this.nocache = Optional.ofNullable(nocache); @@ -523,6 +552,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -535,6 +565,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder title1(String title1) { Utils.checkNotNull(title1, "title1"); this.title1 = Optional.ofNullable(title1); @@ -547,6 +578,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder title2(String title2) { Utils.checkNotNull(title2, "title2"); this.title2 = Optional.ofNullable(title2); @@ -559,6 +591,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder viewGroup(String viewGroup) { Utils.checkNotNull(viewGroup, "viewGroup"); this.viewGroup = Optional.ofNullable(viewGroup); @@ -571,6 +604,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder viewMode(int viewMode) { Utils.checkNotNull(viewMode, "viewMode"); this.viewMode = Optional.ofNullable(viewMode); @@ -583,6 +617,7 @@ public class GetSearchLibraryMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -594,22 +629,16 @@ public class GetSearchLibraryMediaContainer { this.metadata = metadata; return this; } - + public GetSearchLibraryMediaContainer build() { + return new GetSearchLibraryMediaContainer( - size, - allowSync, - art, - identifier, - mediaTagPrefix, - mediaTagVersion, - nocache, - thumb, - title1, - title2, - viewGroup, - viewMode, + size, allowSync, art, + identifier, mediaTagPrefix, mediaTagVersion, + nocache, thumb, title1, + title2, viewGroup, viewMode, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMetadata.java index eec294f7..357dc19a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryMetadata.java @@ -12,87 +12,106 @@ 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 GetSearchLibraryMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentRatingKey") private Optional parentRatingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentGuid") private Optional parentGuid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentStudio") private Optional parentStudio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentKey") private Optional parentKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentTitle") private Optional parentTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("index") private Optional index; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentIndex") private Optional parentIndex; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentYear") private Optional parentYear; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentThumb") private Optional parentThumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentTheme") private Optional parentTheme; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; @@ -162,7 +181,13 @@ public class GetSearchLibraryMetadata { } public GetSearchLibraryMetadata() { - 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()); + 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()); } @JsonIgnore @@ -265,9 +290,10 @@ public class GetSearchLibraryMetadata { return updatedAt; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchLibraryMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -275,6 +301,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -287,6 +314,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -299,6 +327,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentRatingKey(Optional parentRatingKey) { Utils.checkNotNull(parentRatingKey, "parentRatingKey"); this.parentRatingKey = parentRatingKey; @@ -311,6 +340,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -323,6 +353,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentGuid(Optional parentGuid) { Utils.checkNotNull(parentGuid, "parentGuid"); this.parentGuid = parentGuid; @@ -335,6 +366,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentStudio(Optional parentStudio) { Utils.checkNotNull(parentStudio, "parentStudio"); this.parentStudio = parentStudio; @@ -347,6 +379,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -359,6 +392,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -371,6 +405,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentKey(Optional parentKey) { Utils.checkNotNull(parentKey, "parentKey"); this.parentKey = parentKey; @@ -383,6 +418,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentTitle(Optional parentTitle) { Utils.checkNotNull(parentTitle, "parentTitle"); this.parentTitle = parentTitle; @@ -395,6 +431,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -407,6 +444,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withIndex(Optional index) { Utils.checkNotNull(index, "index"); this.index = index; @@ -419,6 +457,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentIndex(Optional parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = parentIndex; @@ -431,6 +470,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentYear(Optional parentYear) { Utils.checkNotNull(parentYear, "parentYear"); this.parentYear = parentYear; @@ -443,6 +483,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -455,6 +496,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -467,6 +509,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentThumb(Optional parentThumb) { Utils.checkNotNull(parentThumb, "parentThumb"); this.parentThumb = parentThumb; @@ -479,6 +522,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withParentTheme(Optional parentTheme) { Utils.checkNotNull(parentTheme, "parentTheme"); this.parentTheme = parentTheme; @@ -491,6 +535,7 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -503,13 +548,13 @@ public class GetSearchLibraryMetadata { return this; } + public GetSearchLibraryMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -520,51 +565,38 @@ public class GetSearchLibraryMetadata { } GetSearchLibraryMetadata other = (GetSearchLibraryMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.parentGuid, other.parentGuid) && - Objects.deepEquals(this.parentStudio, other.parentStudio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.parentYear, other.parentYear) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.parentTheme, other.parentTheme) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.parentRatingKey, other.parentRatingKey) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.parentGuid, other.parentGuid) && + Utils.enhancedDeepEquals(this.parentStudio, other.parentStudio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.parentYear, other.parentYear) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.parentTheme, other.parentTheme) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - parentRatingKey, - guid, - parentGuid, - parentStudio, - type, - title, - parentKey, - parentTitle, - summary, - index, - parentIndex, - parentYear, - thumb, - art, - parentThumb, - parentTheme, - addedAt, - updatedAt); + return Utils.enhancedHash( + ratingKey, key, parentRatingKey, + guid, parentGuid, parentStudio, + type, title, parentKey, + parentTitle, summary, index, + parentIndex, parentYear, thumb, + art, parentThumb, parentTheme, + addedAt, updatedAt); } @Override @@ -591,53 +623,55 @@ public class GetSearchLibraryMetadata { "addedAt", addedAt, "updatedAt", updatedAt); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional parentRatingKey = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional parentGuid = Optional.empty(); - + private Optional parentStudio = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional index = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional parentYear = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional parentThumb = Optional.empty(); - + private Optional parentTheme = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -650,6 +684,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -662,6 +697,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentRatingKey(String parentRatingKey) { Utils.checkNotNull(parentRatingKey, "parentRatingKey"); this.parentRatingKey = Optional.ofNullable(parentRatingKey); @@ -674,6 +710,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -686,6 +723,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentGuid(String parentGuid) { Utils.checkNotNull(parentGuid, "parentGuid"); this.parentGuid = Optional.ofNullable(parentGuid); @@ -698,6 +736,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentStudio(String parentStudio) { Utils.checkNotNull(parentStudio, "parentStudio"); this.parentStudio = Optional.ofNullable(parentStudio); @@ -710,6 +749,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -722,6 +762,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -734,6 +775,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentKey(String parentKey) { Utils.checkNotNull(parentKey, "parentKey"); this.parentKey = Optional.ofNullable(parentKey); @@ -746,6 +788,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentTitle(String parentTitle) { Utils.checkNotNull(parentTitle, "parentTitle"); this.parentTitle = Optional.ofNullable(parentTitle); @@ -758,6 +801,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -770,6 +814,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder index(int index) { Utils.checkNotNull(index, "index"); this.index = Optional.ofNullable(index); @@ -782,6 +827,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentIndex(int parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = Optional.ofNullable(parentIndex); @@ -794,6 +840,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentYear(int parentYear) { Utils.checkNotNull(parentYear, "parentYear"); this.parentYear = Optional.ofNullable(parentYear); @@ -806,6 +853,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -818,6 +866,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -830,6 +879,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentThumb(String parentThumb) { Utils.checkNotNull(parentThumb, "parentThumb"); this.parentThumb = Optional.ofNullable(parentThumb); @@ -842,6 +892,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder parentTheme(String parentTheme) { Utils.checkNotNull(parentTheme, "parentTheme"); this.parentTheme = Optional.ofNullable(parentTheme); @@ -854,6 +905,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -866,6 +918,7 @@ public class GetSearchLibraryMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -877,29 +930,18 @@ public class GetSearchLibraryMetadata { this.updatedAt = updatedAt; return this; } - + public GetSearchLibraryMetadata build() { + return new GetSearchLibraryMetadata( - ratingKey, - key, - parentRatingKey, - guid, - parentGuid, - parentStudio, - type, - title, - parentKey, - parentTitle, - summary, - index, - parentIndex, - parentYear, - thumb, - art, - parentThumb, - parentTheme, - addedAt, - updatedAt); + ratingKey, key, parentRatingKey, + guid, parentGuid, parentStudio, + type, title, parentKey, + parentTitle, summary, index, + parentIndex, parentYear, thumb, + art, parentThumb, parentTheme, + addedAt, updatedAt); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequest.java index 6a609ca8..0673a74d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetSearchLibraryRequest { - /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -64,9 +63,10 @@ public class GetSearchLibraryRequest { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique key of the Plex library. @@ -92,7 +92,6 @@ public class GetSearchLibraryRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -103,15 +102,14 @@ public class GetSearchLibraryRequest { } GetSearchLibraryRequest other = (GetSearchLibraryRequest) o; return - Objects.deepEquals(this.sectionKey, other.sectionKey) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.sectionKey, other.sectionKey) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - sectionKey, - type); + return Utils.enhancedHash( + sectionKey, type); } @Override @@ -120,17 +118,19 @@ public class GetSearchLibraryRequest { "sectionKey", sectionKey, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer sectionKey; - + private GetSearchLibraryQueryParamType type; - + private Builder() { // force use of static builder() method } + /** * The unique key of the Plex library. * Note: This is unique in the context of the Plex server. @@ -141,6 +141,7 @@ public class GetSearchLibraryRequest { return this; } + /** * The type of media to retrieve or filter by. * 1 = movie @@ -154,11 +155,12 @@ public class GetSearchLibraryRequest { this.type = type; return this; } - + public GetSearchLibraryRequest build() { + return new GetSearchLibraryRequest( - sectionKey, - type); + sectionKey, type); } + } } 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 f3acea03..d8019a50 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetSearchLibrary; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Integer; @@ -11,10 +15,10 @@ public class GetSearchLibraryRequestBuilder { private Integer sectionKey; private GetSearchLibraryQueryParamType type; - private final SDKMethodInterfaces.MethodCallGetSearchLibrary sdk; + private final SDKConfiguration sdkConfiguration; - public GetSearchLibraryRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchLibrary sdk) { - this.sdk = sdk; + public GetSearchLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetSearchLibraryRequestBuilder sectionKey(int sectionKey) { @@ -29,10 +33,21 @@ public class GetSearchLibraryRequestBuilder { return this; } - public GetSearchLibraryResponse call() throws Exception { - return sdk.getSearchLibrary( - sectionKey, + private GetSearchLibraryRequest buildRequest() { + + GetSearchLibraryRequest request = new GetSearchLibraryRequest(sectionKey, type); + + return request; + } + + public GetSearchLibraryResponse call() throws Exception { + + RequestOperation operation + = new GetSearchLibrary.Sync(sdkConfiguration); + GetSearchLibraryRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryResponse.java index 7aa9298c..658b2ef6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetSearchLibraryResponse implements Response { +public class GetSearchLibraryResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetSearchLibraryResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetSearchLibraryResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetSearchLibraryResponse implements Response { return this; } + /** * The contents of the library by section and type */ @@ -143,7 +145,6 @@ public class GetSearchLibraryResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetSearchLibraryResponse implements Response { } GetSearchLibraryResponse other = (GetSearchLibraryResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetSearchLibraryResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetSearchLibraryResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetSearchLibraryResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetSearchLibraryResponse implements Response { return this; } + /** * The contents of the library by section and type */ @@ -236,13 +240,13 @@ public class GetSearchLibraryResponse implements Response { this.object = object; return this; } - + public GetSearchLibraryResponse build() { + return new GetSearchLibraryResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryResponseBody.java index 13d0bf4c..5b120674 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchLibraryResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetSearchLibraryResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchLibraryResponseBody withMediaContainer(GetSearchLibraryMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetSearchLibraryResponseBody { return this; } + public GetSearchLibraryResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetSearchLibraryResponseBody { } GetSearchLibraryResponseBody other = (GetSearchLibraryResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetSearchLibraryResponseBody { return Utils.toString(GetSearchLibraryResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetSearchLibraryMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetSearchLibraryResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetSearchLibraryResponseBody build() { + return new GetSearchLibraryResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsCountry.java index 23daa3e4..d9a3114f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsCountry.java @@ -11,9 +11,9 @@ 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 GetSearchResultsCountry { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetSearchResultsCountry { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsCountry withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetSearchResultsCountry { return this; } + public GetSearchResultsCountry withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetSearchResultsCountry { } GetSearchResultsCountry other = (GetSearchResultsCountry) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetSearchResultsCountry { return Utils.toString(GetSearchResultsCountry.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetSearchResultsCountry { this.tag = tag; return this; } - + public GetSearchResultsCountry build() { + return new GetSearchResultsCountry( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsDirector.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsDirector.java index 29633b4d..97bde20f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsDirector.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsDirector.java @@ -11,9 +11,9 @@ 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 GetSearchResultsDirector { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetSearchResultsDirector { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsDirector withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetSearchResultsDirector { return this; } + public GetSearchResultsDirector withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetSearchResultsDirector { } GetSearchResultsDirector other = (GetSearchResultsDirector) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetSearchResultsDirector { return Utils.toString(GetSearchResultsDirector.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetSearchResultsDirector { this.tag = tag; return this; } - + public GetSearchResultsDirector build() { + return new GetSearchResultsDirector( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsGenre.java index 91ac6093..af140856 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsGenre.java @@ -11,9 +11,9 @@ 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 GetSearchResultsGenre { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetSearchResultsGenre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsGenre withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetSearchResultsGenre { return this; } + public GetSearchResultsGenre withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetSearchResultsGenre { } GetSearchResultsGenre other = (GetSearchResultsGenre) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetSearchResultsGenre { return Utils.toString(GetSearchResultsGenre.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetSearchResultsGenre { this.tag = tag; return this; } - + public GetSearchResultsGenre build() { + return new GetSearchResultsGenre( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMedia.java index 705fdef9..d4bffe92 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMedia.java @@ -14,67 +14,81 @@ 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 GetSearchResultsMedia { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") private Optional bitrate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("width") private Optional width; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("height") private Optional height; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("aspectRatio") private Optional aspectRatio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") private Optional audioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoCodec") private Optional videoCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoResolution") private Optional videoResolution; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoFrameRate") private Optional videoFrameRate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Part") private Optional> part; @@ -129,7 +143,11 @@ public class GetSearchResultsMedia { } public GetSearchResultsMedia() { - 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()); + 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()); } @JsonIgnore @@ -208,9 +226,10 @@ public class GetSearchResultsMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsMedia withId(double id) { Utils.checkNotNull(id, "id"); @@ -218,6 +237,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -230,6 +250,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -242,6 +263,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; @@ -254,6 +276,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withWidth(Optional width) { Utils.checkNotNull(width, "width"); this.width = width; @@ -266,6 +289,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withHeight(Optional height) { Utils.checkNotNull(height, "height"); this.height = height; @@ -278,6 +302,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withAspectRatio(Optional aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = aspectRatio; @@ -290,6 +315,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; @@ -302,6 +328,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; @@ -314,6 +341,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withVideoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; @@ -326,6 +354,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withVideoResolution(Optional videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = videoResolution; @@ -338,6 +367,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -350,6 +380,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withVideoFrameRate(Optional videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = videoFrameRate; @@ -362,6 +393,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withAudioProfile(Optional audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = audioProfile; @@ -374,6 +406,7 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; @@ -386,13 +419,13 @@ public class GetSearchResultsMedia { return this; } + public GetSearchResultsMedia withPart(Optional> part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -403,41 +436,31 @@ public class GetSearchResultsMedia { } GetSearchResultsMedia other = (GetSearchResultsMedia) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - audioProfile, - videoProfile, - part); + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, audioCodec, videoCodec, + videoResolution, container, videoFrameRate, + audioProfile, videoProfile, part); } @Override @@ -459,43 +482,45 @@ public class GetSearchResultsMedia { "videoProfile", videoProfile, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(double id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -508,6 +533,7 @@ public class GetSearchResultsMedia { return this; } + public Builder duration(double duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -520,6 +546,7 @@ public class GetSearchResultsMedia { return this; } + public Builder bitrate(double bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = Optional.ofNullable(bitrate); @@ -532,6 +559,7 @@ public class GetSearchResultsMedia { return this; } + public Builder width(double width) { Utils.checkNotNull(width, "width"); this.width = Optional.ofNullable(width); @@ -544,6 +572,7 @@ public class GetSearchResultsMedia { return this; } + public Builder height(double height) { Utils.checkNotNull(height, "height"); this.height = Optional.ofNullable(height); @@ -556,6 +585,7 @@ public class GetSearchResultsMedia { return this; } + public Builder aspectRatio(double aspectRatio) { Utils.checkNotNull(aspectRatio, "aspectRatio"); this.aspectRatio = Optional.ofNullable(aspectRatio); @@ -568,6 +598,7 @@ public class GetSearchResultsMedia { return this; } + public Builder audioChannels(double audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = Optional.ofNullable(audioChannels); @@ -580,6 +611,7 @@ public class GetSearchResultsMedia { return this; } + public Builder audioCodec(String audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = Optional.ofNullable(audioCodec); @@ -592,6 +624,7 @@ public class GetSearchResultsMedia { return this; } + public Builder videoCodec(String videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = Optional.ofNullable(videoCodec); @@ -604,6 +637,7 @@ public class GetSearchResultsMedia { return this; } + public Builder videoResolution(double videoResolution) { Utils.checkNotNull(videoResolution, "videoResolution"); this.videoResolution = Optional.ofNullable(videoResolution); @@ -616,6 +650,7 @@ public class GetSearchResultsMedia { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -628,6 +663,7 @@ public class GetSearchResultsMedia { return this; } + public Builder videoFrameRate(String videoFrameRate) { Utils.checkNotNull(videoFrameRate, "videoFrameRate"); this.videoFrameRate = Optional.ofNullable(videoFrameRate); @@ -640,6 +676,7 @@ public class GetSearchResultsMedia { return this; } + public Builder audioProfile(String audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = Optional.ofNullable(audioProfile); @@ -652,6 +689,7 @@ public class GetSearchResultsMedia { return this; } + public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); @@ -664,6 +702,7 @@ public class GetSearchResultsMedia { return this; } + public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = Optional.ofNullable(part); @@ -675,24 +714,16 @@ public class GetSearchResultsMedia { this.part = part; return this; } - + public GetSearchResultsMedia build() { + return new GetSearchResultsMedia( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - audioProfile, - videoProfile, - part); + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, audioCodec, videoCodec, + videoResolution, container, videoFrameRate, + audioProfile, videoProfile, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMediaContainer.java index b50edf17..bdb3eef8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMediaContainer.java @@ -14,31 +14,36 @@ 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 GetSearchResultsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagPrefix") private Optional mediaTagPrefix; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaTagVersion") private Optional mediaTagVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Provider") private Optional> provider; @@ -66,7 +71,8 @@ public class GetSearchResultsMediaContainer { } public GetSearchResultsMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -101,9 +107,10 @@ public class GetSearchResultsMediaContainer { return (Optional>) provider; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsMediaContainer withSize(double size) { Utils.checkNotNull(size, "size"); @@ -111,6 +118,7 @@ public class GetSearchResultsMediaContainer { return this; } + public GetSearchResultsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -123,6 +131,7 @@ public class GetSearchResultsMediaContainer { return this; } + public GetSearchResultsMediaContainer withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -135,6 +144,7 @@ public class GetSearchResultsMediaContainer { return this; } + public GetSearchResultsMediaContainer withMediaTagPrefix(Optional mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = mediaTagPrefix; @@ -147,6 +157,7 @@ public class GetSearchResultsMediaContainer { return this; } + public GetSearchResultsMediaContainer withMediaTagVersion(Optional mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = mediaTagVersion; @@ -159,6 +170,7 @@ public class GetSearchResultsMediaContainer { return this; } + public GetSearchResultsMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; @@ -171,13 +183,13 @@ public class GetSearchResultsMediaContainer { return this; } + public GetSearchResultsMediaContainer withProvider(Optional> provider) { Utils.checkNotNull(provider, "provider"); this.provider = provider; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -188,23 +200,19 @@ public class GetSearchResultsMediaContainer { } GetSearchResultsMediaContainer other = (GetSearchResultsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.metadata, other.metadata) && - Objects.deepEquals(this.provider, other.provider); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.metadata, other.metadata) && + Utils.enhancedDeepEquals(this.provider, other.provider); } @Override public int hashCode() { - return Objects.hash( - size, - identifier, - mediaTagPrefix, - mediaTagVersion, - metadata, - provider); + return Utils.enhancedHash( + size, identifier, mediaTagPrefix, + mediaTagVersion, metadata, provider); } @Override @@ -217,25 +225,27 @@ public class GetSearchResultsMediaContainer { "metadata", metadata, "provider", provider); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional identifier = Optional.empty(); - + private Optional mediaTagPrefix = Optional.empty(); - + private Optional mediaTagVersion = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Optional> provider = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(double size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -248,6 +258,7 @@ public class GetSearchResultsMediaContainer { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -260,6 +271,7 @@ public class GetSearchResultsMediaContainer { return this; } + public Builder mediaTagPrefix(String mediaTagPrefix) { Utils.checkNotNull(mediaTagPrefix, "mediaTagPrefix"); this.mediaTagPrefix = Optional.ofNullable(mediaTagPrefix); @@ -272,6 +284,7 @@ public class GetSearchResultsMediaContainer { return this; } + public Builder mediaTagVersion(double mediaTagVersion) { Utils.checkNotNull(mediaTagVersion, "mediaTagVersion"); this.mediaTagVersion = Optional.ofNullable(mediaTagVersion); @@ -284,6 +297,7 @@ public class GetSearchResultsMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -296,6 +310,7 @@ public class GetSearchResultsMediaContainer { return this; } + public Builder provider(List provider) { Utils.checkNotNull(provider, "provider"); this.provider = Optional.ofNullable(provider); @@ -307,15 +322,13 @@ public class GetSearchResultsMediaContainer { this.provider = provider; return this; } - + public GetSearchResultsMediaContainer build() { + return new GetSearchResultsMediaContainer( - size, - identifier, - mediaTagPrefix, - mediaTagVersion, - metadata, - provider); + size, identifier, mediaTagPrefix, + mediaTagVersion, metadata, provider); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMetadata.java index 009531a4..1a1f7561 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsMetadata.java @@ -16,143 +16,176 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; + public class GetSearchResultsMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionUUID") private Optional librarySectionUUID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("personal") private Optional personal; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("sourceTitle") private Optional sourceTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("studio") private Optional studio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentRating") private Optional contentRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("rating") private Optional rating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRating") private Optional audienceRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("year") private Optional year; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagline") private Optional tagline; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRatingImage") private Optional audienceRatingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("chapterSource") private Optional chapterSource; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("primaryExtraKey") private Optional primaryExtraKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingImage") private Optional ratingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Director") private Optional> director; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Writer") private Optional> writer; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; @@ -264,7 +297,18 @@ public class GetSearchResultsMetadata { } public GetSearchResultsMetadata() { - 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()); + 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()); } @JsonIgnore @@ -443,9 +487,10 @@ public class GetSearchResultsMetadata { return (Optional>) role; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsMetadata withAllowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); @@ -453,6 +498,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -465,6 +511,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -477,6 +524,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -489,6 +537,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withLibrarySectionUUID(Optional librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = librarySectionUUID; @@ -501,6 +550,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withPersonal(Optional personal) { Utils.checkNotNull(personal, "personal"); this.personal = personal; @@ -513,6 +563,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withSourceTitle(Optional sourceTitle) { Utils.checkNotNull(sourceTitle, "sourceTitle"); this.sourceTitle = sourceTitle; @@ -525,6 +576,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -537,6 +589,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -549,6 +602,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -561,6 +615,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withStudio(Optional studio) { Utils.checkNotNull(studio, "studio"); this.studio = studio; @@ -573,6 +628,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -585,6 +641,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -597,6 +654,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withContentRating(Optional contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = contentRating; @@ -609,6 +667,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -621,6 +680,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withRating(Optional rating) { Utils.checkNotNull(rating, "rating"); this.rating = rating; @@ -633,6 +693,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withAudienceRating(Optional audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = audienceRating; @@ -645,6 +706,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withYear(Optional year) { Utils.checkNotNull(year, "year"); this.year = year; @@ -657,6 +719,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withTagline(Optional tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = tagline; @@ -669,6 +732,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -681,6 +745,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -693,6 +758,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -705,6 +771,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = originallyAvailableAt; @@ -717,6 +784,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -729,6 +797,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -741,6 +810,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withAudienceRatingImage(Optional audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = audienceRatingImage; @@ -753,6 +823,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withChapterSource(Optional chapterSource) { Utils.checkNotNull(chapterSource, "chapterSource"); this.chapterSource = chapterSource; @@ -765,6 +836,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withPrimaryExtraKey(Optional primaryExtraKey) { Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); this.primaryExtraKey = primaryExtraKey; @@ -777,6 +849,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withRatingImage(Optional ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = ratingImage; @@ -789,6 +862,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -801,6 +875,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -813,6 +888,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withDirector(Optional> director) { Utils.checkNotNull(director, "director"); this.director = director; @@ -825,6 +901,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withWriter(Optional> writer) { Utils.checkNotNull(writer, "writer"); this.writer = writer; @@ -837,6 +914,7 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -849,13 +927,13 @@ public class GetSearchResultsMetadata { return this; } + public GetSearchResultsMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -866,78 +944,56 @@ public class GetSearchResultsMetadata { } GetSearchResultsMetadata other = (GetSearchResultsMetadata) o; return - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionUUID, other.librarySectionUUID) && - Objects.deepEquals(this.personal, other.personal) && - Objects.deepEquals(this.sourceTitle, other.sourceTitle) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.chapterSource, other.chapterSource) && - Objects.deepEquals(this.primaryExtraKey, other.primaryExtraKey) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.director, other.director) && - Objects.deepEquals(this.writer, other.writer) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.role, other.role); + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionUUID, other.librarySectionUUID) && + Utils.enhancedDeepEquals(this.personal, other.personal) && + Utils.enhancedDeepEquals(this.sourceTitle, other.sourceTitle) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.chapterSource, other.chapterSource) && + Utils.enhancedDeepEquals(this.primaryExtraKey, other.primaryExtraKey) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.director, other.director) && + Utils.enhancedDeepEquals(this.writer, other.writer) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.role, other.role); } @Override public int hashCode() { - return Objects.hash( - allowSync, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - personal, - sourceTitle, - ratingKey, - key, - guid, - studio, - type, - title, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - ratingImage, - media, - genre, - director, - writer, - country, + return Utils.enhancedHash( + allowSync, librarySectionID, librarySectionTitle, + librarySectionUUID, personal, sourceTitle, + ratingKey, key, guid, + studio, type, title, + contentRating, summary, rating, + audienceRating, year, tagline, + thumb, art, duration, + originallyAvailableAt, addedAt, updatedAt, + audienceRatingImage, chapterSource, primaryExtraKey, + ratingImage, media, genre, + director, writer, country, role); } @@ -979,81 +1035,83 @@ public class GetSearchResultsMetadata { "country", country, "role", role); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional allowSync = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionUUID = Optional.empty(); - + private Optional personal = Optional.empty(); - + private Optional sourceTitle = Optional.empty(); - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional studio = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional contentRating = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional rating = Optional.empty(); - + private Optional audienceRating = Optional.empty(); - + private Optional year = Optional.empty(); - + private Optional tagline = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional originallyAvailableAt = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional chapterSource = Optional.empty(); - + private Optional primaryExtraKey = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> director = Optional.empty(); - + private Optional> writer = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -1066,6 +1124,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder librarySectionID(double librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -1078,6 +1137,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -1090,6 +1150,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder librarySectionUUID(String librarySectionUUID) { Utils.checkNotNull(librarySectionUUID, "librarySectionUUID"); this.librarySectionUUID = Optional.ofNullable(librarySectionUUID); @@ -1102,6 +1163,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder personal(boolean personal) { Utils.checkNotNull(personal, "personal"); this.personal = Optional.ofNullable(personal); @@ -1114,6 +1176,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder sourceTitle(String sourceTitle) { Utils.checkNotNull(sourceTitle, "sourceTitle"); this.sourceTitle = Optional.ofNullable(sourceTitle); @@ -1126,6 +1189,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder ratingKey(double ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -1138,6 +1202,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -1150,6 +1215,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -1162,6 +1228,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder studio(String studio) { Utils.checkNotNull(studio, "studio"); this.studio = Optional.ofNullable(studio); @@ -1174,6 +1241,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -1186,6 +1254,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -1198,6 +1267,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder contentRating(String contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = Optional.ofNullable(contentRating); @@ -1210,6 +1280,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -1222,6 +1293,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder rating(double rating) { Utils.checkNotNull(rating, "rating"); this.rating = Optional.ofNullable(rating); @@ -1234,6 +1306,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder audienceRating(double audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = Optional.ofNullable(audienceRating); @@ -1246,6 +1319,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder year(double year) { Utils.checkNotNull(year, "year"); this.year = Optional.ofNullable(year); @@ -1258,6 +1332,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder tagline(String tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = Optional.ofNullable(tagline); @@ -1270,6 +1345,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -1282,6 +1358,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -1294,6 +1371,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder duration(double duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -1306,6 +1384,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder originallyAvailableAt(OffsetDateTime originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); @@ -1318,6 +1397,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder addedAt(double addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -1330,6 +1410,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder updatedAt(double updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -1342,6 +1423,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder audienceRatingImage(String audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); @@ -1354,6 +1436,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder chapterSource(String chapterSource) { Utils.checkNotNull(chapterSource, "chapterSource"); this.chapterSource = Optional.ofNullable(chapterSource); @@ -1366,6 +1449,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder primaryExtraKey(String primaryExtraKey) { Utils.checkNotNull(primaryExtraKey, "primaryExtraKey"); this.primaryExtraKey = Optional.ofNullable(primaryExtraKey); @@ -1378,6 +1462,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder ratingImage(String ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = Optional.ofNullable(ratingImage); @@ -1390,6 +1475,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -1402,6 +1488,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -1414,6 +1501,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder director(List director) { Utils.checkNotNull(director, "director"); this.director = Optional.ofNullable(director); @@ -1426,6 +1514,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder writer(List writer) { Utils.checkNotNull(writer, "writer"); this.writer = Optional.ofNullable(writer); @@ -1438,6 +1527,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -1450,6 +1540,7 @@ public class GetSearchResultsMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -1461,43 +1552,23 @@ public class GetSearchResultsMetadata { this.role = role; return this; } - + public GetSearchResultsMetadata build() { + return new GetSearchResultsMetadata( - allowSync, - librarySectionID, - librarySectionTitle, - librarySectionUUID, - personal, - sourceTitle, - ratingKey, - key, - guid, - studio, - type, - title, - contentRating, - summary, - rating, - audienceRating, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - addedAt, - updatedAt, - audienceRatingImage, - chapterSource, - primaryExtraKey, - ratingImage, - media, - genre, - director, - writer, - country, + allowSync, librarySectionID, librarySectionTitle, + librarySectionUUID, personal, sourceTitle, + ratingKey, key, guid, + studio, type, title, + contentRating, summary, rating, + audienceRating, year, tagline, + thumb, art, duration, + originallyAvailableAt, addedAt, updatedAt, + audienceRatingImage, chapterSource, primaryExtraKey, + ratingImage, media, genre, + director, writer, country, role); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsPart.java index 6454eff8..5ed96e07 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsPart.java @@ -12,39 +12,46 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetSearchResultsPart { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("file") private Optional file; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoProfile") private Optional videoProfile; @@ -78,7 +85,9 @@ public class GetSearchResultsPart { } public GetSearchResultsPart() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -121,9 +130,10 @@ public class GetSearchResultsPart { return videoProfile; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsPart withId(double id) { Utils.checkNotNull(id, "id"); @@ -131,6 +141,7 @@ public class GetSearchResultsPart { return this; } + public GetSearchResultsPart withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -143,6 +154,7 @@ public class GetSearchResultsPart { return this; } + public GetSearchResultsPart withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -155,6 +167,7 @@ public class GetSearchResultsPart { return this; } + public GetSearchResultsPart withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -167,6 +180,7 @@ public class GetSearchResultsPart { return this; } + public GetSearchResultsPart withFile(Optional file) { Utils.checkNotNull(file, "file"); this.file = file; @@ -179,6 +193,7 @@ public class GetSearchResultsPart { return this; } + public GetSearchResultsPart withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -191,6 +206,7 @@ public class GetSearchResultsPart { return this; } + public GetSearchResultsPart withAudioProfile(Optional audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = audioProfile; @@ -203,6 +219,7 @@ public class GetSearchResultsPart { return this; } + public GetSearchResultsPart withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -215,13 +232,13 @@ public class GetSearchResultsPart { return this; } + public GetSearchResultsPart withVideoProfile(Optional videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = videoProfile; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -232,27 +249,22 @@ public class GetSearchResultsPart { } GetSearchResultsPart other = (GetSearchResultsPart) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoProfile, other.videoProfile); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile); } @Override public int hashCode() { - return Objects.hash( - id, - key, - duration, - file, - size, - audioProfile, - container, - videoProfile); + return Utils.enhancedHash( + id, key, duration, + file, size, audioProfile, + container, videoProfile); } @Override @@ -267,29 +279,31 @@ public class GetSearchResultsPart { "container", container, "videoProfile", videoProfile); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional file = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(double id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -302,6 +316,7 @@ public class GetSearchResultsPart { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -314,6 +329,7 @@ public class GetSearchResultsPart { return this; } + public Builder duration(double duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -326,6 +342,7 @@ public class GetSearchResultsPart { return this; } + public Builder file(String file) { Utils.checkNotNull(file, "file"); this.file = Optional.ofNullable(file); @@ -338,6 +355,7 @@ public class GetSearchResultsPart { return this; } + public Builder size(double size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -350,6 +368,7 @@ public class GetSearchResultsPart { return this; } + public Builder audioProfile(String audioProfile) { Utils.checkNotNull(audioProfile, "audioProfile"); this.audioProfile = Optional.ofNullable(audioProfile); @@ -362,6 +381,7 @@ public class GetSearchResultsPart { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -374,6 +394,7 @@ public class GetSearchResultsPart { return this; } + public Builder videoProfile(String videoProfile) { Utils.checkNotNull(videoProfile, "videoProfile"); this.videoProfile = Optional.ofNullable(videoProfile); @@ -385,17 +406,14 @@ public class GetSearchResultsPart { this.videoProfile = videoProfile; return this; } - + public GetSearchResultsPart build() { + return new GetSearchResultsPart( - id, - key, - duration, - file, - size, - audioProfile, - container, - videoProfile); + id, key, duration, + file, size, audioProfile, + container, videoProfile); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequest.java index e0d5d75c..5e8c499a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetSearchResultsRequest { - /** * The search query string to use */ @@ -34,9 +33,10 @@ public class GetSearchResultsRequest { return query; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The search query string to use @@ -47,7 +47,6 @@ public class GetSearchResultsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetSearchResultsRequest { } GetSearchResultsRequest other = (GetSearchResultsRequest) o; return - Objects.deepEquals(this.query, other.query); + Utils.enhancedDeepEquals(this.query, other.query); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( query); } @@ -72,15 +71,17 @@ public class GetSearchResultsRequest { return Utils.toString(GetSearchResultsRequest.class, "query", query); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String query; - + private Builder() { // force use of static builder() method } + /** * The search query string to use */ @@ -89,10 +90,12 @@ public class GetSearchResultsRequest { this.query = query; return this; } - + public GetSearchResultsRequest build() { + return new GetSearchResultsRequest( query); } + } } 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 93870f08..1c1ea66c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetSearchResults; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ import java.lang.String; public class GetSearchResultsRequestBuilder { private String query; - private final SDKMethodInterfaces.MethodCallGetSearchResults sdk; + private final SDKConfiguration sdkConfiguration; - public GetSearchResultsRequestBuilder(SDKMethodInterfaces.MethodCallGetSearchResults sdk) { - this.sdk = sdk; + public GetSearchResultsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetSearchResultsRequestBuilder query(String query) { @@ -22,9 +26,20 @@ public class GetSearchResultsRequestBuilder { return this; } - public GetSearchResultsResponse call() throws Exception { - return sdk.getSearchResults( - query); + private GetSearchResultsRequest buildRequest() { + + GetSearchResultsRequest request = new GetSearchResultsRequest(query); + + return request; + } + + public GetSearchResultsResponse call() throws Exception { + + RequestOperation operation + = new GetSearchResults.Sync(sdkConfiguration); + GetSearchResultsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsResponse.java index 0836f584..4aba0e90 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetSearchResultsResponse implements Response { +public class GetSearchResultsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetSearchResultsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetSearchResultsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetSearchResultsResponse implements Response { return this; } + /** * Search Results */ @@ -143,7 +145,6 @@ public class GetSearchResultsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetSearchResultsResponse implements Response { } GetSearchResultsResponse other = (GetSearchResultsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetSearchResultsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetSearchResultsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetSearchResultsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetSearchResultsResponse implements Response { return this; } + /** * Search Results */ @@ -236,13 +240,13 @@ public class GetSearchResultsResponse implements Response { this.object = object; return this; } - + public GetSearchResultsResponse build() { + return new GetSearchResultsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsResponseBody.java index daf6dd69..8d65a896 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetSearchResultsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsResponseBody withMediaContainer(GetSearchResultsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetSearchResultsResponseBody { return this; } + public GetSearchResultsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetSearchResultsResponseBody { } GetSearchResultsResponseBody other = (GetSearchResultsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetSearchResultsResponseBody { return Utils.toString(GetSearchResultsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetSearchResultsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetSearchResultsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetSearchResultsResponseBody build() { + return new GetSearchResultsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRole.java index 02e1e3e9..4b751719 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsRole.java @@ -11,9 +11,9 @@ 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 GetSearchResultsRole { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetSearchResultsRole { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsRole withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetSearchResultsRole { return this; } + public GetSearchResultsRole withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetSearchResultsRole { } GetSearchResultsRole other = (GetSearchResultsRole) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetSearchResultsRole { return Utils.toString(GetSearchResultsRole.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetSearchResultsRole { this.tag = tag; return this; } - + public GetSearchResultsRole build() { + return new GetSearchResultsRole( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsWriter.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsWriter.java index 88fdd0de..753f6175 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsWriter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSearchResultsWriter.java @@ -11,9 +11,9 @@ 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 GetSearchResultsWriter { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetSearchResultsWriter { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSearchResultsWriter withTag(String tag) { Utils.checkNotNull(tag, "tag"); @@ -46,13 +47,13 @@ public class GetSearchResultsWriter { return this; } + public GetSearchResultsWriter withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetSearchResultsWriter { } GetSearchResultsWriter other = (GetSearchResultsWriter) o; return - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( tag); } @@ -77,15 +78,17 @@ public class GetSearchResultsWriter { return Utils.toString(GetSearchResultsWriter.class, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -97,10 +100,12 @@ public class GetSearchResultsWriter { this.tag = tag; return this; } - + public GetSearchResultsWriter build() { + return new GetSearchResultsWriter( tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesMediaContainer.java index 5594456a..9add6926 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesMediaContainer.java @@ -14,15 +14,16 @@ 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 GetServerActivitiesMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Activity") private Optional> activity; @@ -52,9 +53,10 @@ public class GetServerActivitiesMediaContainer { return (Optional>) activity; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerActivitiesMediaContainer withSize(double size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetServerActivitiesMediaContainer { return this; } + public GetServerActivitiesMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetServerActivitiesMediaContainer { return this; } + public GetServerActivitiesMediaContainer withActivity(Optional> activity) { Utils.checkNotNull(activity, "activity"); this.activity = activity; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetServerActivitiesMediaContainer { } GetServerActivitiesMediaContainer other = (GetServerActivitiesMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.activity, other.activity); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.activity, other.activity); } @Override public int hashCode() { - return Objects.hash( - size, - activity); + return Utils.enhancedHash( + size, activity); } @Override @@ -108,17 +110,19 @@ public class GetServerActivitiesMediaContainer { "size", size, "activity", activity); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> activity = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(double size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetServerActivitiesMediaContainer { return this; } + public Builder activity(List activity) { Utils.checkNotNull(activity, "activity"); this.activity = Optional.ofNullable(activity); @@ -142,11 +147,12 @@ public class GetServerActivitiesMediaContainer { this.activity = activity; return this; } - + public GetServerActivitiesMediaContainer build() { + return new GetServerActivitiesMediaContainer( - size, - activity); + size, activity); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesRequestBuilder.java index 1af360a4..3c625e11 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerActivities; import java.lang.Exception; public class GetServerActivitiesRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetServerActivities sdk; + private final SDKConfiguration sdkConfiguration; - public GetServerActivitiesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerActivities sdk) { - this.sdk = sdk; + public GetServerActivitiesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetServerActivitiesResponse call() throws Exception { + + RequestlessOperation operation + = new GetServerActivities.Sync(sdkConfiguration); - return sdk.getServerActivitiesDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesResponse.java index 9401974c..aca33bfa 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetServerActivitiesResponse implements Response { +public class GetServerActivitiesResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetServerActivitiesResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetServerActivitiesResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetServerActivitiesResponse implements Response { return this; } + /** * The Server Activities */ @@ -143,7 +145,6 @@ public class GetServerActivitiesResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetServerActivitiesResponse implements Response { } GetServerActivitiesResponse other = (GetServerActivitiesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetServerActivitiesResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetServerActivitiesResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetServerActivitiesResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetServerActivitiesResponse implements Response { return this; } + /** * The Server Activities */ @@ -236,13 +240,13 @@ public class GetServerActivitiesResponse implements Response { this.object = object; return this; } - + public GetServerActivitiesResponse build() { + return new GetServerActivitiesResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesResponseBody.java index 58309439..68003eee 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerActivitiesResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetServerActivitiesResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerActivitiesResponseBody withMediaContainer(GetServerActivitiesMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetServerActivitiesResponseBody { return this; } + public GetServerActivitiesResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetServerActivitiesResponseBody { } GetServerActivitiesResponseBody other = (GetServerActivitiesResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetServerActivitiesResponseBody { return Utils.toString(GetServerActivitiesResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetServerActivitiesMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetServerActivitiesResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetServerActivitiesResponseBody build() { + return new GetServerActivitiesResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesRequestBuilder.java index b5252f23..9bd56a7c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerCapabilities; import java.lang.Exception; public class GetServerCapabilitiesRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetServerCapabilities sdk; + private final SDKConfiguration sdkConfiguration; - public GetServerCapabilitiesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerCapabilities sdk) { - this.sdk = sdk; + public GetServerCapabilitiesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetServerCapabilitiesResponse call() throws Exception { + + RequestlessOperation operation + = new GetServerCapabilities.Sync(sdkConfiguration); - return sdk.getServerCapabilitiesDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesResponse.java index 1e6c9725..c89ffad1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetServerCapabilitiesResponse implements Response { +public class GetServerCapabilitiesResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetServerCapabilitiesResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetServerCapabilitiesResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetServerCapabilitiesResponse implements Response { return this; } + /** * The Server Capabilities */ @@ -143,7 +145,6 @@ public class GetServerCapabilitiesResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetServerCapabilitiesResponse implements Response { } GetServerCapabilitiesResponse other = (GetServerCapabilitiesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetServerCapabilitiesResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetServerCapabilitiesResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetServerCapabilitiesResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetServerCapabilitiesResponse implements Response { return this; } + /** * The Server Capabilities */ @@ -236,13 +240,13 @@ public class GetServerCapabilitiesResponse implements Response { this.object = object; return this; } - + public GetServerCapabilitiesResponse build() { + return new GetServerCapabilitiesResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesResponseBody.java index 890ad99d..13f856e1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerCapabilitiesResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetServerCapabilitiesResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerCapabilitiesResponseBody withMediaContainer(MediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetServerCapabilitiesResponseBody { return this; } + public GetServerCapabilitiesResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetServerCapabilitiesResponseBody { } GetServerCapabilitiesResponseBody other = (GetServerCapabilitiesResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetServerCapabilitiesResponseBody { return Utils.toString(GetServerCapabilitiesResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(MediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetServerCapabilitiesResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetServerCapabilitiesResponseBody build() { + return new GetServerCapabilitiesResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityMediaContainer.java index 7f255207..f1fb5be7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityMediaContainer.java @@ -13,23 +13,26 @@ import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetServerIdentityMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("claimed") private Optional claimed; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("machineIdentifier") private Optional machineIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("version") private Optional version; @@ -51,7 +54,8 @@ public class GetServerIdentityMediaContainer { } public GetServerIdentityMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -74,9 +78,10 @@ public class GetServerIdentityMediaContainer { return version; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerIdentityMediaContainer withSize(double size) { Utils.checkNotNull(size, "size"); @@ -84,6 +89,7 @@ public class GetServerIdentityMediaContainer { return this; } + public GetServerIdentityMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -96,6 +102,7 @@ public class GetServerIdentityMediaContainer { return this; } + public GetServerIdentityMediaContainer withClaimed(Optional claimed) { Utils.checkNotNull(claimed, "claimed"); this.claimed = claimed; @@ -108,6 +115,7 @@ public class GetServerIdentityMediaContainer { return this; } + public GetServerIdentityMediaContainer withMachineIdentifier(Optional machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = machineIdentifier; @@ -120,13 +128,13 @@ public class GetServerIdentityMediaContainer { return this; } + public GetServerIdentityMediaContainer withVersion(Optional version) { Utils.checkNotNull(version, "version"); this.version = version; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,18 +145,16 @@ public class GetServerIdentityMediaContainer { } GetServerIdentityMediaContainer other = (GetServerIdentityMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.claimed, other.claimed) && - Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) && - Objects.deepEquals(this.version, other.version); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.claimed, other.claimed) && + Utils.enhancedDeepEquals(this.machineIdentifier, other.machineIdentifier) && + Utils.enhancedDeepEquals(this.version, other.version); } @Override public int hashCode() { - return Objects.hash( - size, - claimed, - machineIdentifier, + return Utils.enhancedHash( + size, claimed, machineIdentifier, version); } @@ -160,21 +166,23 @@ public class GetServerIdentityMediaContainer { "machineIdentifier", machineIdentifier, "version", version); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional claimed = Optional.empty(); - + private Optional machineIdentifier = Optional.empty(); - + private Optional version = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(double size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -187,6 +195,7 @@ public class GetServerIdentityMediaContainer { return this; } + public Builder claimed(boolean claimed) { Utils.checkNotNull(claimed, "claimed"); this.claimed = Optional.ofNullable(claimed); @@ -199,6 +208,7 @@ public class GetServerIdentityMediaContainer { return this; } + public Builder machineIdentifier(String machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = Optional.ofNullable(machineIdentifier); @@ -211,6 +221,7 @@ public class GetServerIdentityMediaContainer { return this; } + public Builder version(String version) { Utils.checkNotNull(version, "version"); this.version = Optional.ofNullable(version); @@ -222,13 +233,13 @@ public class GetServerIdentityMediaContainer { this.version = version; return this; } - + public GetServerIdentityMediaContainer build() { + return new GetServerIdentityMediaContainer( - size, - claimed, - machineIdentifier, + size, claimed, machineIdentifier, version); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityRequestBuilder.java index 2dddd662..9653701f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerIdentity; import java.lang.Exception; public class GetServerIdentityRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetServerIdentity sdk; + private final SDKConfiguration sdkConfiguration; - public GetServerIdentityRequestBuilder(SDKMethodInterfaces.MethodCallGetServerIdentity sdk) { - this.sdk = sdk; + public GetServerIdentityRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetServerIdentityResponse call() throws Exception { + + RequestlessOperation operation + = new GetServerIdentity.Sync(sdkConfiguration); - return sdk.getServerIdentityDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityResponse.java index fe36908a..029928a7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetServerIdentityResponse implements Response { +public class GetServerIdentityResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetServerIdentityResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetServerIdentityResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetServerIdentityResponse implements Response { return this; } + /** * The Server Identity information */ @@ -143,7 +145,6 @@ public class GetServerIdentityResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetServerIdentityResponse implements Response { } GetServerIdentityResponse other = (GetServerIdentityResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetServerIdentityResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetServerIdentityResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetServerIdentityResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetServerIdentityResponse implements Response { return this; } + /** * The Server Identity information */ @@ -236,13 +240,13 @@ public class GetServerIdentityResponse implements Response { this.object = object; return this; } - + public GetServerIdentityResponse build() { + return new GetServerIdentityResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityResponseBody.java index 32ed09ac..9c559e76 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerIdentityResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetServerIdentityResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerIdentityResponseBody withMediaContainer(GetServerIdentityMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetServerIdentityResponseBody { return this; } + public GetServerIdentityResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetServerIdentityResponseBody { } GetServerIdentityResponseBody other = (GetServerIdentityResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetServerIdentityResponseBody { return Utils.toString(GetServerIdentityResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetServerIdentityMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetServerIdentityResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetServerIdentityResponseBody build() { + return new GetServerIdentityResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListMediaContainer.java index c9fc921a..29701eeb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListMediaContainer.java @@ -14,15 +14,16 @@ 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 GetServerListMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Server") private Optional> server; @@ -52,9 +53,10 @@ public class GetServerListMediaContainer { return (Optional>) server; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerListMediaContainer withSize(double size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetServerListMediaContainer { return this; } + public GetServerListMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetServerListMediaContainer { return this; } + public GetServerListMediaContainer withServer(Optional> server) { Utils.checkNotNull(server, "server"); this.server = server; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetServerListMediaContainer { } GetServerListMediaContainer other = (GetServerListMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.server, other.server); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.server, other.server); } @Override public int hashCode() { - return Objects.hash( - size, - server); + return Utils.enhancedHash( + size, server); } @Override @@ -108,17 +110,19 @@ public class GetServerListMediaContainer { "size", size, "server", server); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> server = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(double size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetServerListMediaContainer { return this; } + public Builder server(List server) { Utils.checkNotNull(server, "server"); this.server = Optional.ofNullable(server); @@ -142,11 +147,12 @@ public class GetServerListMediaContainer { this.server = server; return this; } - + public GetServerListMediaContainer build() { + return new GetServerListMediaContainer( - size, - server); + size, server); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListRequestBuilder.java index f43bc7eb..5dec8ee8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerList; import java.lang.Exception; public class GetServerListRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetServerList sdk; + private final SDKConfiguration sdkConfiguration; - public GetServerListRequestBuilder(SDKMethodInterfaces.MethodCallGetServerList sdk) { - this.sdk = sdk; + public GetServerListRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetServerListResponse call() throws Exception { + + RequestlessOperation operation + = new GetServerList.Sync(sdkConfiguration); - return sdk.getServerListDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListResponse.java index 4ae377c6..fb705a2b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetServerListResponse implements Response { +public class GetServerListResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetServerListResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetServerListResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetServerListResponse implements Response { return this; } + /** * List of Servers */ @@ -143,7 +145,6 @@ public class GetServerListResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetServerListResponse implements Response { } GetServerListResponse other = (GetServerListResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetServerListResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetServerListResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetServerListResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetServerListResponse implements Response { return this; } + /** * List of Servers */ @@ -236,13 +240,13 @@ public class GetServerListResponse implements Response { this.object = object; return this; } - + public GetServerListResponse build() { + return new GetServerListResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListResponseBody.java index 54888852..a7faa94c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetServerListResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerListResponseBody withMediaContainer(GetServerListMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetServerListResponseBody { return this; } + public GetServerListResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetServerListResponseBody { } GetServerListResponseBody other = (GetServerListResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetServerListResponseBody { return Utils.toString(GetServerListResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetServerListMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetServerListResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetServerListResponseBody build() { + return new GetServerListResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListServer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListServer.java index e6dc5cac..4499a504 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerListServer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerListServer.java @@ -12,31 +12,36 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetServerListServer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") private Optional name; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("host") private Optional host; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("address") private Optional address; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("port") private Optional port; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("machineIdentifier") private Optional machineIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("version") private Optional version; @@ -64,7 +69,8 @@ public class GetServerListServer { } public GetServerListServer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -97,9 +103,10 @@ public class GetServerListServer { return version; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerListServer withName(String name) { Utils.checkNotNull(name, "name"); @@ -107,6 +114,7 @@ public class GetServerListServer { return this; } + public GetServerListServer withName(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; @@ -119,6 +127,7 @@ public class GetServerListServer { return this; } + public GetServerListServer withHost(Optional host) { Utils.checkNotNull(host, "host"); this.host = host; @@ -131,6 +140,7 @@ public class GetServerListServer { return this; } + public GetServerListServer withAddress(Optional address) { Utils.checkNotNull(address, "address"); this.address = address; @@ -143,6 +153,7 @@ public class GetServerListServer { return this; } + public GetServerListServer withPort(Optional port) { Utils.checkNotNull(port, "port"); this.port = port; @@ -155,6 +166,7 @@ public class GetServerListServer { return this; } + public GetServerListServer withMachineIdentifier(Optional machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = machineIdentifier; @@ -167,13 +179,13 @@ public class GetServerListServer { return this; } + public GetServerListServer withVersion(Optional version) { Utils.checkNotNull(version, "version"); this.version = version; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,23 +196,19 @@ public class GetServerListServer { } GetServerListServer other = (GetServerListServer) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.host, other.host) && - Objects.deepEquals(this.address, other.address) && - Objects.deepEquals(this.port, other.port) && - Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) && - Objects.deepEquals(this.version, other.version); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.host, other.host) && + Utils.enhancedDeepEquals(this.address, other.address) && + Utils.enhancedDeepEquals(this.port, other.port) && + Utils.enhancedDeepEquals(this.machineIdentifier, other.machineIdentifier) && + Utils.enhancedDeepEquals(this.version, other.version); } @Override public int hashCode() { - return Objects.hash( - name, - host, - address, - port, - machineIdentifier, - version); + return Utils.enhancedHash( + name, host, address, + port, machineIdentifier, version); } @Override @@ -213,25 +221,27 @@ public class GetServerListServer { "machineIdentifier", machineIdentifier, "version", version); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional name = Optional.empty(); - + private Optional host = Optional.empty(); - + private Optional address = Optional.empty(); - + private Optional port = Optional.empty(); - + private Optional machineIdentifier = Optional.empty(); - + private Optional version = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); @@ -244,6 +254,7 @@ public class GetServerListServer { return this; } + public Builder host(String host) { Utils.checkNotNull(host, "host"); this.host = Optional.ofNullable(host); @@ -256,6 +267,7 @@ public class GetServerListServer { return this; } + public Builder address(String address) { Utils.checkNotNull(address, "address"); this.address = Optional.ofNullable(address); @@ -268,6 +280,7 @@ public class GetServerListServer { return this; } + public Builder port(double port) { Utils.checkNotNull(port, "port"); this.port = Optional.ofNullable(port); @@ -280,6 +293,7 @@ public class GetServerListServer { return this; } + public Builder machineIdentifier(String machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = Optional.ofNullable(machineIdentifier); @@ -292,6 +306,7 @@ public class GetServerListServer { return this; } + public Builder version(String version) { Utils.checkNotNull(version, "version"); this.version = Optional.ofNullable(version); @@ -303,15 +318,13 @@ public class GetServerListServer { this.version = version; return this; } - + public GetServerListServer build() { + return new GetServerListServer( - name, - host, - address, - port, - machineIdentifier, - version); + name, host, address, + port, machineIdentifier, version); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesMediaContainer.java index 586ae9a9..9de4bf8c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesMediaContainer.java @@ -14,15 +14,16 @@ 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 GetServerPreferencesMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Setting") private Optional> setting; @@ -52,9 +53,10 @@ public class GetServerPreferencesMediaContainer { return (Optional>) setting; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerPreferencesMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetServerPreferencesMediaContainer { return this; } + public GetServerPreferencesMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetServerPreferencesMediaContainer { return this; } + public GetServerPreferencesMediaContainer withSetting(Optional> setting) { Utils.checkNotNull(setting, "setting"); this.setting = setting; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetServerPreferencesMediaContainer { } GetServerPreferencesMediaContainer other = (GetServerPreferencesMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.setting, other.setting); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.setting, other.setting); } @Override public int hashCode() { - return Objects.hash( - size, - setting); + return Utils.enhancedHash( + size, setting); } @Override @@ -108,17 +110,19 @@ public class GetServerPreferencesMediaContainer { "size", size, "setting", setting); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> setting = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetServerPreferencesMediaContainer { return this; } + public Builder setting(List setting) { Utils.checkNotNull(setting, "setting"); this.setting = Optional.ofNullable(setting); @@ -142,11 +147,12 @@ public class GetServerPreferencesMediaContainer { this.setting = setting; return this; } - + public GetServerPreferencesMediaContainer build() { + return new GetServerPreferencesMediaContainer( - size, - setting); + size, setting); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesRequestBuilder.java index 75a2929a..d696239e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerPreferences; import java.lang.Exception; public class GetServerPreferencesRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetServerPreferences sdk; + private final SDKConfiguration sdkConfiguration; - public GetServerPreferencesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerPreferences sdk) { - this.sdk = sdk; + public GetServerPreferencesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetServerPreferencesResponse call() throws Exception { + + RequestlessOperation operation + = new GetServerPreferences.Sync(sdkConfiguration); - return sdk.getServerPreferencesDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesResponse.java index 6ff0348c..96863b4e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetServerPreferencesResponse implements Response { +public class GetServerPreferencesResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetServerPreferencesResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetServerPreferencesResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetServerPreferencesResponse implements Response { return this; } + /** * Server Preferences */ @@ -143,7 +145,6 @@ public class GetServerPreferencesResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetServerPreferencesResponse implements Response { } GetServerPreferencesResponse other = (GetServerPreferencesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetServerPreferencesResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetServerPreferencesResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetServerPreferencesResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetServerPreferencesResponse implements Response { return this; } + /** * Server Preferences */ @@ -236,13 +240,13 @@ public class GetServerPreferencesResponse implements Response { this.object = object; return this; } - + public GetServerPreferencesResponse build() { + return new GetServerPreferencesResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesResponseBody.java index ff1c913a..6e68be18 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerPreferencesResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetServerPreferencesResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetServerPreferencesResponseBody withMediaContainer(GetServerPreferencesMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetServerPreferencesResponseBody { return this; } + public GetServerPreferencesResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetServerPreferencesResponseBody { } GetServerPreferencesResponseBody other = (GetServerPreferencesResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetServerPreferencesResponseBody { return Utils.toString(GetServerPreferencesResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetServerPreferencesMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetServerPreferencesResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetServerPreferencesResponseBody build() { + return new GetServerPreferencesResponseBody( mediaContainer); } + } } 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 32359c7a..6029dd35 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequest.java @@ -12,11 +12,10 @@ 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 GetServerResourcesRequest { +public class GetServerResourcesRequest { /** * Include Https entries in the results */ @@ -60,7 +59,8 @@ public class GetServerResourcesRequest { public GetServerResourcesRequest( String clientID) { - this(Optional.empty(), Optional.empty(), Optional.empty(), clientID); + this(Optional.empty(), Optional.empty(), Optional.empty(), + clientID); } /** @@ -99,9 +99,10 @@ public class GetServerResourcesRequest { return clientID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Include Https entries in the results @@ -112,6 +113,7 @@ public class GetServerResourcesRequest { return this; } + /** * Include Https entries in the results */ @@ -131,6 +133,7 @@ public class GetServerResourcesRequest { return this; } + /** * Include Relay addresses in the results * E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 @@ -150,6 +153,7 @@ public class GetServerResourcesRequest { return this; } + /** * Include IPv6 entries in the results */ @@ -168,7 +172,6 @@ public class GetServerResourcesRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -179,18 +182,16 @@ public class GetServerResourcesRequest { } GetServerResourcesRequest other = (GetServerResourcesRequest) o; return - Objects.deepEquals(this.includeHttps, other.includeHttps) && - Objects.deepEquals(this.includeRelay, other.includeRelay) && - Objects.deepEquals(this.includeIPv6, other.includeIPv6) && - Objects.deepEquals(this.clientID, other.clientID); + Utils.enhancedDeepEquals(this.includeHttps, other.includeHttps) && + Utils.enhancedDeepEquals(this.includeRelay, other.includeRelay) && + Utils.enhancedDeepEquals(this.includeIPv6, other.includeIPv6) && + Utils.enhancedDeepEquals(this.clientID, other.clientID); } @Override public int hashCode() { - return Objects.hash( - includeHttps, - includeRelay, - includeIPv6, + return Utils.enhancedHash( + includeHttps, includeRelay, includeIPv6, clientID); } @@ -202,21 +203,23 @@ public class GetServerResourcesRequest { "includeIPv6", includeIPv6, "clientID", clientID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional includeHttps; - + private Optional includeRelay; - + private Optional includeIPv6; - + private String clientID; - + private Builder() { // force use of static builder() method } + /** * Include Https entries in the results */ @@ -235,6 +238,7 @@ public class GetServerResourcesRequest { return this; } + /** * Include Relay addresses in the results * E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400 @@ -255,6 +259,7 @@ public class GetServerResourcesRequest { return this; } + /** * Include IPv6 entries in the results */ @@ -273,6 +278,7 @@ public class GetServerResourcesRequest { return this; } + /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @@ -281,7 +287,7 @@ public class GetServerResourcesRequest { this.clientID = clientID; return this; } - + public GetServerResourcesRequest build() { if (includeHttps == null) { includeHttps = _SINGLETON_VALUE_IncludeHttps.value(); @@ -292,13 +298,13 @@ public class GetServerResourcesRequest { if (includeIPv6 == null) { includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value(); } + return new GetServerResourcesRequest( - includeHttps, - includeRelay, - includeIPv6, + includeHttps, includeRelay, includeIPv6, clientID); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeHttps = new LazySingletonValue<>( "includeHttps", 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 032967e8..fec7f415 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesRequestBuilder.java @@ -3,7 +3,11 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerResources; import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; @@ -26,10 +30,10 @@ public class GetServerResourcesRequestBuilder { new TypeReference>() {}); private String clientID; private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetServerResources sdk; + private final SDKConfiguration sdkConfiguration; - public GetServerResourcesRequestBuilder(SDKMethodInterfaces.MethodCallGetServerResources sdk) { - this.sdk = sdk; + public GetServerResourcesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetServerResourcesRequestBuilder includeHttps(IncludeHttps includeHttps) { @@ -86,7 +90,8 @@ public class GetServerResourcesRequestBuilder { return this; } - public GetServerResourcesResponse call() throws Exception { + + private GetServerResourcesRequest buildRequest() { if (includeHttps == null) { includeHttps = _SINGLETON_VALUE_IncludeHttps.value(); } @@ -96,12 +101,22 @@ public class GetServerResourcesRequestBuilder { if (includeIPv6 == null) { includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value(); } - return sdk.getServerResources( - includeHttps, + + GetServerResourcesRequest request = new GetServerResourcesRequest(includeHttps, includeRelay, includeIPv6, - clientID, - serverURL); + clientID); + + return request; + } + + public GetServerResourcesResponse call() throws Exception { + + RequestOperation operation + = new GetServerResources.Sync(sdkConfiguration, serverURL); + GetServerResourcesRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } private static final LazySingletonValue> _SINGLETON_VALUE_IncludeHttps = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesResponse.java index 443c61b7..4c961f17 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetServerResourcesResponse.java @@ -14,11 +14,10 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; -public class GetServerResourcesResponse implements Response { +public class GetServerResourcesResponse implements Response { /** * HTTP response content type for this operation */ @@ -59,7 +58,8 @@ public class GetServerResourcesResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -95,9 +95,10 @@ public class GetServerResourcesResponse implements Response { return (Optional>) plexDevices; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -135,6 +136,7 @@ public class GetServerResourcesResponse implements Response { return this; } + /** * List of Plex Devices. This includes Plex hosted servers and clients */ @@ -144,7 +146,6 @@ public class GetServerResourcesResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -155,18 +156,16 @@ public class GetServerResourcesResponse implements Response { } GetServerResourcesResponse other = (GetServerResourcesResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.plexDevices, other.plexDevices); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.plexDevices, other.plexDevices); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, plexDevices); } @@ -178,21 +177,23 @@ public class GetServerResourcesResponse implements Response { "rawResponse", rawResponse, "plexDevices", plexDevices); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional> plexDevices = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -202,6 +203,7 @@ public class GetServerResourcesResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -211,6 +213,7 @@ public class GetServerResourcesResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -220,6 +223,7 @@ public class GetServerResourcesResponse implements Response { return this; } + /** * List of Plex Devices. This includes Plex hosted servers and clients */ @@ -237,13 +241,13 @@ public class GetServerResourcesResponse implements Response { this.plexDevices = plexDevices; return this; } - + public GetServerResourcesResponse build() { + return new GetServerResourcesResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, plexDevices); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryMediaContainer.java index 1626e59f..3639765c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryMediaContainer.java @@ -14,15 +14,16 @@ 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 GetSessionHistoryMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -52,9 +53,10 @@ public class GetSessionHistoryMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionHistoryMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetSessionHistoryMediaContainer { return this; } + public GetSessionHistoryMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetSessionHistoryMediaContainer { return this; } + public GetSessionHistoryMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetSessionHistoryMediaContainer { } GetSessionHistoryMediaContainer other = (GetSessionHistoryMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - metadata); + return Utils.enhancedHash( + size, metadata); } @Override @@ -108,17 +110,19 @@ public class GetSessionHistoryMediaContainer { "size", size, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetSessionHistoryMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -142,11 +147,12 @@ public class GetSessionHistoryMediaContainer { this.metadata = metadata; return this; } - + public GetSessionHistoryMediaContainer build() { + return new GetSessionHistoryMediaContainer( - size, - metadata); + size, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryMetadata.java index 64563e64..b1240424 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryMetadata.java @@ -13,83 +13,101 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.time.LocalDate; -import java.util.Objects; import java.util.Optional; + public class GetSessionHistoryMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("historyKey") private Optional historyKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentKey") private Optional parentKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentKey") private Optional grandparentKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentTitle") private Optional grandparentTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentThumb") private Optional parentThumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentThumb") private Optional grandparentThumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentArt") private Optional grandparentArt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("index") private Optional index; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentIndex") private Optional parentIndex; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewedAt") private Optional viewedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("accountID") private Optional accountID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("deviceID") private Optional deviceID; @@ -156,7 +174,13 @@ public class GetSessionHistoryMetadata { } public GetSessionHistoryMetadata() { - 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()); + 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()); } @JsonIgnore @@ -254,9 +278,10 @@ public class GetSessionHistoryMetadata { return deviceID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionHistoryMetadata withHistoryKey(String historyKey) { Utils.checkNotNull(historyKey, "historyKey"); @@ -264,6 +289,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withHistoryKey(Optional historyKey) { Utils.checkNotNull(historyKey, "historyKey"); this.historyKey = historyKey; @@ -276,6 +302,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -288,6 +315,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -300,6 +328,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -312,6 +341,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withParentKey(Optional parentKey) { Utils.checkNotNull(parentKey, "parentKey"); this.parentKey = parentKey; @@ -324,6 +354,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withGrandparentKey(Optional grandparentKey) { Utils.checkNotNull(grandparentKey, "grandparentKey"); this.grandparentKey = grandparentKey; @@ -336,6 +367,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -348,6 +380,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withGrandparentTitle(Optional grandparentTitle) { Utils.checkNotNull(grandparentTitle, "grandparentTitle"); this.grandparentTitle = grandparentTitle; @@ -360,6 +393,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -372,6 +406,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -384,6 +419,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withParentThumb(Optional parentThumb) { Utils.checkNotNull(parentThumb, "parentThumb"); this.parentThumb = parentThumb; @@ -396,6 +432,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withGrandparentThumb(Optional grandparentThumb) { Utils.checkNotNull(grandparentThumb, "grandparentThumb"); this.grandparentThumb = grandparentThumb; @@ -408,6 +445,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withGrandparentArt(Optional grandparentArt) { Utils.checkNotNull(grandparentArt, "grandparentArt"); this.grandparentArt = grandparentArt; @@ -420,6 +458,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withIndex(Optional index) { Utils.checkNotNull(index, "index"); this.index = index; @@ -432,6 +471,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withParentIndex(Optional parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = parentIndex; @@ -444,6 +484,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = originallyAvailableAt; @@ -456,6 +497,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withViewedAt(Optional viewedAt) { Utils.checkNotNull(viewedAt, "viewedAt"); this.viewedAt = viewedAt; @@ -468,6 +510,7 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withAccountID(Optional accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = accountID; @@ -480,13 +523,13 @@ public class GetSessionHistoryMetadata { return this; } + public GetSessionHistoryMetadata withDeviceID(Optional deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = deviceID; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -497,48 +540,36 @@ public class GetSessionHistoryMetadata { } GetSessionHistoryMetadata other = (GetSessionHistoryMetadata) o; return - Objects.deepEquals(this.historyKey, other.historyKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.grandparentKey, other.grandparentKey) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.grandparentThumb, other.grandparentThumb) && - Objects.deepEquals(this.grandparentArt, other.grandparentArt) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.viewedAt, other.viewedAt) && - Objects.deepEquals(this.accountID, other.accountID) && - Objects.deepEquals(this.deviceID, other.deviceID); + Utils.enhancedDeepEquals(this.historyKey, other.historyKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.grandparentKey, other.grandparentKey) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.grandparentTitle, other.grandparentTitle) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.grandparentThumb, other.grandparentThumb) && + Utils.enhancedDeepEquals(this.grandparentArt, other.grandparentArt) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.viewedAt, other.viewedAt) && + Utils.enhancedDeepEquals(this.accountID, other.accountID) && + Utils.enhancedDeepEquals(this.deviceID, other.deviceID); } @Override public int hashCode() { - return Objects.hash( - historyKey, - key, - ratingKey, - librarySectionID, - parentKey, - grandparentKey, - title, - grandparentTitle, - type, - thumb, - parentThumb, - grandparentThumb, - grandparentArt, - index, - parentIndex, - originallyAvailableAt, - viewedAt, - accountID, + return Utils.enhancedHash( + historyKey, key, ratingKey, + librarySectionID, parentKey, grandparentKey, + title, grandparentTitle, type, + thumb, parentThumb, grandparentThumb, + grandparentArt, index, parentIndex, + originallyAvailableAt, viewedAt, accountID, deviceID); } @@ -565,51 +596,53 @@ public class GetSessionHistoryMetadata { "accountID", accountID, "deviceID", deviceID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional historyKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional ratingKey = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional grandparentKey = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional grandparentTitle = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional parentThumb = Optional.empty(); - + private Optional grandparentThumb = Optional.empty(); - + private Optional grandparentArt = Optional.empty(); - + private Optional index = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional originallyAvailableAt = Optional.empty(); - + private Optional viewedAt = Optional.empty(); - + private Optional accountID = Optional.empty(); - + private Optional deviceID = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder historyKey(String historyKey) { Utils.checkNotNull(historyKey, "historyKey"); this.historyKey = Optional.ofNullable(historyKey); @@ -622,6 +655,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -634,6 +668,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -646,6 +681,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder librarySectionID(String librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -658,6 +694,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder parentKey(String parentKey) { Utils.checkNotNull(parentKey, "parentKey"); this.parentKey = Optional.ofNullable(parentKey); @@ -670,6 +707,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder grandparentKey(String grandparentKey) { Utils.checkNotNull(grandparentKey, "grandparentKey"); this.grandparentKey = Optional.ofNullable(grandparentKey); @@ -682,6 +720,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -694,6 +733,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder grandparentTitle(String grandparentTitle) { Utils.checkNotNull(grandparentTitle, "grandparentTitle"); this.grandparentTitle = Optional.ofNullable(grandparentTitle); @@ -706,6 +746,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -718,6 +759,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -730,6 +772,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder parentThumb(String parentThumb) { Utils.checkNotNull(parentThumb, "parentThumb"); this.parentThumb = Optional.ofNullable(parentThumb); @@ -742,6 +785,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder grandparentThumb(String grandparentThumb) { Utils.checkNotNull(grandparentThumb, "grandparentThumb"); this.grandparentThumb = Optional.ofNullable(grandparentThumb); @@ -754,6 +798,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder grandparentArt(String grandparentArt) { Utils.checkNotNull(grandparentArt, "grandparentArt"); this.grandparentArt = Optional.ofNullable(grandparentArt); @@ -766,6 +811,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder index(int index) { Utils.checkNotNull(index, "index"); this.index = Optional.ofNullable(index); @@ -778,6 +824,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder parentIndex(int parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = Optional.ofNullable(parentIndex); @@ -790,6 +837,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder originallyAvailableAt(LocalDate originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); @@ -802,6 +850,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder viewedAt(int viewedAt) { Utils.checkNotNull(viewedAt, "viewedAt"); this.viewedAt = Optional.ofNullable(viewedAt); @@ -814,6 +863,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder accountID(int accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = Optional.ofNullable(accountID); @@ -826,6 +876,7 @@ public class GetSessionHistoryMetadata { return this; } + public Builder deviceID(int deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = Optional.ofNullable(deviceID); @@ -837,28 +888,18 @@ public class GetSessionHistoryMetadata { this.deviceID = deviceID; return this; } - + public GetSessionHistoryMetadata build() { + return new GetSessionHistoryMetadata( - historyKey, - key, - ratingKey, - librarySectionID, - parentKey, - grandparentKey, - title, - grandparentTitle, - type, - thumb, - parentThumb, - grandparentThumb, - grandparentArt, - index, - parentIndex, - originallyAvailableAt, - viewedAt, - accountID, + historyKey, key, ratingKey, + librarySectionID, parentKey, grandparentKey, + title, grandparentTitle, type, + thumb, parentThumb, grandparentThumb, + grandparentArt, index, parentIndex, + originallyAvailableAt, viewedAt, accountID, deviceID); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequest.java index ee252362..ed94c8da 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequest.java @@ -11,11 +11,10 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetSessionHistoryRequest { +public class GetSessionHistoryRequest { /** * Sorts the results by the specified field followed by the direction (asc, desc) */ @@ -58,7 +57,8 @@ public class GetSessionHistoryRequest { } public GetSessionHistoryRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -95,9 +95,10 @@ public class GetSessionHistoryRequest { return librarySectionID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Sorts the results by the specified field followed by the direction (asc, desc) @@ -108,6 +109,7 @@ public class GetSessionHistoryRequest { return this; } + /** * Sorts the results by the specified field followed by the direction (asc, desc) */ @@ -126,6 +128,7 @@ public class GetSessionHistoryRequest { return this; } + /** * Filter results by those that are related to a specific users id */ @@ -145,6 +148,7 @@ public class GetSessionHistoryRequest { return this; } + /** * Filters content by field and direction/equality * (Unknown if viewedAt is the only supported column) @@ -164,6 +168,7 @@ public class GetSessionHistoryRequest { return this; } + /** * Filters the results based on the id of a valid library section */ @@ -173,7 +178,6 @@ public class GetSessionHistoryRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,18 +188,16 @@ public class GetSessionHistoryRequest { } GetSessionHistoryRequest other = (GetSessionHistoryRequest) o; return - Objects.deepEquals(this.sort, other.sort) && - Objects.deepEquals(this.accountId, other.accountId) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID); + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.accountId, other.accountId) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID); } @Override public int hashCode() { - return Objects.hash( - sort, - accountId, - filter, + return Utils.enhancedHash( + sort, accountId, filter, librarySectionID); } @@ -207,21 +209,23 @@ public class GetSessionHistoryRequest { "filter", filter, "librarySectionID", librarySectionID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional sort = Optional.empty(); - + private Optional accountId = Optional.empty(); - + private Optional filter = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Sorts the results by the specified field followed by the direction (asc, desc) */ @@ -240,6 +244,7 @@ public class GetSessionHistoryRequest { return this; } + /** * Filter results by those that are related to a specific users id */ @@ -258,6 +263,7 @@ public class GetSessionHistoryRequest { return this; } + /** * Filters content by field and direction/equality * (Unknown if viewedAt is the only supported column) @@ -278,6 +284,7 @@ public class GetSessionHistoryRequest { return this; } + /** * Filters the results based on the id of a valid library section */ @@ -295,13 +302,13 @@ public class GetSessionHistoryRequest { this.librarySectionID = librarySectionID; return this; } - + public GetSessionHistoryRequest build() { + return new GetSessionHistoryRequest( - sort, - accountId, - filter, + sort, accountId, filter, librarySectionID); } + } } 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 3bb622d1..8f1e1def 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetSessionHistory; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -15,10 +19,10 @@ public class GetSessionHistoryRequestBuilder { private Optional accountId = Optional.empty(); private Optional filter = Optional.empty(); private Optional librarySectionID = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetSessionHistory sdk; + private final SDKConfiguration sdkConfiguration; - public GetSessionHistoryRequestBuilder(SDKMethodInterfaces.MethodCallGetSessionHistory sdk) { - this.sdk = sdk; + public GetSessionHistoryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetSessionHistoryRequestBuilder sort(String sort) { @@ -69,12 +73,23 @@ public class GetSessionHistoryRequestBuilder { return this; } - public GetSessionHistoryResponse call() throws Exception { - return sdk.getSessionHistory( - sort, + private GetSessionHistoryRequest buildRequest() { + + GetSessionHistoryRequest request = new GetSessionHistoryRequest(sort, accountId, filter, librarySectionID); + + return request; + } + + public GetSessionHistoryResponse call() throws Exception { + + RequestOperation operation + = new GetSessionHistory.Sync(sdkConfiguration); + GetSessionHistoryRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryResponse.java index 3f6b65f5..27beafaf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetSessionHistoryResponse implements Response { +public class GetSessionHistoryResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetSessionHistoryResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetSessionHistoryResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetSessionHistoryResponse implements Response { return this; } + /** * List of Plex Sessions */ @@ -143,7 +145,6 @@ public class GetSessionHistoryResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetSessionHistoryResponse implements Response { } GetSessionHistoryResponse other = (GetSessionHistoryResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetSessionHistoryResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetSessionHistoryResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetSessionHistoryResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetSessionHistoryResponse implements Response { return this; } + /** * List of Plex Sessions */ @@ -236,13 +240,13 @@ public class GetSessionHistoryResponse implements Response { this.object = object; return this; } - + public GetSessionHistoryResponse build() { + return new GetSessionHistoryResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryResponseBody.java index 067fbd82..db9d3838 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionHistoryResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetSessionHistoryResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionHistoryResponseBody withMediaContainer(GetSessionHistoryMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetSessionHistoryResponseBody { return this; } + public GetSessionHistoryResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetSessionHistoryResponseBody { } GetSessionHistoryResponseBody other = (GetSessionHistoryResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetSessionHistoryResponseBody { return Utils.toString(GetSessionHistoryResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetSessionHistoryMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetSessionHistoryResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetSessionHistoryResponseBody build() { + return new GetSessionHistoryResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMedia.java index 45d10943..74818cbf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMedia.java @@ -15,39 +15,46 @@ 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 GetSessionsMedia { @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") private Optional audioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") private Optional bitrate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("selected") private Optional selected; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Part") private Optional> part; @@ -81,7 +88,9 @@ public class GetSessionsMedia { } public GetSessionsMedia() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -125,9 +134,10 @@ public class GetSessionsMedia { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsMedia withAudioChannels(int audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); @@ -135,6 +145,7 @@ public class GetSessionsMedia { return this; } + public GetSessionsMedia withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; @@ -147,6 +158,7 @@ public class GetSessionsMedia { return this; } + public GetSessionsMedia withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; @@ -159,6 +171,7 @@ public class GetSessionsMedia { return this; } + public GetSessionsMedia withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; @@ -171,6 +184,7 @@ public class GetSessionsMedia { return this; } + public GetSessionsMedia withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -183,6 +197,7 @@ public class GetSessionsMedia { return this; } + public GetSessionsMedia withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -195,6 +210,7 @@ public class GetSessionsMedia { return this; } + public GetSessionsMedia withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -207,6 +223,7 @@ public class GetSessionsMedia { return this; } + public GetSessionsMedia withSelected(Optional selected) { Utils.checkNotNull(selected, "selected"); this.selected = selected; @@ -219,13 +236,13 @@ public class GetSessionsMedia { return this; } + public GetSessionsMedia withPart(Optional> part) { Utils.checkNotNull(part, "part"); this.part = part; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -236,27 +253,22 @@ public class GetSessionsMedia { } GetSessionsMedia other = (GetSessionsMedia) o; return - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.selected, other.selected) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.selected, other.selected) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - audioChannels, - audioCodec, - bitrate, - container, - duration, - id, - selected, - part); + return Utils.enhancedHash( + audioChannels, audioCodec, bitrate, + container, duration, id, + selected, part); } @Override @@ -271,29 +283,31 @@ public class GetSessionsMedia { "selected", selected, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional audioChannels = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional id = Optional.empty(); - + private Optional selected = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder audioChannels(int audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = Optional.ofNullable(audioChannels); @@ -306,6 +320,7 @@ public class GetSessionsMedia { return this; } + public Builder audioCodec(String audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = Optional.ofNullable(audioCodec); @@ -318,6 +333,7 @@ public class GetSessionsMedia { return this; } + public Builder bitrate(int bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = Optional.ofNullable(bitrate); @@ -330,6 +346,7 @@ public class GetSessionsMedia { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -342,6 +359,7 @@ public class GetSessionsMedia { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -354,6 +372,7 @@ public class GetSessionsMedia { return this; } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -366,6 +385,7 @@ public class GetSessionsMedia { return this; } + public Builder selected(boolean selected) { Utils.checkNotNull(selected, "selected"); this.selected = Optional.ofNullable(selected); @@ -378,6 +398,7 @@ public class GetSessionsMedia { return this; } + public Builder part(List part) { Utils.checkNotNull(part, "part"); this.part = Optional.ofNullable(part); @@ -389,17 +410,14 @@ public class GetSessionsMedia { this.part = part; return this; } - + public GetSessionsMedia build() { + return new GetSessionsMedia( - audioChannels, - audioCodec, - bitrate, - container, - duration, - id, - selected, - part); + audioChannels, audioCodec, bitrate, + container, duration, id, + selected, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMediaContainer.java index 3c0d8a03..60d2ab57 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMediaContainer.java @@ -14,15 +14,16 @@ 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 GetSessionsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -52,9 +53,10 @@ public class GetSessionsMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetSessionsMediaContainer { return this; } + public GetSessionsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetSessionsMediaContainer { return this; } + public GetSessionsMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetSessionsMediaContainer { } GetSessionsMediaContainer other = (GetSessionsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - metadata); + return Utils.enhancedHash( + size, metadata); } @Override @@ -108,17 +110,19 @@ public class GetSessionsMediaContainer { "size", size, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetSessionsMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -142,11 +147,12 @@ public class GetSessionsMediaContainer { this.metadata = metadata; return this; } - + public GetSessionsMediaContainer build() { + return new GetSessionsMediaContainer( - size, - metadata); + size, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMetadata.java index b8188a30..c987f4a2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsMetadata.java @@ -14,71 +14,86 @@ 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 GetSessionsMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentArt") private Optional grandparentArt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentGuid") private Optional grandparentGuid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentKey") private Optional grandparentKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentRatingKey") private Optional grandparentRatingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentThumb") private Optional grandparentThumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("grandparentTitle") private Optional grandparentTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("index") private Optional index; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionKey") private Optional librarySectionKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("musicAnalysisVersion") private Optional musicAnalysisVersion; @@ -90,86 +105,107 @@ public class GetSessionsMetadata { @JsonProperty("originalTitle") private Optional originalTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentGuid") private Optional parentGuid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentIndex") private Optional parentIndex; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentKey") private Optional parentKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentRatingKey") private Optional parentRatingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentStudio") private Optional parentStudio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentThumb") private Optional parentThumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentTitle") private Optional parentTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("parentYear") private Optional parentYear; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingCount") private Optional ratingCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("sessionKey") private Optional sessionKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("titleSort") private Optional titleSort; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewOffset") private Optional viewOffset; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Media") private Optional> media; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("User") private Optional user; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Player") private Optional player; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Session") private Optional session; @@ -293,7 +329,19 @@ public class GetSessionsMetadata { } public GetSessionsMetadata() { - 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()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -493,9 +541,10 @@ public class GetSessionsMetadata { return (Optional) session; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsMetadata withAddedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); @@ -503,6 +552,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -515,6 +565,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -527,6 +578,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -539,6 +591,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withGrandparentArt(Optional grandparentArt) { Utils.checkNotNull(grandparentArt, "grandparentArt"); this.grandparentArt = grandparentArt; @@ -551,6 +604,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withGrandparentGuid(Optional grandparentGuid) { Utils.checkNotNull(grandparentGuid, "grandparentGuid"); this.grandparentGuid = grandparentGuid; @@ -563,6 +617,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withGrandparentKey(Optional grandparentKey) { Utils.checkNotNull(grandparentKey, "grandparentKey"); this.grandparentKey = grandparentKey; @@ -575,6 +630,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withGrandparentRatingKey(Optional grandparentRatingKey) { Utils.checkNotNull(grandparentRatingKey, "grandparentRatingKey"); this.grandparentRatingKey = grandparentRatingKey; @@ -587,6 +643,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withGrandparentThumb(Optional grandparentThumb) { Utils.checkNotNull(grandparentThumb, "grandparentThumb"); this.grandparentThumb = grandparentThumb; @@ -599,6 +656,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withGrandparentTitle(Optional grandparentTitle) { Utils.checkNotNull(grandparentTitle, "grandparentTitle"); this.grandparentTitle = grandparentTitle; @@ -611,6 +669,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -623,6 +682,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withIndex(Optional index) { Utils.checkNotNull(index, "index"); this.index = index; @@ -635,6 +695,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -647,6 +708,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -659,6 +721,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withLibrarySectionKey(Optional librarySectionKey) { Utils.checkNotNull(librarySectionKey, "librarySectionKey"); this.librarySectionKey = librarySectionKey; @@ -671,6 +734,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -683,6 +747,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withMusicAnalysisVersion(Optional musicAnalysisVersion) { Utils.checkNotNull(musicAnalysisVersion, "musicAnalysisVersion"); this.musicAnalysisVersion = musicAnalysisVersion; @@ -698,6 +763,7 @@ public class GetSessionsMetadata { return this; } + /** * The original untranslated name of the media item when non-english, or the track artist if an audio Item has an album artist */ @@ -713,6 +779,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withParentGuid(Optional parentGuid) { Utils.checkNotNull(parentGuid, "parentGuid"); this.parentGuid = parentGuid; @@ -725,6 +792,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withParentIndex(Optional parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = parentIndex; @@ -737,6 +805,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withParentKey(Optional parentKey) { Utils.checkNotNull(parentKey, "parentKey"); this.parentKey = parentKey; @@ -749,6 +818,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withParentRatingKey(Optional parentRatingKey) { Utils.checkNotNull(parentRatingKey, "parentRatingKey"); this.parentRatingKey = parentRatingKey; @@ -761,6 +831,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withParentStudio(Optional parentStudio) { Utils.checkNotNull(parentStudio, "parentStudio"); this.parentStudio = parentStudio; @@ -773,6 +844,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withParentThumb(Optional parentThumb) { Utils.checkNotNull(parentThumb, "parentThumb"); this.parentThumb = parentThumb; @@ -785,6 +857,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withParentTitle(Optional parentTitle) { Utils.checkNotNull(parentTitle, "parentTitle"); this.parentTitle = parentTitle; @@ -797,6 +870,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withParentYear(Optional parentYear) { Utils.checkNotNull(parentYear, "parentYear"); this.parentYear = parentYear; @@ -809,6 +883,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withRatingCount(Optional ratingCount) { Utils.checkNotNull(ratingCount, "ratingCount"); this.ratingCount = ratingCount; @@ -821,6 +896,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -833,6 +909,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withSessionKey(Optional sessionKey) { Utils.checkNotNull(sessionKey, "sessionKey"); this.sessionKey = sessionKey; @@ -845,6 +922,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -857,6 +935,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -869,6 +948,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withTitleSort(Optional titleSort) { Utils.checkNotNull(titleSort, "titleSort"); this.titleSort = titleSort; @@ -881,6 +961,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -893,6 +974,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -905,6 +987,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withViewOffset(Optional viewOffset) { Utils.checkNotNull(viewOffset, "viewOffset"); this.viewOffset = viewOffset; @@ -917,6 +1000,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withMedia(Optional> media) { Utils.checkNotNull(media, "media"); this.media = media; @@ -929,6 +1013,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withUser(Optional user) { Utils.checkNotNull(user, "user"); this.user = user; @@ -941,6 +1026,7 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withPlayer(Optional player) { Utils.checkNotNull(player, "player"); this.player = player; @@ -953,13 +1039,13 @@ public class GetSessionsMetadata { return this; } + public GetSessionsMetadata withSession(Optional session) { Utils.checkNotNull(session, "session"); this.session = session; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -970,87 +1056,62 @@ public class GetSessionsMetadata { } GetSessionsMetadata other = (GetSessionsMetadata) o; return - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.grandparentArt, other.grandparentArt) && - Objects.deepEquals(this.grandparentGuid, other.grandparentGuid) && - Objects.deepEquals(this.grandparentKey, other.grandparentKey) && - Objects.deepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && - Objects.deepEquals(this.grandparentThumb, other.grandparentThumb) && - Objects.deepEquals(this.grandparentTitle, other.grandparentTitle) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.musicAnalysisVersion, other.musicAnalysisVersion) && - Objects.deepEquals(this.originalTitle, other.originalTitle) && - Objects.deepEquals(this.parentGuid, other.parentGuid) && - Objects.deepEquals(this.parentIndex, other.parentIndex) && - Objects.deepEquals(this.parentKey, other.parentKey) && - Objects.deepEquals(this.parentRatingKey, other.parentRatingKey) && - Objects.deepEquals(this.parentStudio, other.parentStudio) && - Objects.deepEquals(this.parentThumb, other.parentThumb) && - Objects.deepEquals(this.parentTitle, other.parentTitle) && - Objects.deepEquals(this.parentYear, other.parentYear) && - Objects.deepEquals(this.ratingCount, other.ratingCount) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.sessionKey, other.sessionKey) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.titleSort, other.titleSort) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.viewOffset, other.viewOffset) && - Objects.deepEquals(this.media, other.media) && - Objects.deepEquals(this.user, other.user) && - Objects.deepEquals(this.player, other.player) && - Objects.deepEquals(this.session, other.session); + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.grandparentArt, other.grandparentArt) && + Utils.enhancedDeepEquals(this.grandparentGuid, other.grandparentGuid) && + Utils.enhancedDeepEquals(this.grandparentKey, other.grandparentKey) && + Utils.enhancedDeepEquals(this.grandparentRatingKey, other.grandparentRatingKey) && + Utils.enhancedDeepEquals(this.grandparentThumb, other.grandparentThumb) && + Utils.enhancedDeepEquals(this.grandparentTitle, other.grandparentTitle) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.musicAnalysisVersion, other.musicAnalysisVersion) && + Utils.enhancedDeepEquals(this.originalTitle, other.originalTitle) && + Utils.enhancedDeepEquals(this.parentGuid, other.parentGuid) && + Utils.enhancedDeepEquals(this.parentIndex, other.parentIndex) && + Utils.enhancedDeepEquals(this.parentKey, other.parentKey) && + Utils.enhancedDeepEquals(this.parentRatingKey, other.parentRatingKey) && + Utils.enhancedDeepEquals(this.parentStudio, other.parentStudio) && + Utils.enhancedDeepEquals(this.parentThumb, other.parentThumb) && + Utils.enhancedDeepEquals(this.parentTitle, other.parentTitle) && + Utils.enhancedDeepEquals(this.parentYear, other.parentYear) && + Utils.enhancedDeepEquals(this.ratingCount, other.ratingCount) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.sessionKey, other.sessionKey) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.titleSort, other.titleSort) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.viewOffset, other.viewOffset) && + Utils.enhancedDeepEquals(this.media, other.media) && + Utils.enhancedDeepEquals(this.user, other.user) && + Utils.enhancedDeepEquals(this.player, other.player) && + Utils.enhancedDeepEquals(this.session, other.session); } @Override public int hashCode() { - return Objects.hash( - addedAt, - art, - duration, - grandparentArt, - grandparentGuid, - grandparentKey, - grandparentRatingKey, - grandparentThumb, - grandparentTitle, - guid, - index, - key, - librarySectionID, - librarySectionKey, - librarySectionTitle, - musicAnalysisVersion, - originalTitle, - parentGuid, - parentIndex, - parentKey, - parentRatingKey, - parentStudio, - parentThumb, - parentTitle, - parentYear, - ratingCount, - ratingKey, - sessionKey, - thumb, - title, - titleSort, - type, - updatedAt, - viewOffset, - media, - user, - player, - session); + return Utils.enhancedHash( + addedAt, art, duration, + grandparentArt, grandparentGuid, grandparentKey, + grandparentRatingKey, grandparentThumb, grandparentTitle, + guid, index, key, + librarySectionID, librarySectionKey, librarySectionTitle, + musicAnalysisVersion, originalTitle, parentGuid, + parentIndex, parentKey, parentRatingKey, + parentStudio, parentThumb, parentTitle, + parentYear, ratingCount, ratingKey, + sessionKey, thumb, title, + titleSort, type, updatedAt, + viewOffset, media, user, + player, session); } @Override @@ -1095,89 +1156,91 @@ public class GetSessionsMetadata { "player", player, "session", session); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional addedAt = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional grandparentArt = Optional.empty(); - + private Optional grandparentGuid = Optional.empty(); - + private Optional grandparentKey = Optional.empty(); - + private Optional grandparentRatingKey = Optional.empty(); - + private Optional grandparentThumb = Optional.empty(); - + private Optional grandparentTitle = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional index = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionKey = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional musicAnalysisVersion = Optional.empty(); - + private Optional originalTitle = Optional.empty(); - + private Optional parentGuid = Optional.empty(); - + private Optional parentIndex = Optional.empty(); - + private Optional parentKey = Optional.empty(); - + private Optional parentRatingKey = Optional.empty(); - + private Optional parentStudio = Optional.empty(); - + private Optional parentThumb = Optional.empty(); - + private Optional parentTitle = Optional.empty(); - + private Optional parentYear = Optional.empty(); - + private Optional ratingCount = Optional.empty(); - + private Optional ratingKey = Optional.empty(); - + private Optional sessionKey = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional titleSort = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional viewOffset = Optional.empty(); - + private Optional> media = Optional.empty(); - + private Optional user = Optional.empty(); - + private Optional player = Optional.empty(); - + private Optional session = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -1190,6 +1253,7 @@ public class GetSessionsMetadata { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -1202,6 +1266,7 @@ public class GetSessionsMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -1214,6 +1279,7 @@ public class GetSessionsMetadata { return this; } + public Builder grandparentArt(String grandparentArt) { Utils.checkNotNull(grandparentArt, "grandparentArt"); this.grandparentArt = Optional.ofNullable(grandparentArt); @@ -1226,6 +1292,7 @@ public class GetSessionsMetadata { return this; } + public Builder grandparentGuid(String grandparentGuid) { Utils.checkNotNull(grandparentGuid, "grandparentGuid"); this.grandparentGuid = Optional.ofNullable(grandparentGuid); @@ -1238,6 +1305,7 @@ public class GetSessionsMetadata { return this; } + public Builder grandparentKey(String grandparentKey) { Utils.checkNotNull(grandparentKey, "grandparentKey"); this.grandparentKey = Optional.ofNullable(grandparentKey); @@ -1250,6 +1318,7 @@ public class GetSessionsMetadata { return this; } + public Builder grandparentRatingKey(String grandparentRatingKey) { Utils.checkNotNull(grandparentRatingKey, "grandparentRatingKey"); this.grandparentRatingKey = Optional.ofNullable(grandparentRatingKey); @@ -1262,6 +1331,7 @@ public class GetSessionsMetadata { return this; } + public Builder grandparentThumb(String grandparentThumb) { Utils.checkNotNull(grandparentThumb, "grandparentThumb"); this.grandparentThumb = Optional.ofNullable(grandparentThumb); @@ -1274,6 +1344,7 @@ public class GetSessionsMetadata { return this; } + public Builder grandparentTitle(String grandparentTitle) { Utils.checkNotNull(grandparentTitle, "grandparentTitle"); this.grandparentTitle = Optional.ofNullable(grandparentTitle); @@ -1286,6 +1357,7 @@ public class GetSessionsMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -1298,6 +1370,7 @@ public class GetSessionsMetadata { return this; } + public Builder index(int index) { Utils.checkNotNull(index, "index"); this.index = Optional.ofNullable(index); @@ -1310,6 +1383,7 @@ public class GetSessionsMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -1322,6 +1396,7 @@ public class GetSessionsMetadata { return this; } + public Builder librarySectionID(String librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -1334,6 +1409,7 @@ public class GetSessionsMetadata { return this; } + public Builder librarySectionKey(String librarySectionKey) { Utils.checkNotNull(librarySectionKey, "librarySectionKey"); this.librarySectionKey = Optional.ofNullable(librarySectionKey); @@ -1346,6 +1422,7 @@ public class GetSessionsMetadata { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -1358,6 +1435,7 @@ public class GetSessionsMetadata { return this; } + public Builder musicAnalysisVersion(String musicAnalysisVersion) { Utils.checkNotNull(musicAnalysisVersion, "musicAnalysisVersion"); this.musicAnalysisVersion = Optional.ofNullable(musicAnalysisVersion); @@ -1370,6 +1448,7 @@ public class GetSessionsMetadata { return this; } + /** * The original untranslated name of the media item when non-english, or the track artist if an audio Item has an album artist */ @@ -1388,6 +1467,7 @@ public class GetSessionsMetadata { return this; } + public Builder parentGuid(String parentGuid) { Utils.checkNotNull(parentGuid, "parentGuid"); this.parentGuid = Optional.ofNullable(parentGuid); @@ -1400,6 +1480,7 @@ public class GetSessionsMetadata { return this; } + public Builder parentIndex(int parentIndex) { Utils.checkNotNull(parentIndex, "parentIndex"); this.parentIndex = Optional.ofNullable(parentIndex); @@ -1412,6 +1493,7 @@ public class GetSessionsMetadata { return this; } + public Builder parentKey(String parentKey) { Utils.checkNotNull(parentKey, "parentKey"); this.parentKey = Optional.ofNullable(parentKey); @@ -1424,6 +1506,7 @@ public class GetSessionsMetadata { return this; } + public Builder parentRatingKey(String parentRatingKey) { Utils.checkNotNull(parentRatingKey, "parentRatingKey"); this.parentRatingKey = Optional.ofNullable(parentRatingKey); @@ -1436,6 +1519,7 @@ public class GetSessionsMetadata { return this; } + public Builder parentStudio(String parentStudio) { Utils.checkNotNull(parentStudio, "parentStudio"); this.parentStudio = Optional.ofNullable(parentStudio); @@ -1448,6 +1532,7 @@ public class GetSessionsMetadata { return this; } + public Builder parentThumb(String parentThumb) { Utils.checkNotNull(parentThumb, "parentThumb"); this.parentThumb = Optional.ofNullable(parentThumb); @@ -1460,6 +1545,7 @@ public class GetSessionsMetadata { return this; } + public Builder parentTitle(String parentTitle) { Utils.checkNotNull(parentTitle, "parentTitle"); this.parentTitle = Optional.ofNullable(parentTitle); @@ -1472,6 +1558,7 @@ public class GetSessionsMetadata { return this; } + public Builder parentYear(int parentYear) { Utils.checkNotNull(parentYear, "parentYear"); this.parentYear = Optional.ofNullable(parentYear); @@ -1484,6 +1571,7 @@ public class GetSessionsMetadata { return this; } + public Builder ratingCount(int ratingCount) { Utils.checkNotNull(ratingCount, "ratingCount"); this.ratingCount = Optional.ofNullable(ratingCount); @@ -1496,6 +1584,7 @@ public class GetSessionsMetadata { return this; } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -1508,6 +1597,7 @@ public class GetSessionsMetadata { return this; } + public Builder sessionKey(String sessionKey) { Utils.checkNotNull(sessionKey, "sessionKey"); this.sessionKey = Optional.ofNullable(sessionKey); @@ -1520,6 +1610,7 @@ public class GetSessionsMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -1532,6 +1623,7 @@ public class GetSessionsMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -1544,6 +1636,7 @@ public class GetSessionsMetadata { return this; } + public Builder titleSort(String titleSort) { Utils.checkNotNull(titleSort, "titleSort"); this.titleSort = Optional.ofNullable(titleSort); @@ -1556,6 +1649,7 @@ public class GetSessionsMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -1568,6 +1662,7 @@ public class GetSessionsMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -1580,6 +1675,7 @@ public class GetSessionsMetadata { return this; } + public Builder viewOffset(int viewOffset) { Utils.checkNotNull(viewOffset, "viewOffset"); this.viewOffset = Optional.ofNullable(viewOffset); @@ -1592,6 +1688,7 @@ public class GetSessionsMetadata { return this; } + public Builder media(List media) { Utils.checkNotNull(media, "media"); this.media = Optional.ofNullable(media); @@ -1604,6 +1701,7 @@ public class GetSessionsMetadata { return this; } + public Builder user(GetSessionsUser user) { Utils.checkNotNull(user, "user"); this.user = Optional.ofNullable(user); @@ -1616,6 +1714,7 @@ public class GetSessionsMetadata { return this; } + public Builder player(Player player) { Utils.checkNotNull(player, "player"); this.player = Optional.ofNullable(player); @@ -1628,6 +1727,7 @@ public class GetSessionsMetadata { return this; } + public Builder session(Session session) { Utils.checkNotNull(session, "session"); this.session = Optional.ofNullable(session); @@ -1639,47 +1739,24 @@ public class GetSessionsMetadata { this.session = session; return this; } - + public GetSessionsMetadata build() { + return new GetSessionsMetadata( - addedAt, - art, - duration, - grandparentArt, - grandparentGuid, - grandparentKey, - grandparentRatingKey, - grandparentThumb, - grandparentTitle, - guid, - index, - key, - librarySectionID, - librarySectionKey, - librarySectionTitle, - musicAnalysisVersion, - originalTitle, - parentGuid, - parentIndex, - parentKey, - parentRatingKey, - parentStudio, - parentThumb, - parentTitle, - parentYear, - ratingCount, - ratingKey, - sessionKey, - thumb, - title, - titleSort, - type, - updatedAt, - viewOffset, - media, - user, - player, - session); + addedAt, art, duration, + grandparentArt, grandparentGuid, grandparentKey, + grandparentRatingKey, grandparentThumb, grandparentTitle, + guid, index, key, + librarySectionID, librarySectionKey, librarySectionTitle, + musicAnalysisVersion, originalTitle, parentGuid, + parentIndex, parentKey, parentRatingKey, + parentStudio, parentThumb, parentTitle, + parentYear, ratingCount, ratingKey, + sessionKey, thumb, title, + titleSort, type, updatedAt, + viewOffset, media, user, + player, session); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsPart.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsPart.java index 30bd023c..ad9ece1f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsPart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsPart.java @@ -15,47 +15,56 @@ 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 GetSessionsPart { @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("file") private Optional file; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasThumbnail") private Optional hasThumbnail; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("decision") private Optional decision; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("selected") private Optional selected; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Stream") private Optional> stream; @@ -95,7 +104,10 @@ public class GetSessionsPart { } public GetSessionsPart() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -149,9 +161,10 @@ public class GetSessionsPart { return (Optional>) stream; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsPart withContainer(String container) { Utils.checkNotNull(container, "container"); @@ -159,6 +172,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -171,6 +185,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -183,6 +198,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withFile(Optional file) { Utils.checkNotNull(file, "file"); this.file = file; @@ -195,6 +211,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withHasThumbnail(Optional hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = hasThumbnail; @@ -207,6 +224,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -219,6 +237,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -231,6 +250,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -243,6 +263,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withDecision(Optional decision) { Utils.checkNotNull(decision, "decision"); this.decision = decision; @@ -255,6 +276,7 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withSelected(Optional selected) { Utils.checkNotNull(selected, "selected"); this.selected = selected; @@ -267,13 +289,13 @@ public class GetSessionsPart { return this; } + public GetSessionsPart withStream(Optional> stream) { Utils.checkNotNull(stream, "stream"); this.stream = stream; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -284,30 +306,24 @@ public class GetSessionsPart { } GetSessionsPart other = (GetSessionsPart) o; return - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.hasThumbnail, other.hasThumbnail) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.decision, other.decision) && - Objects.deepEquals(this.selected, other.selected) && - Objects.deepEquals(this.stream, other.stream); + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.hasThumbnail, other.hasThumbnail) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.decision, other.decision) && + Utils.enhancedDeepEquals(this.selected, other.selected) && + Utils.enhancedDeepEquals(this.stream, other.stream); } @Override public int hashCode() { - return Objects.hash( - container, - duration, - file, - hasThumbnail, - id, - key, - size, - decision, - selected, + return Utils.enhancedHash( + container, duration, file, + hasThumbnail, id, key, + size, decision, selected, stream); } @@ -325,33 +341,35 @@ public class GetSessionsPart { "selected", selected, "stream", stream); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional container = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional file = Optional.empty(); - + private Optional hasThumbnail = Optional.empty(); - + private Optional id = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional decision = Optional.empty(); - + private Optional selected = Optional.empty(); - + private Optional> stream = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -364,6 +382,7 @@ public class GetSessionsPart { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -376,6 +395,7 @@ public class GetSessionsPart { return this; } + public Builder file(String file) { Utils.checkNotNull(file, "file"); this.file = Optional.ofNullable(file); @@ -388,6 +408,7 @@ public class GetSessionsPart { return this; } + public Builder hasThumbnail(String hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = Optional.ofNullable(hasThumbnail); @@ -400,6 +421,7 @@ public class GetSessionsPart { return this; } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -412,6 +434,7 @@ public class GetSessionsPart { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -424,6 +447,7 @@ public class GetSessionsPart { return this; } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -436,6 +460,7 @@ public class GetSessionsPart { return this; } + public Builder decision(String decision) { Utils.checkNotNull(decision, "decision"); this.decision = Optional.ofNullable(decision); @@ -448,6 +473,7 @@ public class GetSessionsPart { return this; } + public Builder selected(boolean selected) { Utils.checkNotNull(selected, "selected"); this.selected = Optional.ofNullable(selected); @@ -460,6 +486,7 @@ public class GetSessionsPart { return this; } + public Builder stream(List stream) { Utils.checkNotNull(stream, "stream"); this.stream = Optional.ofNullable(stream); @@ -471,19 +498,15 @@ public class GetSessionsPart { this.stream = stream; return this; } - + public GetSessionsPart build() { + return new GetSessionsPart( - container, - duration, - file, - hasThumbnail, - id, - key, - size, - decision, - selected, + container, duration, file, + hasThumbnail, id, key, + size, decision, selected, stream); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsRequestBuilder.java index 1a068143..91650e89 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetSessions; import java.lang.Exception; public class GetSessionsRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetSessions sdk; + private final SDKConfiguration sdkConfiguration; - public GetSessionsRequestBuilder(SDKMethodInterfaces.MethodCallGetSessions sdk) { - this.sdk = sdk; + public GetSessionsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetSessionsResponse call() throws Exception { + + RequestlessOperation operation + = new GetSessions.Sync(sdkConfiguration); - return sdk.getSessionsDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsResponse.java index 566ee8f5..09f7d4d6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetSessionsResponse implements Response { +public class GetSessionsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetSessionsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetSessionsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetSessionsResponse implements Response { return this; } + /** * List of Active Plex Sessions */ @@ -143,7 +145,6 @@ public class GetSessionsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetSessionsResponse implements Response { } GetSessionsResponse other = (GetSessionsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetSessionsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetSessionsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetSessionsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetSessionsResponse implements Response { return this; } + /** * List of Active Plex Sessions */ @@ -236,13 +240,13 @@ public class GetSessionsResponse implements Response { this.object = object; return this; } - + public GetSessionsResponse build() { + return new GetSessionsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsResponseBody.java index c4de1d33..87d2d468 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetSessionsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsResponseBody withMediaContainer(GetSessionsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetSessionsResponseBody { return this; } + public GetSessionsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetSessionsResponseBody { } GetSessionsResponseBody other = (GetSessionsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetSessionsResponseBody { return Utils.toString(GetSessionsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetSessionsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetSessionsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetSessionsResponseBody build() { + return new GetSessionsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsStream.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsStream.java index 3f955af7..b65fe6e5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsStream.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsStream.java @@ -13,87 +13,106 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class GetSessionsStream { @JsonInclude(Include.NON_ABSENT) @JsonProperty("albumGain") private Optional albumGain; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("albumPeak") private Optional albumPeak; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("albumRange") private Optional albumRange; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannelLayout") private Optional audioChannelLayout; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitDepth") private Optional bitDepth; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bitrate") private Optional bitrate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("channels") private Optional channels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("codec") private Optional codec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("displayTitle") private Optional displayTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("extendedDisplayTitle") private Optional extendedDisplayTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("gain") private Optional gain; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("index") private Optional index; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("loudness") private Optional loudness; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("lra") private Optional lra; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("peak") private Optional peak; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("samplingRate") private Optional samplingRate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("selected") private Optional selected; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("streamType") private Optional streamType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("location") private Optional location; @@ -163,7 +182,13 @@ public class GetSessionsStream { } public GetSessionsStream() { - 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()); + 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()); } @JsonIgnore @@ -266,9 +291,10 @@ public class GetSessionsStream { return location; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsStream withAlbumGain(String albumGain) { Utils.checkNotNull(albumGain, "albumGain"); @@ -276,6 +302,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withAlbumGain(Optional albumGain) { Utils.checkNotNull(albumGain, "albumGain"); this.albumGain = albumGain; @@ -288,6 +315,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withAlbumPeak(Optional albumPeak) { Utils.checkNotNull(albumPeak, "albumPeak"); this.albumPeak = albumPeak; @@ -300,6 +328,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withAlbumRange(Optional albumRange) { Utils.checkNotNull(albumRange, "albumRange"); this.albumRange = albumRange; @@ -312,6 +341,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withAudioChannelLayout(Optional audioChannelLayout) { Utils.checkNotNull(audioChannelLayout, "audioChannelLayout"); this.audioChannelLayout = audioChannelLayout; @@ -324,6 +354,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withBitDepth(Optional bitDepth) { Utils.checkNotNull(bitDepth, "bitDepth"); this.bitDepth = bitDepth; @@ -336,6 +367,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withBitrate(Optional bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = bitrate; @@ -348,6 +380,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withChannels(Optional channels) { Utils.checkNotNull(channels, "channels"); this.channels = channels; @@ -360,6 +393,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withCodec(Optional codec) { Utils.checkNotNull(codec, "codec"); this.codec = codec; @@ -372,6 +406,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withDisplayTitle(Optional displayTitle) { Utils.checkNotNull(displayTitle, "displayTitle"); this.displayTitle = displayTitle; @@ -384,6 +419,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withExtendedDisplayTitle(Optional extendedDisplayTitle) { Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle"); this.extendedDisplayTitle = extendedDisplayTitle; @@ -396,6 +432,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withGain(Optional gain) { Utils.checkNotNull(gain, "gain"); this.gain = gain; @@ -408,6 +445,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -420,6 +458,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withIndex(Optional index) { Utils.checkNotNull(index, "index"); this.index = index; @@ -432,6 +471,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withLoudness(Optional loudness) { Utils.checkNotNull(loudness, "loudness"); this.loudness = loudness; @@ -444,6 +484,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withLra(Optional lra) { Utils.checkNotNull(lra, "lra"); this.lra = lra; @@ -456,6 +497,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withPeak(Optional peak) { Utils.checkNotNull(peak, "peak"); this.peak = peak; @@ -468,6 +510,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withSamplingRate(Optional samplingRate) { Utils.checkNotNull(samplingRate, "samplingRate"); this.samplingRate = samplingRate; @@ -480,6 +523,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withSelected(Optional selected) { Utils.checkNotNull(selected, "selected"); this.selected = selected; @@ -492,6 +536,7 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withStreamType(Optional streamType) { Utils.checkNotNull(streamType, "streamType"); this.streamType = streamType; @@ -504,13 +549,13 @@ public class GetSessionsStream { return this; } + public GetSessionsStream withLocation(Optional location) { Utils.checkNotNull(location, "location"); this.location = location; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -521,51 +566,38 @@ public class GetSessionsStream { } GetSessionsStream other = (GetSessionsStream) o; return - Objects.deepEquals(this.albumGain, other.albumGain) && - Objects.deepEquals(this.albumPeak, other.albumPeak) && - Objects.deepEquals(this.albumRange, other.albumRange) && - Objects.deepEquals(this.audioChannelLayout, other.audioChannelLayout) && - Objects.deepEquals(this.bitDepth, other.bitDepth) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.channels, other.channels) && - Objects.deepEquals(this.codec, other.codec) && - Objects.deepEquals(this.displayTitle, other.displayTitle) && - Objects.deepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && - Objects.deepEquals(this.gain, other.gain) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.loudness, other.loudness) && - Objects.deepEquals(this.lra, other.lra) && - Objects.deepEquals(this.peak, other.peak) && - Objects.deepEquals(this.samplingRate, other.samplingRate) && - Objects.deepEquals(this.selected, other.selected) && - Objects.deepEquals(this.streamType, other.streamType) && - Objects.deepEquals(this.location, other.location); + Utils.enhancedDeepEquals(this.albumGain, other.albumGain) && + Utils.enhancedDeepEquals(this.albumPeak, other.albumPeak) && + Utils.enhancedDeepEquals(this.albumRange, other.albumRange) && + Utils.enhancedDeepEquals(this.audioChannelLayout, other.audioChannelLayout) && + Utils.enhancedDeepEquals(this.bitDepth, other.bitDepth) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.channels, other.channels) && + Utils.enhancedDeepEquals(this.codec, other.codec) && + Utils.enhancedDeepEquals(this.displayTitle, other.displayTitle) && + Utils.enhancedDeepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && + Utils.enhancedDeepEquals(this.gain, other.gain) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.loudness, other.loudness) && + Utils.enhancedDeepEquals(this.lra, other.lra) && + Utils.enhancedDeepEquals(this.peak, other.peak) && + Utils.enhancedDeepEquals(this.samplingRate, other.samplingRate) && + Utils.enhancedDeepEquals(this.selected, other.selected) && + Utils.enhancedDeepEquals(this.streamType, other.streamType) && + Utils.enhancedDeepEquals(this.location, other.location); } @Override public int hashCode() { - return Objects.hash( - albumGain, - albumPeak, - albumRange, - audioChannelLayout, - bitDepth, - bitrate, - channels, - codec, - displayTitle, - extendedDisplayTitle, - gain, - id, - index, - loudness, - lra, - peak, - samplingRate, - selected, - streamType, - location); + return Utils.enhancedHash( + albumGain, albumPeak, albumRange, + audioChannelLayout, bitDepth, bitrate, + channels, codec, displayTitle, + extendedDisplayTitle, gain, id, + index, loudness, lra, + peak, samplingRate, selected, + streamType, location); } @Override @@ -592,53 +624,55 @@ public class GetSessionsStream { "streamType", streamType, "location", location); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional albumGain = Optional.empty(); - + private Optional albumPeak = Optional.empty(); - + private Optional albumRange = Optional.empty(); - + private Optional audioChannelLayout = Optional.empty(); - + private Optional bitDepth = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional channels = Optional.empty(); - + private Optional codec = Optional.empty(); - + private Optional displayTitle = Optional.empty(); - + private Optional extendedDisplayTitle = Optional.empty(); - + private Optional gain = Optional.empty(); - + private Optional id = Optional.empty(); - + private Optional index = Optional.empty(); - + private Optional loudness = Optional.empty(); - + private Optional lra = Optional.empty(); - + private Optional peak = Optional.empty(); - + private Optional samplingRate = Optional.empty(); - + private Optional selected = Optional.empty(); - + private Optional streamType = Optional.empty(); - + private Optional location = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder albumGain(String albumGain) { Utils.checkNotNull(albumGain, "albumGain"); this.albumGain = Optional.ofNullable(albumGain); @@ -651,6 +685,7 @@ public class GetSessionsStream { return this; } + public Builder albumPeak(String albumPeak) { Utils.checkNotNull(albumPeak, "albumPeak"); this.albumPeak = Optional.ofNullable(albumPeak); @@ -663,6 +698,7 @@ public class GetSessionsStream { return this; } + public Builder albumRange(String albumRange) { Utils.checkNotNull(albumRange, "albumRange"); this.albumRange = Optional.ofNullable(albumRange); @@ -675,6 +711,7 @@ public class GetSessionsStream { return this; } + public Builder audioChannelLayout(String audioChannelLayout) { Utils.checkNotNull(audioChannelLayout, "audioChannelLayout"); this.audioChannelLayout = Optional.ofNullable(audioChannelLayout); @@ -687,6 +724,7 @@ public class GetSessionsStream { return this; } + public Builder bitDepth(int bitDepth) { Utils.checkNotNull(bitDepth, "bitDepth"); this.bitDepth = Optional.ofNullable(bitDepth); @@ -699,6 +737,7 @@ public class GetSessionsStream { return this; } + public Builder bitrate(int bitrate) { Utils.checkNotNull(bitrate, "bitrate"); this.bitrate = Optional.ofNullable(bitrate); @@ -711,6 +750,7 @@ public class GetSessionsStream { return this; } + public Builder channels(int channels) { Utils.checkNotNull(channels, "channels"); this.channels = Optional.ofNullable(channels); @@ -723,6 +763,7 @@ public class GetSessionsStream { return this; } + public Builder codec(String codec) { Utils.checkNotNull(codec, "codec"); this.codec = Optional.ofNullable(codec); @@ -735,6 +776,7 @@ public class GetSessionsStream { return this; } + public Builder displayTitle(String displayTitle) { Utils.checkNotNull(displayTitle, "displayTitle"); this.displayTitle = Optional.ofNullable(displayTitle); @@ -747,6 +789,7 @@ public class GetSessionsStream { return this; } + public Builder extendedDisplayTitle(String extendedDisplayTitle) { Utils.checkNotNull(extendedDisplayTitle, "extendedDisplayTitle"); this.extendedDisplayTitle = Optional.ofNullable(extendedDisplayTitle); @@ -759,6 +802,7 @@ public class GetSessionsStream { return this; } + public Builder gain(String gain) { Utils.checkNotNull(gain, "gain"); this.gain = Optional.ofNullable(gain); @@ -771,6 +815,7 @@ public class GetSessionsStream { return this; } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -783,6 +828,7 @@ public class GetSessionsStream { return this; } + public Builder index(int index) { Utils.checkNotNull(index, "index"); this.index = Optional.ofNullable(index); @@ -795,6 +841,7 @@ public class GetSessionsStream { return this; } + public Builder loudness(String loudness) { Utils.checkNotNull(loudness, "loudness"); this.loudness = Optional.ofNullable(loudness); @@ -807,6 +854,7 @@ public class GetSessionsStream { return this; } + public Builder lra(String lra) { Utils.checkNotNull(lra, "lra"); this.lra = Optional.ofNullable(lra); @@ -819,6 +867,7 @@ public class GetSessionsStream { return this; } + public Builder peak(String peak) { Utils.checkNotNull(peak, "peak"); this.peak = Optional.ofNullable(peak); @@ -831,6 +880,7 @@ public class GetSessionsStream { return this; } + public Builder samplingRate(int samplingRate) { Utils.checkNotNull(samplingRate, "samplingRate"); this.samplingRate = Optional.ofNullable(samplingRate); @@ -843,6 +893,7 @@ public class GetSessionsStream { return this; } + public Builder selected(boolean selected) { Utils.checkNotNull(selected, "selected"); this.selected = Optional.ofNullable(selected); @@ -855,6 +906,7 @@ public class GetSessionsStream { return this; } + public Builder streamType(int streamType) { Utils.checkNotNull(streamType, "streamType"); this.streamType = Optional.ofNullable(streamType); @@ -867,6 +919,7 @@ public class GetSessionsStream { return this; } + public Builder location(String location) { Utils.checkNotNull(location, "location"); this.location = Optional.ofNullable(location); @@ -878,29 +931,18 @@ public class GetSessionsStream { this.location = location; return this; } - + public GetSessionsStream build() { + return new GetSessionsStream( - albumGain, - albumPeak, - albumRange, - audioChannelLayout, - bitDepth, - bitrate, - channels, - codec, - displayTitle, - extendedDisplayTitle, - gain, - id, - index, - loudness, - lra, - peak, - samplingRate, - selected, - streamType, - location); + albumGain, albumPeak, albumRange, + audioChannelLayout, bitDepth, bitrate, + channels, codec, displayTitle, + extendedDisplayTitle, gain, id, + index, loudness, lra, + peak, samplingRate, selected, + streamType, location); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsUser.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsUser.java index 91c08247..f3fa5c40 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsUser.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSessionsUser.java @@ -11,19 +11,21 @@ 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 GetSessionsUser { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; @@ -60,9 +62,10 @@ public class GetSessionsUser { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetSessionsUser withId(String id) { Utils.checkNotNull(id, "id"); @@ -70,6 +73,7 @@ public class GetSessionsUser { return this; } + public GetSessionsUser withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -82,6 +86,7 @@ public class GetSessionsUser { return this; } + public GetSessionsUser withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -94,13 +99,13 @@ public class GetSessionsUser { return this; } + public GetSessionsUser withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,17 +116,15 @@ public class GetSessionsUser { } GetSessionsUser other = (GetSessionsUser) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - id, - thumb, - title); + return Utils.enhancedHash( + id, thumb, title); } @Override @@ -131,19 +134,21 @@ public class GetSessionsUser { "thumb", thumb, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional title = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -156,6 +161,7 @@ public class GetSessionsUser { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -168,6 +174,7 @@ public class GetSessionsUser { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -179,12 +186,12 @@ public class GetSessionsUser { this.title = title; return this; } - + public GetSessionsUser build() { + return new GetSessionsUser( - id, - thumb, - title); + id, thumb, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequest.java index 572c639a..aaeff9b4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetSourceConnectionInformationRequest { - /** * The source identifier with an included prefix. */ @@ -34,9 +33,10 @@ public class GetSourceConnectionInformationRequest { return source; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The source identifier with an included prefix. @@ -47,7 +47,6 @@ public class GetSourceConnectionInformationRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class GetSourceConnectionInformationRequest { } GetSourceConnectionInformationRequest other = (GetSourceConnectionInformationRequest) o; return - Objects.deepEquals(this.source, other.source); + Utils.enhancedDeepEquals(this.source, other.source); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( source); } @@ -72,15 +71,17 @@ public class GetSourceConnectionInformationRequest { return Utils.toString(GetSourceConnectionInformationRequest.class, "source", source); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String source; - + private Builder() { // force use of static builder() method } + /** * The source identifier with an included prefix. */ @@ -89,10 +90,12 @@ public class GetSourceConnectionInformationRequest { this.source = source; return this; } - + public GetSourceConnectionInformationRequest build() { + return new GetSourceConnectionInformationRequest( source); } + } } 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 68ce545f..e33ab82b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetSourceConnectionInformation; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ import java.lang.String; public class GetSourceConnectionInformationRequestBuilder { private String source; - private final SDKMethodInterfaces.MethodCallGetSourceConnectionInformation sdk; + private final SDKConfiguration sdkConfiguration; - public GetSourceConnectionInformationRequestBuilder(SDKMethodInterfaces.MethodCallGetSourceConnectionInformation sdk) { - this.sdk = sdk; + public GetSourceConnectionInformationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetSourceConnectionInformationRequestBuilder source(String source) { @@ -22,9 +26,20 @@ public class GetSourceConnectionInformationRequestBuilder { return this; } - public GetSourceConnectionInformationResponse call() throws Exception { - return sdk.getSourceConnectionInformation( - source); + private GetSourceConnectionInformationRequest buildRequest() { + + GetSourceConnectionInformationRequest request = new GetSourceConnectionInformationRequest(source); + + return request; + } + + public GetSourceConnectionInformationResponse call() throws Exception { + + RequestOperation operation + = new GetSourceConnectionInformation.Sync(sdkConfiguration); + GetSourceConnectionInformationRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationResponse.java index ec54a59a..6eae4cca 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetSourceConnectionInformationResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class GetSourceConnectionInformationResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class GetSourceConnectionInformationResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class GetSourceConnectionInformationResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class GetSourceConnectionInformationResponse implements Response { } GetSourceConnectionInformationResponse other = (GetSourceConnectionInformationResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class GetSourceConnectionInformationResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class GetSourceConnectionInformationResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class GetSourceConnectionInformationResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class GetSourceConnectionInformationResponse implements Response { this.rawResponse = rawResponse; return this; } - + public GetSourceConnectionInformationResponse build() { + return new GetSourceConnectionInformationResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsDevice.java b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsDevice.java index 560c6a11..b3e4893c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsDevice.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsDevice.java @@ -12,27 +12,31 @@ 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 GetStatisticsDevice { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") private Optional name; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("platform") private Optional platform; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("clientIdentifier") private Optional clientIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("createdAt") private Optional createdAt; @@ -57,7 +61,8 @@ public class GetStatisticsDevice { } public GetStatisticsDevice() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -85,9 +90,10 @@ public class GetStatisticsDevice { return createdAt; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetStatisticsDevice withId(int id) { Utils.checkNotNull(id, "id"); @@ -95,6 +101,7 @@ public class GetStatisticsDevice { return this; } + public GetStatisticsDevice withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -107,6 +114,7 @@ public class GetStatisticsDevice { return this; } + public GetStatisticsDevice withName(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; @@ -119,6 +127,7 @@ public class GetStatisticsDevice { return this; } + public GetStatisticsDevice withPlatform(Optional platform) { Utils.checkNotNull(platform, "platform"); this.platform = platform; @@ -131,6 +140,7 @@ public class GetStatisticsDevice { return this; } + public GetStatisticsDevice withClientIdentifier(Optional clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = clientIdentifier; @@ -143,13 +153,13 @@ public class GetStatisticsDevice { return this; } + public GetStatisticsDevice withCreatedAt(Optional createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -160,21 +170,18 @@ public class GetStatisticsDevice { } GetStatisticsDevice other = (GetStatisticsDevice) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.platform, other.platform) && - Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) && - Objects.deepEquals(this.createdAt, other.createdAt); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.platform, other.platform) && + Utils.enhancedDeepEquals(this.clientIdentifier, other.clientIdentifier) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt); } @Override public int hashCode() { - return Objects.hash( - id, - name, - platform, - clientIdentifier, - createdAt); + return Utils.enhancedHash( + id, name, platform, + clientIdentifier, createdAt); } @Override @@ -186,23 +193,25 @@ public class GetStatisticsDevice { "clientIdentifier", clientIdentifier, "createdAt", createdAt); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional name = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Optional clientIdentifier = Optional.empty(); - + private Optional createdAt = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -215,6 +224,7 @@ public class GetStatisticsDevice { return this; } + public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); @@ -227,6 +237,7 @@ public class GetStatisticsDevice { return this; } + public Builder platform(String platform) { Utils.checkNotNull(platform, "platform"); this.platform = Optional.ofNullable(platform); @@ -239,6 +250,7 @@ public class GetStatisticsDevice { return this; } + public Builder clientIdentifier(String clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = Optional.ofNullable(clientIdentifier); @@ -251,6 +263,7 @@ public class GetStatisticsDevice { return this; } + public Builder createdAt(int createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = Optional.ofNullable(createdAt); @@ -262,14 +275,13 @@ public class GetStatisticsDevice { this.createdAt = createdAt; return this; } - + public GetStatisticsDevice build() { + return new GetStatisticsDevice( - id, - name, - platform, - clientIdentifier, - createdAt); + id, name, platform, + clientIdentifier, createdAt); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsMediaContainer.java index 2bcfa24c..e51ddccd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsMediaContainer.java @@ -14,23 +14,26 @@ 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 GetStatisticsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Device") private Optional> device; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Account") private Optional> account; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("StatisticsMedia") private Optional> statisticsMedia; @@ -52,7 +55,8 @@ public class GetStatisticsMediaContainer { } public GetStatisticsMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -78,9 +82,10 @@ public class GetStatisticsMediaContainer { return (Optional>) statisticsMedia; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetStatisticsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -88,6 +93,7 @@ public class GetStatisticsMediaContainer { return this; } + public GetStatisticsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -100,6 +106,7 @@ public class GetStatisticsMediaContainer { return this; } + public GetStatisticsMediaContainer withDevice(Optional> device) { Utils.checkNotNull(device, "device"); this.device = device; @@ -112,6 +119,7 @@ public class GetStatisticsMediaContainer { return this; } + public GetStatisticsMediaContainer withAccount(Optional> account) { Utils.checkNotNull(account, "account"); this.account = account; @@ -124,13 +132,13 @@ public class GetStatisticsMediaContainer { return this; } + public GetStatisticsMediaContainer withStatisticsMedia(Optional> statisticsMedia) { Utils.checkNotNull(statisticsMedia, "statisticsMedia"); this.statisticsMedia = statisticsMedia; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -141,18 +149,16 @@ public class GetStatisticsMediaContainer { } GetStatisticsMediaContainer other = (GetStatisticsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.device, other.device) && - Objects.deepEquals(this.account, other.account) && - Objects.deepEquals(this.statisticsMedia, other.statisticsMedia); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.device, other.device) && + Utils.enhancedDeepEquals(this.account, other.account) && + Utils.enhancedDeepEquals(this.statisticsMedia, other.statisticsMedia); } @Override public int hashCode() { - return Objects.hash( - size, - device, - account, + return Utils.enhancedHash( + size, device, account, statisticsMedia); } @@ -164,21 +170,23 @@ public class GetStatisticsMediaContainer { "account", account, "statisticsMedia", statisticsMedia); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> device = Optional.empty(); - + private Optional> account = Optional.empty(); - + private Optional> statisticsMedia = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -191,6 +199,7 @@ public class GetStatisticsMediaContainer { return this; } + public Builder device(List device) { Utils.checkNotNull(device, "device"); this.device = Optional.ofNullable(device); @@ -203,6 +212,7 @@ public class GetStatisticsMediaContainer { return this; } + public Builder account(List account) { Utils.checkNotNull(account, "account"); this.account = Optional.ofNullable(account); @@ -215,6 +225,7 @@ public class GetStatisticsMediaContainer { return this; } + public Builder statisticsMedia(List statisticsMedia) { Utils.checkNotNull(statisticsMedia, "statisticsMedia"); this.statisticsMedia = Optional.ofNullable(statisticsMedia); @@ -226,13 +237,13 @@ public class GetStatisticsMediaContainer { this.statisticsMedia = statisticsMedia; return this; } - + public GetStatisticsMediaContainer build() { + return new GetStatisticsMediaContainer( - size, - device, - account, + size, device, account, statisticsMedia); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequest.java index 0fe264e3..242785f2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetStatisticsRequest { +public class GetStatisticsRequest { /** * The timespan to retrieve statistics for * the exact meaning of this parameter is not known @@ -42,9 +41,10 @@ public class GetStatisticsRequest { return timespan; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The timespan to retrieve statistics for @@ -56,6 +56,7 @@ public class GetStatisticsRequest { return this; } + /** * The timespan to retrieve statistics for * the exact meaning of this parameter is not known @@ -66,7 +67,6 @@ public class GetStatisticsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,12 +77,12 @@ public class GetStatisticsRequest { } GetStatisticsRequest other = (GetStatisticsRequest) o; return - Objects.deepEquals(this.timespan, other.timespan); + Utils.enhancedDeepEquals(this.timespan, other.timespan); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( timespan); } @@ -91,15 +91,17 @@ public class GetStatisticsRequest { return Utils.toString(GetStatisticsRequest.class, "timespan", timespan); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional timespan = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The timespan to retrieve statistics for * the exact meaning of this parameter is not known @@ -119,10 +121,12 @@ public class GetStatisticsRequest { this.timespan = timespan; return this; } - + public GetStatisticsRequest build() { + return new GetStatisticsRequest( timespan); } + } } 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 7296aa61..795dd7f0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetStatistics; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -11,10 +15,10 @@ import java.util.Optional; public class GetStatisticsRequestBuilder { private Optional timespan = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetStatistics sdk; + private final SDKConfiguration sdkConfiguration; - public GetStatisticsRequestBuilder(SDKMethodInterfaces.MethodCallGetStatistics sdk) { - this.sdk = sdk; + public GetStatisticsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetStatisticsRequestBuilder timespan(long timespan) { @@ -29,9 +33,20 @@ public class GetStatisticsRequestBuilder { return this; } - public GetStatisticsResponse call() throws Exception { - return sdk.getStatistics( - timespan); + private GetStatisticsRequest buildRequest() { + + GetStatisticsRequest request = new GetStatisticsRequest(timespan); + + return request; + } + + public GetStatisticsResponse call() throws Exception { + + RequestOperation operation + = new GetStatistics.Sync(sdkConfiguration); + GetStatisticsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsResponse.java index 3774fb9a..c5a60686 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetStatisticsResponse implements Response { +public class GetStatisticsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetStatisticsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetStatisticsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetStatisticsResponse implements Response { return this; } + /** * Media Statistics */ @@ -143,7 +145,6 @@ public class GetStatisticsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetStatisticsResponse implements Response { } GetStatisticsResponse other = (GetStatisticsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetStatisticsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetStatisticsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetStatisticsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetStatisticsResponse implements Response { return this; } + /** * Media Statistics */ @@ -236,13 +240,13 @@ public class GetStatisticsResponse implements Response { this.object = object; return this; } - + public GetStatisticsResponse build() { + return new GetStatisticsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsResponseBody.java index b2bb4d23..c8ab9218 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetStatisticsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetStatisticsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetStatisticsResponseBody withMediaContainer(GetStatisticsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetStatisticsResponseBody { return this; } + public GetStatisticsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetStatisticsResponseBody { } GetStatisticsResponseBody other = (GetStatisticsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetStatisticsResponseBody { return Utils.toString(GetStatisticsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetStatisticsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetStatisticsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetStatisticsResponseBody build() { + return new GetStatisticsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequest.java index d0df7761..ae3e8028 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequest.java @@ -10,25 +10,28 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetThumbImageRequest { - /** * the id of the library item to return the children of. */ @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=ratingKey") private long ratingKey; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=width") private long width; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=height") private long height; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=minSize") private long minSize; + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=upscale") private long upscale; @@ -96,9 +99,10 @@ public class GetThumbImageRequest { return xPlexToken; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the id of the library item to return the children of. @@ -142,7 +146,6 @@ public class GetThumbImageRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -153,23 +156,19 @@ public class GetThumbImageRequest { } GetThumbImageRequest other = (GetThumbImageRequest) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.minSize, other.minSize) && - Objects.deepEquals(this.upscale, other.upscale) && - Objects.deepEquals(this.xPlexToken, other.xPlexToken); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.minSize, other.minSize) && + Utils.enhancedDeepEquals(this.upscale, other.upscale) && + Utils.enhancedDeepEquals(this.xPlexToken, other.xPlexToken); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - width, - height, - minSize, - upscale, - xPlexToken); + return Utils.enhancedHash( + ratingKey, width, height, + minSize, upscale, xPlexToken); } @Override @@ -182,25 +181,27 @@ public class GetThumbImageRequest { "upscale", upscale, "xPlexToken", xPlexToken); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long ratingKey; - + private Long width; - + private Long height; - + private Long minSize; - + private Long upscale; - + private String xPlexToken; - + private Builder() { // force use of static builder() method } + /** * the id of the library item to return the children of. */ @@ -210,30 +211,35 @@ public class GetThumbImageRequest { return this; } + public Builder width(long width) { Utils.checkNotNull(width, "width"); this.width = width; return this; } + public Builder height(long height) { Utils.checkNotNull(height, "height"); this.height = height; return this; } + public Builder minSize(long minSize) { Utils.checkNotNull(minSize, "minSize"); this.minSize = minSize; return this; } + public Builder upscale(long upscale) { Utils.checkNotNull(upscale, "upscale"); this.upscale = upscale; return this; } + /** * An authentication token, obtained from plex.tv */ @@ -242,15 +248,13 @@ public class GetThumbImageRequest { this.xPlexToken = xPlexToken; return this; } - + public GetThumbImageRequest build() { + return new GetThumbImageRequest( - ratingKey, - width, - height, - minSize, - upscale, - xPlexToken); + ratingKey, width, height, + minSize, upscale, xPlexToken); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java index 7d8437c8..25a1baef 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetThumbImage; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetThumbImageRequestBuilder { private GetThumbImageRequest request; - private final SDKMethodInterfaces.MethodCallGetThumbImage sdk; + private final SDKConfiguration sdkConfiguration; - public GetThumbImageRequestBuilder(SDKMethodInterfaces.MethodCallGetThumbImage sdk) { - this.sdk = sdk; + public GetThumbImageRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetThumbImageRequestBuilder request(GetThumbImageRequest request) { @@ -22,8 +26,10 @@ public class GetThumbImageRequestBuilder { } public GetThumbImageResponse call() throws Exception { + + RequestOperation operation + = new GetThumbImage.Sync(sdkConfiguration); - return sdk.getThumbImage( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageResponse.java index 91bd82e7..26fb7f22 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetThumbImageResponse.java @@ -15,11 +15,10 @@ import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; -public class GetThumbImageResponse implements Response { +public class GetThumbImageResponse implements Response { /** * HTTP response content type for this operation */ @@ -40,6 +39,7 @@ public class GetThumbImageResponse implements Response { */ private Optional responseStream; + private Map> headers; @JsonCreator @@ -54,6 +54,7 @@ public class GetThumbImageResponse implements Response { Utils.checkNotNull(rawResponse, "rawResponse"); Utils.checkNotNull(responseStream, "responseStream"); headers = Utils.emptyMapIfNull(headers); + Utils.checkNotNull(headers, "headers"); this.contentType = contentType; this.statusCode = statusCode; this.rawResponse = rawResponse; @@ -66,7 +67,8 @@ public class GetThumbImageResponse implements Response { int statusCode, HttpResponse rawResponse, Map> headers) { - this(contentType, statusCode, rawResponse, Optional.empty(), headers); + this(contentType, statusCode, rawResponse, + Optional.empty(), headers); } /** @@ -107,9 +109,10 @@ public class GetThumbImageResponse implements Response { return headers; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -147,6 +150,7 @@ public class GetThumbImageResponse implements Response { return this; } + /** * Successful response returning an image */ @@ -162,7 +166,6 @@ public class GetThumbImageResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,21 +176,18 @@ public class GetThumbImageResponse implements Response { } GetThumbImageResponse other = (GetThumbImageResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.responseStream, other.responseStream) && - Objects.deepEquals(this.headers, other.headers); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.responseStream, other.responseStream) && + Utils.enhancedDeepEquals(this.headers, other.headers); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, - responseStream, - headers); + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + responseStream, headers); } @Override @@ -199,23 +199,25 @@ public class GetThumbImageResponse implements Response { "responseStream", responseStream, "headers", headers); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional responseStream = Optional.empty(); - + private Map> headers; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -225,6 +227,7 @@ public class GetThumbImageResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -234,6 +237,7 @@ public class GetThumbImageResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -243,6 +247,7 @@ public class GetThumbImageResponse implements Response { return this; } + /** * Successful response returning an image */ @@ -261,19 +266,19 @@ public class GetThumbImageResponse implements Response { return this; } + public Builder headers(Map> headers) { Utils.checkNotNull(headers, "headers"); this.headers = headers; return this; } - + public GetThumbImageResponse build() { + return new GetThumbImageResponse( - contentType, - statusCode, - rawResponse, - responseStream, - headers); + contentType, statusCode, rawResponse, + responseStream, headers); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequest.java index aec264e5..bd695594 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetTimelineRequest { - /** * The rating key of the media item */ @@ -188,9 +187,10 @@ public class GetTimelineRequest { return row; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The rating key of the media item @@ -282,7 +282,6 @@ public class GetTimelineRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -293,30 +292,24 @@ public class GetTimelineRequest { } GetTimelineRequest other = (GetTimelineRequest) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.state, other.state) && - Objects.deepEquals(this.hasMDE, other.hasMDE) && - Objects.deepEquals(this.time, other.time) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.context, other.context) && - Objects.deepEquals(this.playQueueItemID, other.playQueueItemID) && - Objects.deepEquals(this.playBackTime, other.playBackTime) && - Objects.deepEquals(this.row, other.row); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.state, other.state) && + Utils.enhancedDeepEquals(this.hasMDE, other.hasMDE) && + Utils.enhancedDeepEquals(this.time, other.time) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.context, other.context) && + Utils.enhancedDeepEquals(this.playQueueItemID, other.playQueueItemID) && + Utils.enhancedDeepEquals(this.playBackTime, other.playBackTime) && + Utils.enhancedDeepEquals(this.row, other.row); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - state, - hasMDE, - time, - duration, - context, - playQueueItemID, - playBackTime, + return Utils.enhancedHash( + ratingKey, key, state, + hasMDE, time, duration, + context, playQueueItemID, playBackTime, row); } @@ -334,33 +327,35 @@ public class GetTimelineRequest { "playBackTime", playBackTime, "row", row); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double ratingKey; - + private String key; - + private State state; - + private Double hasMDE; - + private Double time; - + private Double duration; - + private String context; - + private Double playQueueItemID; - + private Double playBackTime; - + private Double row; - + private Builder() { // force use of static builder() method } + /** * The rating key of the media item */ @@ -370,6 +365,7 @@ public class GetTimelineRequest { return this; } + /** * The key of the media item to get the timeline for */ @@ -379,6 +375,7 @@ public class GetTimelineRequest { return this; } + /** * The state of the media item */ @@ -388,6 +385,7 @@ public class GetTimelineRequest { return this; } + /** * Whether the media item has MDE */ @@ -397,6 +395,7 @@ public class GetTimelineRequest { return this; } + /** * The time of the media item */ @@ -406,6 +405,7 @@ public class GetTimelineRequest { return this; } + /** * The duration of the media item */ @@ -415,6 +415,7 @@ public class GetTimelineRequest { return this; } + /** * The context of the media item */ @@ -424,6 +425,7 @@ public class GetTimelineRequest { return this; } + /** * The play queue item ID of the media item */ @@ -433,6 +435,7 @@ public class GetTimelineRequest { return this; } + /** * The playback time of the media item */ @@ -442,6 +445,7 @@ public class GetTimelineRequest { return this; } + /** * The row of the media item */ @@ -450,19 +454,15 @@ public class GetTimelineRequest { this.row = row; return this; } - + public GetTimelineRequest build() { + return new GetTimelineRequest( - ratingKey, - key, - state, - hasMDE, - time, - duration, - context, - playQueueItemID, - playBackTime, + ratingKey, key, state, + hasMDE, time, duration, + context, playQueueItemID, playBackTime, row); } + } } 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 b7d94cfb..10b3e542 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetTimeline; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class GetTimelineRequestBuilder { private GetTimelineRequest request; - private final SDKMethodInterfaces.MethodCallGetTimeline sdk; + private final SDKConfiguration sdkConfiguration; - public GetTimelineRequestBuilder(SDKMethodInterfaces.MethodCallGetTimeline sdk) { - this.sdk = sdk; + public GetTimelineRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetTimelineRequestBuilder request(GetTimelineRequest request) { @@ -22,8 +26,10 @@ public class GetTimelineRequestBuilder { } public GetTimelineResponse call() throws Exception { + + RequestOperation operation + = new GetTimeline.Sync(sdkConfiguration); - return sdk.getTimeline( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineResponse.java index 48311003..79ac137d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTimelineResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class GetTimelineResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class GetTimelineResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class GetTimelineResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class GetTimelineResponse implements Response { } GetTimelineResponse other = (GetTimelineResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class GetTimelineResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class GetTimelineResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class GetTimelineResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class GetTimelineResponse implements Response { this.rawResponse = rawResponse; return this; } - + public GetTimelineResponse build() { + return new GetTimelineResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdAuthPinContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdAuthPinContainer.java index 62bff1c3..32f4414f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdAuthPinContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdAuthPinContainer.java @@ -18,7 +18,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.time.OffsetDateTime; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -32,16 +31,20 @@ public class GetTokenByPinIdAuthPinContainer { @JsonProperty("id") private long id; + @JsonProperty("code") private String code; + @JsonProperty("product") private String product; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("trusted") private Optional trusted; + @JsonProperty("qr") private String qr; @@ -64,16 +67,20 @@ public class GetTokenByPinIdAuthPinContainer { @JsonProperty("expiresIn") private Optional expiresIn; + @JsonProperty("createdAt") private OffsetDateTime createdAt; + @JsonProperty("expiresAt") private OffsetDateTime expiresAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("authToken") private JsonNullable authToken; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("newRegistration") private JsonNullable newRegistration; @@ -127,7 +134,10 @@ public class GetTokenByPinIdAuthPinContainer { GetTokenByPinIdGeoData location, OffsetDateTime createdAt, OffsetDateTime expiresAt) { - this(id, code, product, Optional.empty(), qr, clientIdentifier, location, Optional.empty(), createdAt, expiresAt, JsonNullable.undefined(), JsonNullable.undefined()); + this(id, code, product, + Optional.empty(), qr, clientIdentifier, + location, Optional.empty(), createdAt, + expiresAt, JsonNullable.undefined(), JsonNullable.undefined()); } @JsonIgnore @@ -200,9 +210,10 @@ public class GetTokenByPinIdAuthPinContainer { return (JsonNullable) newRegistration; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTokenByPinIdAuthPinContainer withId(long id) { Utils.checkNotNull(id, "id"); @@ -228,6 +239,7 @@ public class GetTokenByPinIdAuthPinContainer { return this; } + public GetTokenByPinIdAuthPinContainer withTrusted(Optional trusted) { Utils.checkNotNull(trusted, "trusted"); this.trusted = trusted; @@ -267,6 +279,7 @@ public class GetTokenByPinIdAuthPinContainer { return this; } + /** * The number of seconds this pin expires, by default 900 seconds */ @@ -312,7 +325,6 @@ public class GetTokenByPinIdAuthPinContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -323,35 +335,27 @@ public class GetTokenByPinIdAuthPinContainer { } GetTokenByPinIdAuthPinContainer other = (GetTokenByPinIdAuthPinContainer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.product, other.product) && - Objects.deepEquals(this.trusted, other.trusted) && - Objects.deepEquals(this.qr, other.qr) && - Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.expiresIn, other.expiresIn) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.expiresAt, other.expiresAt) && - Objects.deepEquals(this.authToken, other.authToken) && - Objects.deepEquals(this.newRegistration, other.newRegistration); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.product, other.product) && + Utils.enhancedDeepEquals(this.trusted, other.trusted) && + Utils.enhancedDeepEquals(this.qr, other.qr) && + Utils.enhancedDeepEquals(this.clientIdentifier, other.clientIdentifier) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.expiresIn, other.expiresIn) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.expiresAt, other.expiresAt) && + Utils.enhancedDeepEquals(this.authToken, other.authToken) && + Utils.enhancedDeepEquals(this.newRegistration, other.newRegistration); } @Override public int hashCode() { - return Objects.hash( - id, - code, - product, - trusted, - qr, - clientIdentifier, - location, - expiresIn, - createdAt, - expiresAt, - authToken, - newRegistration); + return Utils.enhancedHash( + id, code, product, + trusted, qr, clientIdentifier, + location, expiresIn, createdAt, + expiresAt, authToken, newRegistration); } @Override @@ -370,55 +374,60 @@ public class GetTokenByPinIdAuthPinContainer { "authToken", authToken, "newRegistration", newRegistration); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String code; - + private String product; - + private Optional trusted; - + private String qr; - + private String clientIdentifier; - + private GetTokenByPinIdGeoData location; - + private Optional expiresIn; - + private OffsetDateTime createdAt; - + private OffsetDateTime expiresAt; - + private JsonNullable authToken = JsonNullable.undefined(); - + private JsonNullable newRegistration = JsonNullable.undefined(); - + private Builder() { // force use of static builder() method } + public Builder id(long id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + public Builder code(String code) { Utils.checkNotNull(code, "code"); this.code = code; return this; } + public Builder product(String product) { Utils.checkNotNull(product, "product"); this.product = product; return this; } + public Builder trusted(boolean trusted) { Utils.checkNotNull(trusted, "trusted"); this.trusted = Optional.ofNullable(trusted); @@ -431,12 +440,14 @@ public class GetTokenByPinIdAuthPinContainer { return this; } + public Builder qr(String qr) { Utils.checkNotNull(qr, "qr"); this.qr = qr; return this; } + /** * The X-Client-Identifier used in the request */ @@ -446,6 +457,7 @@ public class GetTokenByPinIdAuthPinContainer { return this; } + /** * Geo location data */ @@ -455,6 +467,7 @@ public class GetTokenByPinIdAuthPinContainer { return this; } + /** * The number of seconds this pin expires, by default 900 seconds */ @@ -473,18 +486,21 @@ public class GetTokenByPinIdAuthPinContainer { return this; } + public Builder createdAt(OffsetDateTime createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } + public Builder expiresAt(OffsetDateTime expiresAt) { Utils.checkNotNull(expiresAt, "expiresAt"); this.expiresAt = expiresAt; return this; } + public Builder authToken(String authToken) { Utils.checkNotNull(authToken, "authToken"); this.authToken = JsonNullable.of(authToken); @@ -497,6 +513,7 @@ public class GetTokenByPinIdAuthPinContainer { return this; } + public Builder newRegistration(Object newRegistration) { Utils.checkNotNull(newRegistration, "newRegistration"); this.newRegistration = JsonNullable.of(newRegistration); @@ -508,7 +525,7 @@ public class GetTokenByPinIdAuthPinContainer { this.newRegistration = newRegistration; return this; } - + public GetTokenByPinIdAuthPinContainer build() { if (trusted == null) { trusted = _SINGLETON_VALUE_Trusted.value(); @@ -516,21 +533,15 @@ public class GetTokenByPinIdAuthPinContainer { if (expiresIn == null) { expiresIn = _SINGLETON_VALUE_ExpiresIn.value(); } + return new GetTokenByPinIdAuthPinContainer( - id, - code, - product, - trusted, - qr, - clientIdentifier, - location, - expiresIn, - createdAt, - expiresAt, - authToken, - newRegistration); + id, code, product, + trusted, qr, clientIdentifier, + location, expiresIn, createdAt, + expiresAt, authToken, newRegistration); } + private static final LazySingletonValue> _SINGLETON_VALUE_Trusted = new LazySingletonValue<>( "trusted", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdGeoData.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdGeoData.java index d0fa8900..91720fc3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdGeoData.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdGeoData.java @@ -14,7 +14,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -23,7 +22,6 @@ import java.util.Optional; *

Geo location data */ public class GetTokenByPinIdGeoData { - /** * The ISO 3166-1 alpha-2 code of the country. */ @@ -139,7 +137,10 @@ public class GetTokenByPinIdGeoData { String postalCode, String subdivisions, String coordinates) { - this(code, continentCode, country, city, Optional.empty(), timeZone, postalCode, Optional.empty(), Optional.empty(), subdivisions, coordinates); + this(code, continentCode, country, + city, Optional.empty(), timeZone, + postalCode, Optional.empty(), Optional.empty(), + subdivisions, coordinates); } /** @@ -230,9 +231,10 @@ public class GetTokenByPinIdGeoData { return coordinates; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The ISO 3166-1 alpha-2 code of the country. @@ -279,6 +281,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * Indicates if the country is a member of the European Union. */ @@ -315,6 +318,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * Indicates if the country has privacy restrictions. */ @@ -333,6 +337,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * Indicates if the region has privacy restrictions. */ @@ -360,7 +365,6 @@ public class GetTokenByPinIdGeoData { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -371,33 +375,26 @@ public class GetTokenByPinIdGeoData { } GetTokenByPinIdGeoData other = (GetTokenByPinIdGeoData) o; return - Objects.deepEquals(this.code, other.code) && - Objects.deepEquals(this.continentCode, other.continentCode) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.city, other.city) && - Objects.deepEquals(this.europeanUnionMember, other.europeanUnionMember) && - Objects.deepEquals(this.timeZone, other.timeZone) && - Objects.deepEquals(this.postalCode, other.postalCode) && - Objects.deepEquals(this.inPrivacyRestrictedCountry, other.inPrivacyRestrictedCountry) && - Objects.deepEquals(this.inPrivacyRestrictedRegion, other.inPrivacyRestrictedRegion) && - Objects.deepEquals(this.subdivisions, other.subdivisions) && - Objects.deepEquals(this.coordinates, other.coordinates); + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.continentCode, other.continentCode) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.city, other.city) && + Utils.enhancedDeepEquals(this.europeanUnionMember, other.europeanUnionMember) && + Utils.enhancedDeepEquals(this.timeZone, other.timeZone) && + Utils.enhancedDeepEquals(this.postalCode, other.postalCode) && + Utils.enhancedDeepEquals(this.inPrivacyRestrictedCountry, other.inPrivacyRestrictedCountry) && + Utils.enhancedDeepEquals(this.inPrivacyRestrictedRegion, other.inPrivacyRestrictedRegion) && + Utils.enhancedDeepEquals(this.subdivisions, other.subdivisions) && + Utils.enhancedDeepEquals(this.coordinates, other.coordinates); } @Override public int hashCode() { - return Objects.hash( - code, - continentCode, - country, - city, - europeanUnionMember, - timeZone, - postalCode, - inPrivacyRestrictedCountry, - inPrivacyRestrictedRegion, - subdivisions, - coordinates); + return Utils.enhancedHash( + code, continentCode, country, + city, europeanUnionMember, timeZone, + postalCode, inPrivacyRestrictedCountry, inPrivacyRestrictedRegion, + subdivisions, coordinates); } @Override @@ -415,35 +412,37 @@ public class GetTokenByPinIdGeoData { "subdivisions", subdivisions, "coordinates", coordinates); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String code; - + private String continentCode; - + private String country; - + private String city; - + private Optional europeanUnionMember; - + private String timeZone; - + private String postalCode; - + private Optional inPrivacyRestrictedCountry; - + private Optional inPrivacyRestrictedRegion; - + private String subdivisions; - + private String coordinates; - + private Builder() { // force use of static builder() method } + /** * The ISO 3166-1 alpha-2 code of the country. */ @@ -453,6 +452,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * The continent code where the country is located. */ @@ -462,6 +462,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * The official name of the country. */ @@ -471,6 +472,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * The name of the city. */ @@ -480,6 +482,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * Indicates if the country is a member of the European Union. */ @@ -498,6 +501,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * The time zone of the country. */ @@ -507,6 +511,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * The postal code of the location. */ @@ -516,6 +521,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * Indicates if the country has privacy restrictions. */ @@ -534,6 +540,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * Indicates if the region has privacy restrictions. */ @@ -552,6 +559,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * The name of the primary administrative subdivision. */ @@ -561,6 +569,7 @@ public class GetTokenByPinIdGeoData { return this; } + /** * The geographical coordinates (latitude, longitude) of the location. */ @@ -569,7 +578,7 @@ public class GetTokenByPinIdGeoData { this.coordinates = coordinates; return this; } - + public GetTokenByPinIdGeoData build() { if (europeanUnionMember == null) { europeanUnionMember = _SINGLETON_VALUE_EuropeanUnionMember.value(); @@ -580,20 +589,15 @@ public class GetTokenByPinIdGeoData { if (inPrivacyRestrictedRegion == null) { inPrivacyRestrictedRegion = _SINGLETON_VALUE_InPrivacyRestrictedRegion.value(); } + return new GetTokenByPinIdGeoData( - code, - continentCode, - country, - city, - europeanUnionMember, - timeZone, - postalCode, - inPrivacyRestrictedCountry, - inPrivacyRestrictedRegion, - subdivisions, - coordinates); + code, continentCode, country, + city, europeanUnionMember, timeZone, + postalCode, inPrivacyRestrictedCountry, inPrivacyRestrictedRegion, + subdivisions, coordinates); } + private static final LazySingletonValue> _SINGLETON_VALUE_EuropeanUnionMember = new LazySingletonValue<>( "european_union_member", 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 615b38a1..8be247a4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetTokenByPinIdRequest { +public class GetTokenByPinIdRequest { /** * The PinID to retrieve an access token for */ @@ -76,7 +75,8 @@ public class GetTokenByPinIdRequest { public GetTokenByPinIdRequest( long pinID, String clientID) { - this(pinID, clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(pinID, clientID, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -127,9 +127,10 @@ public class GetTokenByPinIdRequest { return platform; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The PinID to retrieve an access token for @@ -158,6 +159,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -176,6 +178,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * A relatively friendly name for the client device */ @@ -194,6 +197,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * The version of the client application. */ @@ -212,6 +216,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * The platform of the client application. */ @@ -221,7 +226,6 @@ public class GetTokenByPinIdRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -232,23 +236,19 @@ public class GetTokenByPinIdRequest { } GetTokenByPinIdRequest other = (GetTokenByPinIdRequest) o; return - Objects.deepEquals(this.pinID, other.pinID) && - Objects.deepEquals(this.clientID, other.clientID) && - Objects.deepEquals(this.clientName, other.clientName) && - Objects.deepEquals(this.deviceNickname, other.deviceNickname) && - Objects.deepEquals(this.clientVersion, other.clientVersion) && - Objects.deepEquals(this.platform, other.platform); + Utils.enhancedDeepEquals(this.pinID, other.pinID) && + Utils.enhancedDeepEquals(this.clientID, other.clientID) && + Utils.enhancedDeepEquals(this.clientName, other.clientName) && + Utils.enhancedDeepEquals(this.deviceNickname, other.deviceNickname) && + Utils.enhancedDeepEquals(this.clientVersion, other.clientVersion) && + Utils.enhancedDeepEquals(this.platform, other.platform); } @Override public int hashCode() { - return Objects.hash( - pinID, - clientID, - clientName, - deviceNickname, - clientVersion, - platform); + return Utils.enhancedHash( + pinID, clientID, clientName, + deviceNickname, clientVersion, platform); } @Override @@ -261,25 +261,27 @@ public class GetTokenByPinIdRequest { "clientVersion", clientVersion, "platform", platform); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long pinID; - + private String clientID; - + private Optional clientName = Optional.empty(); - + private Optional deviceNickname = Optional.empty(); - + private Optional clientVersion = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The PinID to retrieve an access token for */ @@ -289,6 +291,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @@ -298,6 +301,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -316,6 +320,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * A relatively friendly name for the client device */ @@ -334,6 +339,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * The version of the client application. */ @@ -352,6 +358,7 @@ public class GetTokenByPinIdRequest { return this; } + /** * The platform of the client application. */ @@ -369,15 +376,13 @@ public class GetTokenByPinIdRequest { this.platform = platform; return this; } - + public GetTokenByPinIdRequest build() { + return new GetTokenByPinIdRequest( - pinID, - clientID, - clientName, - deviceNickname, - clientVersion, - platform); + pinID, clientID, clientName, + deviceNickname, clientVersion, platform); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java index 2f4cfe34..803d446c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetTokenByPinId; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class GetTokenByPinIdRequestBuilder { private GetTokenByPinIdRequest request; private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetTokenByPinId sdk; + private final SDKConfiguration sdkConfiguration; - public GetTokenByPinIdRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenByPinId sdk) { - this.sdk = sdk; + public GetTokenByPinIdRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetTokenByPinIdRequestBuilder request(GetTokenByPinIdRequest request) { @@ -37,9 +41,10 @@ public class GetTokenByPinIdRequestBuilder { } public GetTokenByPinIdResponse call() throws Exception { + + RequestOperation operation + = new GetTokenByPinId.Sync(sdkConfiguration, serverURL); - return sdk.getTokenByPinId( - request, - serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdResponse.java index 8bef38d5..50c3a8d0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenByPinIdResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetTokenByPinIdResponse implements Response { +public class GetTokenByPinIdResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetTokenByPinIdResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetTokenByPinIdResponse implements Response { return (Optional) authPinContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetTokenByPinIdResponse implements Response { return this; } + /** * The Pin with a non-null authToken when it has been verified by the user */ @@ -143,7 +145,6 @@ public class GetTokenByPinIdResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetTokenByPinIdResponse implements Response { } GetTokenByPinIdResponse other = (GetTokenByPinIdResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.authPinContainer, other.authPinContainer); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.authPinContainer, other.authPinContainer); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, authPinContainer); } @@ -177,21 +176,23 @@ public class GetTokenByPinIdResponse implements Response { "rawResponse", rawResponse, "authPinContainer", authPinContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional authPinContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetTokenByPinIdResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetTokenByPinIdResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetTokenByPinIdResponse implements Response { return this; } + /** * The Pin with a non-null authToken when it has been verified by the user */ @@ -236,13 +240,13 @@ public class GetTokenByPinIdResponse implements Response { this.authPinContainer = authPinContainer; return this; } - + public GetTokenByPinIdResponse build() { + return new GetTokenByPinIdResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, authPinContainer); } + } } 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 aad3a0ab..89e69d26 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetTokenDetails; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -11,10 +15,10 @@ import java.util.Optional; public class GetTokenDetailsRequestBuilder { private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetTokenDetails sdk; + private final SDKConfiguration sdkConfiguration; - public GetTokenDetailsRequestBuilder(SDKMethodInterfaces.MethodCallGetTokenDetails sdk) { - this.sdk = sdk; + public GetTokenDetailsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetTokenDetailsRequestBuilder serverURL(String serverURL) { @@ -30,8 +34,10 @@ public class GetTokenDetailsRequestBuilder { } public GetTokenDetailsResponse call() throws Exception { + + RequestlessOperation operation + = new GetTokenDetails.Sync(sdkConfiguration, serverURL); - return sdk.getTokenDetails( - serverURL); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsResponse.java index 8b0e9518..e9a5f1ec 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetTokenDetailsResponse implements Response { +public class GetTokenDetailsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetTokenDetailsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetTokenDetailsResponse implements Response { return (Optional) userPlexAccount; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetTokenDetailsResponse implements Response { return this; } + /** * Logged in user details */ @@ -143,7 +145,6 @@ public class GetTokenDetailsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetTokenDetailsResponse implements Response { } GetTokenDetailsResponse other = (GetTokenDetailsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.userPlexAccount, other.userPlexAccount); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.userPlexAccount, other.userPlexAccount); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, userPlexAccount); } @@ -177,21 +176,23 @@ public class GetTokenDetailsResponse implements Response { "rawResponse", rawResponse, "userPlexAccount", userPlexAccount); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional userPlexAccount = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetTokenDetailsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetTokenDetailsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetTokenDetailsResponse implements Response { return this; } + /** * Logged in user details */ @@ -236,13 +240,13 @@ public class GetTokenDetailsResponse implements Response { this.userPlexAccount = userPlexAccount; return this; } - + public GetTokenDetailsResponse build() { + return new GetTokenDetailsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, userPlexAccount); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsSubscription.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsSubscription.java index df78b6ab..71fcd576 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsSubscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsSubscription.java @@ -14,12 +14,11 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; -public class GetTokenDetailsSubscription { +public class GetTokenDetailsSubscription { /** * List of features allowed on your Plex Pass subscription */ @@ -85,7 +84,8 @@ public class GetTokenDetailsSubscription { } public GetTokenDetailsSubscription() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); } /** @@ -138,9 +138,10 @@ public class GetTokenDetailsSubscription { return plan; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * List of features allowed on your Plex Pass subscription @@ -151,6 +152,7 @@ public class GetTokenDetailsSubscription { return this; } + /** * List of features allowed on your Plex Pass subscription */ @@ -169,6 +171,7 @@ public class GetTokenDetailsSubscription { return this; } + /** * If the account's Plex Pass subscription is active */ @@ -205,6 +208,7 @@ public class GetTokenDetailsSubscription { return this; } + /** * String representation of subscriptionActive */ @@ -250,7 +254,6 @@ public class GetTokenDetailsSubscription { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -261,23 +264,19 @@ public class GetTokenDetailsSubscription { } GetTokenDetailsSubscription other = (GetTokenDetailsSubscription) o; return - Objects.deepEquals(this.features, other.features) && - Objects.deepEquals(this.active, other.active) && - Objects.deepEquals(this.subscribedAt, other.subscribedAt) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.paymentService, other.paymentService) && - Objects.deepEquals(this.plan, other.plan); + Utils.enhancedDeepEquals(this.features, other.features) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.subscribedAt, other.subscribedAt) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.paymentService, other.paymentService) && + Utils.enhancedDeepEquals(this.plan, other.plan); } @Override public int hashCode() { - return Objects.hash( - features, - active, - subscribedAt, - status, - paymentService, - plan); + return Utils.enhancedHash( + features, active, subscribedAt, + status, paymentService, plan); } @Override @@ -290,25 +289,27 @@ public class GetTokenDetailsSubscription { "paymentService", paymentService, "plan", plan); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> features = Optional.empty(); - + private Optional active = Optional.empty(); - + private JsonNullable subscribedAt = JsonNullable.undefined(); - + private Optional status = Optional.empty(); - + private JsonNullable paymentService = JsonNullable.undefined(); - + private JsonNullable plan = JsonNullable.undefined(); - + private Builder() { // force use of static builder() method } + /** * List of features allowed on your Plex Pass subscription */ @@ -327,6 +328,7 @@ public class GetTokenDetailsSubscription { return this; } + /** * If the account's Plex Pass subscription is active */ @@ -345,6 +347,7 @@ public class GetTokenDetailsSubscription { return this; } + /** * Date the account subscribed to Plex Pass */ @@ -363,6 +366,7 @@ public class GetTokenDetailsSubscription { return this; } + /** * String representation of subscriptionActive */ @@ -381,6 +385,7 @@ public class GetTokenDetailsSubscription { return this; } + /** * Payment service used for your Plex Pass subscription */ @@ -399,6 +404,7 @@ public class GetTokenDetailsSubscription { return this; } + /** * Name of Plex Pass subscription plan */ @@ -416,15 +422,13 @@ public class GetTokenDetailsSubscription { this.plan = plan; return this; } - + public GetTokenDetailsSubscription build() { + return new GetTokenDetailsSubscription( - features, - active, - subscribedAt, - status, - paymentService, - plan); + features, active, subscribedAt, + status, paymentService, plan); } + } } 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 fa94d973..d9ca82f5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTokenDetailsUserPlexAccount.java @@ -19,7 +19,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -29,7 +28,6 @@ import org.openapitools.jackson.nullable.JsonNullable; *

Logged in user details */ public class GetTokenDetailsUserPlexAccount { - /** * Unknown */ @@ -37,10 +35,12 @@ public class GetTokenDetailsUserPlexAccount { @JsonProperty("adsConsent") private Optional adsConsent; + @JsonInclude(Include.ALWAYS) @JsonProperty("adsConsentReminderAt") private Optional adsConsentReminderAt; + @JsonInclude(Include.ALWAYS) @JsonProperty("adsConsentSetAt") private Optional adsConsentSetAt; @@ -192,6 +192,7 @@ public class GetTokenDetailsUserPlexAccount { @Deprecated private Optional pin; + @JsonProperty("profile") private UserProfile profile; @@ -228,6 +229,7 @@ public class GetTokenDetailsUserPlexAccount { @JsonProperty("scrobbleTypes") private String scrobbleTypes; + @JsonProperty("services") private List services; @@ -244,6 +246,7 @@ public class GetTokenDetailsUserPlexAccount { @JsonProperty("subscriptionDescription") private Optional subscriptionDescription; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subscriptions") private Optional> subscriptions; @@ -279,6 +282,7 @@ public class GetTokenDetailsUserPlexAccount { @JsonProperty("uuid") private String uuid; + @JsonInclude(Include.ALWAYS) @JsonProperty("attributionPartner") private Optional attributionPartner; @@ -430,7 +434,20 @@ public class GetTokenDetailsUserPlexAccount { String title, String username, String uuid) { - this(Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), authToken, Optional.empty(), Optional.empty(), country, email, Optional.empty(), Optional.empty(), friendlyName, entitlements, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), homeSize, id, joinedAt, Optional.empty(), Optional.empty(), mailingListStatus, maxHomeSize, Optional.empty(), profile, Optional.empty(), rememberExpiresAt, Optional.empty(), Optional.empty(), scrobbleTypes, services, subscription, Optional.empty(), Optional.empty(), thumb, title, Optional.empty(), username, uuid, Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + JsonNullable.undefined(), authToken, Optional.empty(), + Optional.empty(), country, email, + Optional.empty(), Optional.empty(), friendlyName, + entitlements, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), homeSize, + id, joinedAt, Optional.empty(), + Optional.empty(), mailingListStatus, maxHomeSize, + Optional.empty(), profile, Optional.empty(), + rememberExpiresAt, Optional.empty(), Optional.empty(), + scrobbleTypes, services, subscription, + Optional.empty(), Optional.empty(), thumb, + title, Optional.empty(), username, + uuid, Optional.empty()); } /** @@ -748,9 +765,10 @@ public class GetTokenDetailsUserPlexAccount { return attributionPartner; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unknown @@ -761,6 +779,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Unknown */ @@ -776,6 +795,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public GetTokenDetailsUserPlexAccount withAdsConsentReminderAt(Optional adsConsentReminderAt) { Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt"); this.adsConsentReminderAt = adsConsentReminderAt; @@ -788,6 +808,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public GetTokenDetailsUserPlexAccount withAdsConsentSetAt(Optional adsConsentSetAt) { Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt"); this.adsConsentSetAt = adsConsentSetAt; @@ -830,6 +851,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the two-factor authentication backup codes have been created */ @@ -848,6 +870,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account has been confirmed */ @@ -884,6 +907,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If login with email only is enabled */ @@ -902,6 +926,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If experimental features are enabled */ @@ -938,6 +963,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account is a Plex Home guest user */ @@ -956,6 +982,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account has a password */ @@ -974,6 +1001,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account is a Plex Home user */ @@ -992,6 +1020,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account is the Plex Home admin */ @@ -1037,6 +1066,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The account locale */ @@ -1055,6 +1085,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If you are subscribed to the Plex newsletter */ @@ -1094,6 +1125,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * [Might be removed] The hashed Plex Home PIN * @@ -1121,6 +1153,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account has a Plex Home PIN enabled */ @@ -1148,6 +1181,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account is a Plex Home managed user */ @@ -1166,6 +1200,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * [Might be removed] List of account roles. Plexpass membership listed here */ @@ -1208,6 +1243,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Description of the Plex Pass subscription */ @@ -1223,6 +1259,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public GetTokenDetailsUserPlexAccount withSubscriptions(Optional> subscriptions) { Utils.checkNotNull(subscriptions, "subscriptions"); this.subscriptions = subscriptions; @@ -1256,6 +1293,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If two-factor authentication is enabled */ @@ -1289,13 +1327,13 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public GetTokenDetailsUserPlexAccount withAttributionPartner(Optional attributionPartner) { Utils.checkNotNull(attributionPartner, "attributionPartner"); this.attributionPartner = attributionPartner; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1306,93 +1344,66 @@ public class GetTokenDetailsUserPlexAccount { } GetTokenDetailsUserPlexAccount other = (GetTokenDetailsUserPlexAccount) o; return - Objects.deepEquals(this.adsConsent, other.adsConsent) && - Objects.deepEquals(this.adsConsentReminderAt, other.adsConsentReminderAt) && - Objects.deepEquals(this.adsConsentSetAt, other.adsConsentSetAt) && - Objects.deepEquals(this.anonymous, other.anonymous) && - Objects.deepEquals(this.authToken, other.authToken) && - Objects.deepEquals(this.backupCodesCreated, other.backupCodesCreated) && - Objects.deepEquals(this.confirmed, other.confirmed) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.emailOnlyAuth, other.emailOnlyAuth) && - Objects.deepEquals(this.experimentalFeatures, other.experimentalFeatures) && - Objects.deepEquals(this.friendlyName, other.friendlyName) && - Objects.deepEquals(this.entitlements, other.entitlements) && - Objects.deepEquals(this.guest, other.guest) && - Objects.deepEquals(this.hasPassword, other.hasPassword) && - Objects.deepEquals(this.home, other.home) && - Objects.deepEquals(this.homeAdmin, other.homeAdmin) && - Objects.deepEquals(this.homeSize, other.homeSize) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.joinedAt, other.joinedAt) && - Objects.deepEquals(this.locale, other.locale) && - Objects.deepEquals(this.mailingListActive, other.mailingListActive) && - Objects.deepEquals(this.mailingListStatus, other.mailingListStatus) && - Objects.deepEquals(this.maxHomeSize, other.maxHomeSize) && - Objects.deepEquals(this.pin, other.pin) && - Objects.deepEquals(this.profile, other.profile) && - Objects.deepEquals(this.protected_, other.protected_) && - Objects.deepEquals(this.rememberExpiresAt, other.rememberExpiresAt) && - Objects.deepEquals(this.restricted, other.restricted) && - Objects.deepEquals(this.roles, other.roles) && - Objects.deepEquals(this.scrobbleTypes, other.scrobbleTypes) && - Objects.deepEquals(this.services, other.services) && - Objects.deepEquals(this.subscription, other.subscription) && - Objects.deepEquals(this.subscriptionDescription, other.subscriptionDescription) && - Objects.deepEquals(this.subscriptions, other.subscriptions) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.twoFactorEnabled, other.twoFactorEnabled) && - Objects.deepEquals(this.username, other.username) && - Objects.deepEquals(this.uuid, other.uuid) && - Objects.deepEquals(this.attributionPartner, other.attributionPartner); + Utils.enhancedDeepEquals(this.adsConsent, other.adsConsent) && + Utils.enhancedDeepEquals(this.adsConsentReminderAt, other.adsConsentReminderAt) && + Utils.enhancedDeepEquals(this.adsConsentSetAt, other.adsConsentSetAt) && + Utils.enhancedDeepEquals(this.anonymous, other.anonymous) && + Utils.enhancedDeepEquals(this.authToken, other.authToken) && + Utils.enhancedDeepEquals(this.backupCodesCreated, other.backupCodesCreated) && + Utils.enhancedDeepEquals(this.confirmed, other.confirmed) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.emailOnlyAuth, other.emailOnlyAuth) && + Utils.enhancedDeepEquals(this.experimentalFeatures, other.experimentalFeatures) && + Utils.enhancedDeepEquals(this.friendlyName, other.friendlyName) && + Utils.enhancedDeepEquals(this.entitlements, other.entitlements) && + Utils.enhancedDeepEquals(this.guest, other.guest) && + Utils.enhancedDeepEquals(this.hasPassword, other.hasPassword) && + Utils.enhancedDeepEquals(this.home, other.home) && + Utils.enhancedDeepEquals(this.homeAdmin, other.homeAdmin) && + Utils.enhancedDeepEquals(this.homeSize, other.homeSize) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.joinedAt, other.joinedAt) && + Utils.enhancedDeepEquals(this.locale, other.locale) && + Utils.enhancedDeepEquals(this.mailingListActive, other.mailingListActive) && + Utils.enhancedDeepEquals(this.mailingListStatus, other.mailingListStatus) && + Utils.enhancedDeepEquals(this.maxHomeSize, other.maxHomeSize) && + Utils.enhancedDeepEquals(this.pin, other.pin) && + Utils.enhancedDeepEquals(this.profile, other.profile) && + Utils.enhancedDeepEquals(this.protected_, other.protected_) && + Utils.enhancedDeepEquals(this.rememberExpiresAt, other.rememberExpiresAt) && + Utils.enhancedDeepEquals(this.restricted, other.restricted) && + Utils.enhancedDeepEquals(this.roles, other.roles) && + Utils.enhancedDeepEquals(this.scrobbleTypes, other.scrobbleTypes) && + Utils.enhancedDeepEquals(this.services, other.services) && + Utils.enhancedDeepEquals(this.subscription, other.subscription) && + Utils.enhancedDeepEquals(this.subscriptionDescription, other.subscriptionDescription) && + Utils.enhancedDeepEquals(this.subscriptions, other.subscriptions) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.twoFactorEnabled, other.twoFactorEnabled) && + Utils.enhancedDeepEquals(this.username, other.username) && + Utils.enhancedDeepEquals(this.uuid, other.uuid) && + Utils.enhancedDeepEquals(this.attributionPartner, other.attributionPartner); } @Override public int hashCode() { - return Objects.hash( - adsConsent, - adsConsentReminderAt, - adsConsentSetAt, - anonymous, - authToken, - backupCodesCreated, - confirmed, - country, - email, - emailOnlyAuth, - experimentalFeatures, - friendlyName, - entitlements, - guest, - hasPassword, - home, - homeAdmin, - homeSize, - id, - joinedAt, - locale, - mailingListActive, - mailingListStatus, - maxHomeSize, - pin, - profile, - protected_, - rememberExpiresAt, - restricted, - roles, - scrobbleTypes, - services, - subscription, - subscriptionDescription, - subscriptions, - thumb, - title, - twoFactorEnabled, - username, - uuid, - attributionPartner); + return Utils.enhancedHash( + adsConsent, adsConsentReminderAt, adsConsentSetAt, + anonymous, authToken, backupCodesCreated, + confirmed, country, email, + emailOnlyAuth, experimentalFeatures, friendlyName, + entitlements, guest, hasPassword, + home, homeAdmin, homeSize, + id, joinedAt, locale, + mailingListActive, mailingListStatus, maxHomeSize, + pin, profile, protected_, + rememberExpiresAt, restricted, roles, + scrobbleTypes, services, subscription, + subscriptionDescription, subscriptions, thumb, + title, twoFactorEnabled, username, + uuid, attributionPartner); } @Override @@ -1440,96 +1451,98 @@ public class GetTokenDetailsUserPlexAccount { "uuid", uuid, "attributionPartner", attributionPartner); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional adsConsent = Optional.empty(); - + private Optional adsConsentReminderAt = Optional.empty(); - + private Optional adsConsentSetAt = Optional.empty(); - + private JsonNullable anonymous; - + private String authToken; - + private Optional backupCodesCreated; - + private Optional confirmed; - + private String country; - + private String email; - + private Optional emailOnlyAuth; - + private Optional experimentalFeatures; - + private String friendlyName; - + private List entitlements; - + private Optional guest; - + private Optional hasPassword; - + private Optional home; - + private Optional homeAdmin; - + private Integer homeSize; - + private Integer id; - + private Long joinedAt; - + private Optional locale = Optional.empty(); - + private Optional mailingListActive; - + private MailingListStatus mailingListStatus; - + private Integer maxHomeSize; - + @Deprecated private Optional pin = Optional.empty(); - + private UserProfile profile; - + private Optional protected_; - + private Long rememberExpiresAt; - + private Optional restricted; - + private Optional> roles = Optional.empty(); - + private String scrobbleTypes; - + private List services; - + private Subscription subscription; - + private Optional subscriptionDescription = Optional.empty(); - + private Optional> subscriptions = Optional.empty(); - + private String thumb; - + private String title; - + private Optional twoFactorEnabled; - + private String username; - + private String uuid; - + private Optional attributionPartner = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unknown */ @@ -1548,6 +1561,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public Builder adsConsentReminderAt(long adsConsentReminderAt) { Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt"); this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt); @@ -1560,6 +1574,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public Builder adsConsentSetAt(long adsConsentSetAt) { Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt"); this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt); @@ -1572,6 +1587,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Unknown */ @@ -1590,6 +1606,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The account token */ @@ -1599,6 +1616,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the two-factor authentication backup codes have been created */ @@ -1617,6 +1635,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account has been confirmed */ @@ -1635,6 +1654,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The account country */ @@ -1644,6 +1664,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The account email address */ @@ -1653,6 +1674,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If login with email only is enabled */ @@ -1671,6 +1693,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If experimental features are enabled */ @@ -1689,6 +1712,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Your account full name */ @@ -1698,6 +1722,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * List of devices your allowed to use with this account */ @@ -1707,6 +1732,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account is a Plex Home guest user */ @@ -1725,6 +1751,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account has a password */ @@ -1743,6 +1770,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account is a Plex Home user */ @@ -1761,6 +1789,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account is the Plex Home admin */ @@ -1779,6 +1808,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The number of accounts in the Plex Home */ @@ -1788,6 +1818,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The Plex account ID */ @@ -1797,6 +1828,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Unix epoch datetime in seconds */ @@ -1806,6 +1838,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The account locale */ @@ -1824,6 +1857,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If you are subscribed to the Plex newsletter */ @@ -1842,6 +1876,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Your current mailing list status (active or unsubscribed) */ @@ -1851,6 +1886,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The maximum number of accounts allowed in the Plex Home */ @@ -1860,6 +1896,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * [Might be removed] The hashed Plex Home PIN * @@ -1884,12 +1921,14 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public Builder profile(UserProfile profile) { Utils.checkNotNull(profile, "profile"); this.profile = profile; return this; } + /** * If the account has a Plex Home PIN enabled */ @@ -1908,6 +1947,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Unix epoch datetime in seconds */ @@ -1917,6 +1957,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If the account is a Plex Home managed user */ @@ -1935,6 +1976,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * [Might be removed] List of account roles. Plexpass membership listed here */ @@ -1953,6 +1995,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Unknown */ @@ -1962,12 +2005,14 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public Builder services(List services) { Utils.checkNotNull(services, "services"); this.services = services; return this; } + /** * If the account’s Plex Pass subscription is active */ @@ -1977,6 +2022,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * Description of the Plex Pass subscription */ @@ -1995,6 +2041,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public Builder subscriptions(List subscriptions) { Utils.checkNotNull(subscriptions, "subscriptions"); this.subscriptions = Optional.ofNullable(subscriptions); @@ -2007,6 +2054,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * URL of the account thumbnail */ @@ -2016,6 +2064,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The title of the account (username or friendly name) */ @@ -2025,6 +2074,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * If two-factor authentication is enabled */ @@ -2043,6 +2093,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The account username */ @@ -2052,6 +2103,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + /** * The account UUID */ @@ -2061,6 +2113,7 @@ public class GetTokenDetailsUserPlexAccount { return this; } + public Builder attributionPartner(String attributionPartner) { Utils.checkNotNull(attributionPartner, "attributionPartner"); this.attributionPartner = Optional.ofNullable(attributionPartner); @@ -2072,7 +2125,7 @@ public class GetTokenDetailsUserPlexAccount { this.attributionPartner = attributionPartner; return this; } - + public GetTokenDetailsUserPlexAccount build() { if (anonymous == null) { anonymous = _SINGLETON_VALUE_Anonymous.value(); @@ -2113,50 +2166,25 @@ public class GetTokenDetailsUserPlexAccount { if (twoFactorEnabled == null) { twoFactorEnabled = _SINGLETON_VALUE_TwoFactorEnabled.value(); } + return new GetTokenDetailsUserPlexAccount( - adsConsent, - adsConsentReminderAt, - adsConsentSetAt, - anonymous, - authToken, - backupCodesCreated, - confirmed, - country, - email, - emailOnlyAuth, - experimentalFeatures, - friendlyName, - entitlements, - guest, - hasPassword, - home, - homeAdmin, - homeSize, - id, - joinedAt, - locale, - mailingListActive, - mailingListStatus, - maxHomeSize, - pin, - profile, - protected_, - rememberExpiresAt, - restricted, - roles, - scrobbleTypes, - services, - subscription, - subscriptionDescription, - subscriptions, - thumb, - title, - twoFactorEnabled, - username, - uuid, - attributionPartner); + adsConsent, adsConsentReminderAt, adsConsentSetAt, + anonymous, authToken, backupCodesCreated, + confirmed, country, email, + emailOnlyAuth, experimentalFeatures, friendlyName, + entitlements, guest, hasPassword, + home, homeAdmin, homeSize, + id, joinedAt, locale, + mailingListActive, mailingListStatus, maxHomeSize, + pin, profile, protected_, + rememberExpiresAt, restricted, roles, + scrobbleTypes, services, subscription, + subscriptionDescription, subscriptions, thumb, + title, twoFactorEnabled, username, + uuid, attributionPartner); } + private static final LazySingletonValue> _SINGLETON_VALUE_Anonymous = new LazySingletonValue<>( "anonymous", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentCountry.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentCountry.java index 635a089f..60c9903c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentCountry.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentCountry.java @@ -12,19 +12,21 @@ 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 GetTopWatchedContentCountry { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("filter") private Optional filter; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; @@ -61,9 +63,10 @@ public class GetTopWatchedContentCountry { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentCountry withId(int id) { Utils.checkNotNull(id, "id"); @@ -71,6 +74,7 @@ public class GetTopWatchedContentCountry { return this; } + public GetTopWatchedContentCountry withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -83,6 +87,7 @@ public class GetTopWatchedContentCountry { return this; } + public GetTopWatchedContentCountry withFilter(Optional filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -95,13 +100,13 @@ public class GetTopWatchedContentCountry { return this; } + public GetTopWatchedContentCountry withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTopWatchedContentCountry { } GetTopWatchedContentCountry other = (GetTopWatchedContentCountry) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag); + return Utils.enhancedHash( + id, filter, tag); } @Override @@ -132,19 +135,21 @@ public class GetTopWatchedContentCountry { "filter", filter, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional filter = Optional.empty(); - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -157,6 +162,7 @@ public class GetTopWatchedContentCountry { return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); @@ -169,6 +175,7 @@ public class GetTopWatchedContentCountry { return this; } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -180,12 +187,12 @@ public class GetTopWatchedContentCountry { this.tag = tag; return this; } - + public GetTopWatchedContentCountry build() { + return new GetTopWatchedContentCountry( - id, - filter, - tag); + id, filter, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentGenre.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentGenre.java index aeea1c1a..b632b7f4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentGenre.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentGenre.java @@ -12,19 +12,21 @@ 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 GetTopWatchedContentGenre { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("filter") private Optional filter; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; @@ -61,9 +63,10 @@ public class GetTopWatchedContentGenre { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentGenre withId(int id) { Utils.checkNotNull(id, "id"); @@ -71,6 +74,7 @@ public class GetTopWatchedContentGenre { return this; } + public GetTopWatchedContentGenre withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -83,6 +87,7 @@ public class GetTopWatchedContentGenre { return this; } + public GetTopWatchedContentGenre withFilter(Optional filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -95,13 +100,13 @@ public class GetTopWatchedContentGenre { return this; } + public GetTopWatchedContentGenre withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class GetTopWatchedContentGenre { } GetTopWatchedContentGenre other = (GetTopWatchedContentGenre) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag); + return Utils.enhancedHash( + id, filter, tag); } @Override @@ -132,19 +135,21 @@ public class GetTopWatchedContentGenre { "filter", filter, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional filter = Optional.empty(); - + private Optional tag = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -157,6 +162,7 @@ public class GetTopWatchedContentGenre { return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); @@ -169,6 +175,7 @@ public class GetTopWatchedContentGenre { return this; } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -180,12 +187,12 @@ public class GetTopWatchedContentGenre { this.tag = tag; return this; } - + public GetTopWatchedContentGenre build() { + return new GetTopWatchedContentGenre( - id, - filter, - tag); + id, filter, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentGuids.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentGuids.java index b92b805b..bbdb7e81 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentGuids.java @@ -11,9 +11,9 @@ 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 GetTopWatchedContentGuids { @JsonInclude(Include.NON_ABSENT) @@ -36,9 +36,10 @@ public class GetTopWatchedContentGuids { return id; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentGuids withId(String id) { Utils.checkNotNull(id, "id"); @@ -46,13 +47,13 @@ public class GetTopWatchedContentGuids { return this; } + public GetTopWatchedContentGuids withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,12 +64,12 @@ public class GetTopWatchedContentGuids { } GetTopWatchedContentGuids other = (GetTopWatchedContentGuids) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } @@ -77,15 +78,17 @@ public class GetTopWatchedContentGuids { return Utils.toString(GetTopWatchedContentGuids.class, "id", id); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -97,10 +100,12 @@ public class GetTopWatchedContentGuids { this.id = id; return this; } - + public GetTopWatchedContentGuids build() { + return new GetTopWatchedContentGuids( id); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentMediaContainer.java index 4d960356..e74f66ee 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentMediaContainer.java @@ -16,11 +16,10 @@ 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 GetTopWatchedContentMediaContainer { +public class GetTopWatchedContentMediaContainer { /** * Number of media items returned in this response. */ @@ -51,6 +50,7 @@ public class GetTopWatchedContentMediaContainer { @JsonProperty("mediaTagVersion") private long mediaTagVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -83,7 +83,8 @@ public class GetTopWatchedContentMediaContainer { String identifier, String mediaTagPrefix, long mediaTagVersion) { - this(size, allowSync, identifier, mediaTagPrefix, mediaTagVersion, Optional.empty()); + this(size, allowSync, identifier, + mediaTagPrefix, mediaTagVersion, Optional.empty()); } /** @@ -132,9 +133,10 @@ public class GetTopWatchedContentMediaContainer { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Number of media items returned in this response. @@ -187,13 +189,13 @@ public class GetTopWatchedContentMediaContainer { return this; } + public GetTopWatchedContentMediaContainer withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -204,23 +206,19 @@ public class GetTopWatchedContentMediaContainer { } GetTopWatchedContentMediaContainer other = (GetTopWatchedContentMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && - Objects.deepEquals(this.mediaTagVersion, other.mediaTagVersion) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.mediaTagPrefix, other.mediaTagPrefix) && + Utils.enhancedDeepEquals(this.mediaTagVersion, other.mediaTagVersion) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - size, - allowSync, - identifier, - mediaTagPrefix, - mediaTagVersion, - metadata); + return Utils.enhancedHash( + size, allowSync, identifier, + mediaTagPrefix, mediaTagVersion, metadata); } @Override @@ -233,25 +231,27 @@ public class GetTopWatchedContentMediaContainer { "mediaTagVersion", mediaTagVersion, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer size; - + private Boolean allowSync; - + private String identifier; - + private String mediaTagPrefix; - + private Long mediaTagVersion; - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Number of media items returned in this response. */ @@ -261,6 +261,7 @@ public class GetTopWatchedContentMediaContainer { return this; } + /** * Indicates whether syncing is allowed. */ @@ -270,6 +271,7 @@ public class GetTopWatchedContentMediaContainer { return this; } + /** * An plugin identifier for the media container. */ @@ -279,6 +281,7 @@ public class GetTopWatchedContentMediaContainer { return this; } + /** * The prefix used for media tag resource paths. */ @@ -288,6 +291,7 @@ public class GetTopWatchedContentMediaContainer { return this; } + /** * The version number for media tags. */ @@ -297,6 +301,7 @@ public class GetTopWatchedContentMediaContainer { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -308,15 +313,13 @@ public class GetTopWatchedContentMediaContainer { this.metadata = metadata; return this; } - + public GetTopWatchedContentMediaContainer build() { + return new GetTopWatchedContentMediaContainer( - size, - allowSync, - identifier, - mediaTagPrefix, - mediaTagVersion, - metadata); + size, allowSync, identifier, + mediaTagPrefix, mediaTagVersion, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentMetadata.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentMetadata.java index 82174a98..aab13212 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentMetadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentMetadata.java @@ -17,135 +17,166 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; + public class GetTopWatchedContentMetadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("slug") private Optional slug; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("studio") private Optional studio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionKey") private Optional librarySectionKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentRating") private Optional contentRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("index") private Optional index; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRating") private Optional audienceRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("year") private Optional year; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagline") private Optional tagline; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("viewedLeafCount") private Optional viewedLeafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("childCount") private Optional childCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("globalViewCount") private Optional globalViewCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRatingImage") private Optional audienceRatingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Genre") private Optional> genre; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Country") private Optional> country; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Guid") private Optional> guids; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Role") private Optional> role; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("User") private Optional> user; @@ -251,7 +282,17 @@ public class GetTopWatchedContentMetadata { } public GetTopWatchedContentMetadata() { - 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()); + 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()); } @JsonIgnore @@ -419,9 +460,10 @@ public class GetTopWatchedContentMetadata { return (Optional>) user; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentMetadata withRatingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); @@ -429,6 +471,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -441,6 +484,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -453,6 +497,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -465,6 +510,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withSlug(Optional slug) { Utils.checkNotNull(slug, "slug"); this.slug = slug; @@ -477,6 +523,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withStudio(Optional studio) { Utils.checkNotNull(studio, "studio"); this.studio = studio; @@ -489,6 +536,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -501,6 +549,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -513,6 +562,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -525,6 +575,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -537,6 +588,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withLibrarySectionKey(Optional librarySectionKey) { Utils.checkNotNull(librarySectionKey, "librarySectionKey"); this.librarySectionKey = librarySectionKey; @@ -549,6 +601,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withContentRating(Optional contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = contentRating; @@ -561,6 +614,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -573,6 +627,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withIndex(Optional index) { Utils.checkNotNull(index, "index"); this.index = index; @@ -585,6 +640,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withAudienceRating(Optional audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = audienceRating; @@ -597,6 +653,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withYear(Optional year) { Utils.checkNotNull(year, "year"); this.year = year; @@ -609,6 +666,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withTagline(Optional tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = tagline; @@ -621,6 +679,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -633,6 +692,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -645,6 +705,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -657,6 +718,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withOriginallyAvailableAt(Optional originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = originallyAvailableAt; @@ -669,6 +731,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -681,6 +744,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withViewedLeafCount(Optional viewedLeafCount) { Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); this.viewedLeafCount = viewedLeafCount; @@ -693,6 +757,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withChildCount(Optional childCount) { Utils.checkNotNull(childCount, "childCount"); this.childCount = childCount; @@ -705,6 +770,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -717,6 +783,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -729,6 +796,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withGlobalViewCount(Optional globalViewCount) { Utils.checkNotNull(globalViewCount, "globalViewCount"); this.globalViewCount = globalViewCount; @@ -741,6 +809,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withAudienceRatingImage(Optional audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = audienceRatingImage; @@ -753,6 +822,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withGenre(Optional> genre) { Utils.checkNotNull(genre, "genre"); this.genre = genre; @@ -765,6 +835,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withCountry(Optional> country) { Utils.checkNotNull(country, "country"); this.country = country; @@ -777,6 +848,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withGuids(Optional> guids) { Utils.checkNotNull(guids, "guids"); this.guids = guids; @@ -789,6 +861,7 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withRole(Optional> role) { Utils.checkNotNull(role, "role"); this.role = role; @@ -801,13 +874,13 @@ public class GetTopWatchedContentMetadata { return this; } + public GetTopWatchedContentMetadata withUser(Optional> user) { Utils.checkNotNull(user, "user"); this.user = user; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -818,75 +891,54 @@ public class GetTopWatchedContentMetadata { } GetTopWatchedContentMetadata other = (GetTopWatchedContentMetadata) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.slug, other.slug) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionKey, other.librarySectionKey) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.viewedLeafCount, other.viewedLeafCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.globalViewCount, other.globalViewCount) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.genre, other.genre) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.guids, other.guids) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.user, other.user); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.slug, other.slug) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionKey, other.librarySectionKey) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.viewedLeafCount, other.viewedLeafCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.globalViewCount, other.globalViewCount) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.genre, other.genre) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.guids, other.guids) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.user, other.user); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - librarySectionTitle, - librarySectionID, - librarySectionKey, - contentRating, - summary, - index, - audienceRating, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - leafCount, - viewedLeafCount, - childCount, - addedAt, - updatedAt, - globalViewCount, - audienceRatingImage, - genre, - country, - guids, - role, - user); + return Utils.enhancedHash( + ratingKey, key, guid, + slug, studio, type, + title, librarySectionTitle, librarySectionID, + librarySectionKey, contentRating, summary, + index, audienceRating, year, + tagline, thumb, art, + duration, originallyAvailableAt, leafCount, + viewedLeafCount, childCount, addedAt, + updatedAt, globalViewCount, audienceRatingImage, + genre, country, guids, + role, user); } @Override @@ -925,77 +977,79 @@ public class GetTopWatchedContentMetadata { "role", role, "user", user); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional ratingKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional slug = Optional.empty(); - + private Optional studio = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionKey = Optional.empty(); - + private Optional contentRating = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional index = Optional.empty(); - + private Optional audienceRating = Optional.empty(); - + private Optional year = Optional.empty(); - + private Optional tagline = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional art = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional originallyAvailableAt = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional viewedLeafCount = Optional.empty(); - + private Optional childCount = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional globalViewCount = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional> genre = Optional.empty(); - + private Optional> country = Optional.empty(); - + private Optional> guids = Optional.empty(); - + private Optional> role = Optional.empty(); - + private Optional> user = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -1008,6 +1062,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -1020,6 +1075,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -1032,6 +1088,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder slug(String slug) { Utils.checkNotNull(slug, "slug"); this.slug = Optional.ofNullable(slug); @@ -1044,6 +1101,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder studio(String studio) { Utils.checkNotNull(studio, "studio"); this.studio = Optional.ofNullable(studio); @@ -1056,6 +1114,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -1068,6 +1127,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -1080,6 +1140,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -1092,6 +1153,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder librarySectionID(int librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -1104,6 +1166,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder librarySectionKey(String librarySectionKey) { Utils.checkNotNull(librarySectionKey, "librarySectionKey"); this.librarySectionKey = Optional.ofNullable(librarySectionKey); @@ -1116,6 +1179,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder contentRating(String contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = Optional.ofNullable(contentRating); @@ -1128,6 +1192,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -1140,6 +1205,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder index(long index) { Utils.checkNotNull(index, "index"); this.index = Optional.ofNullable(index); @@ -1152,6 +1218,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder audienceRating(double audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = Optional.ofNullable(audienceRating); @@ -1164,6 +1231,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder year(int year) { Utils.checkNotNull(year, "year"); this.year = Optional.ofNullable(year); @@ -1176,6 +1244,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder tagline(String tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = Optional.ofNullable(tagline); @@ -1188,6 +1257,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -1200,6 +1270,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -1212,6 +1283,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -1224,6 +1296,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder originallyAvailableAt(LocalDate originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); @@ -1236,6 +1309,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder leafCount(long leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -1248,6 +1322,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder viewedLeafCount(long viewedLeafCount) { Utils.checkNotNull(viewedLeafCount, "viewedLeafCount"); this.viewedLeafCount = Optional.ofNullable(viewedLeafCount); @@ -1260,6 +1335,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder childCount(long childCount) { Utils.checkNotNull(childCount, "childCount"); this.childCount = Optional.ofNullable(childCount); @@ -1272,6 +1348,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -1284,6 +1361,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder updatedAt(int updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -1296,6 +1374,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder globalViewCount(long globalViewCount) { Utils.checkNotNull(globalViewCount, "globalViewCount"); this.globalViewCount = Optional.ofNullable(globalViewCount); @@ -1308,6 +1387,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder audienceRatingImage(String audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); @@ -1320,6 +1400,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder genre(List genre) { Utils.checkNotNull(genre, "genre"); this.genre = Optional.ofNullable(genre); @@ -1332,6 +1413,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder country(List country) { Utils.checkNotNull(country, "country"); this.country = Optional.ofNullable(country); @@ -1344,6 +1426,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder guids(List guids) { Utils.checkNotNull(guids, "guids"); this.guids = Optional.ofNullable(guids); @@ -1356,6 +1439,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder role(List role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -1368,6 +1452,7 @@ public class GetTopWatchedContentMetadata { return this; } + public Builder user(List user) { Utils.checkNotNull(user, "user"); this.user = Optional.ofNullable(user); @@ -1379,41 +1464,22 @@ public class GetTopWatchedContentMetadata { this.user = user; return this; } - + public GetTopWatchedContentMetadata build() { + return new GetTopWatchedContentMetadata( - ratingKey, - key, - guid, - slug, - studio, - type, - title, - librarySectionTitle, - librarySectionID, - librarySectionKey, - contentRating, - summary, - index, - audienceRating, - year, - tagline, - thumb, - art, - duration, - originallyAvailableAt, - leafCount, - viewedLeafCount, - childCount, - addedAt, - updatedAt, - globalViewCount, - audienceRatingImage, - genre, - country, - guids, - role, - user); + ratingKey, key, guid, + slug, studio, type, + title, librarySectionTitle, librarySectionID, + librarySectionKey, contentRating, summary, + index, audienceRating, year, + tagline, thumb, art, + duration, originallyAvailableAt, leafCount, + viewedLeafCount, childCount, addedAt, + updatedAt, globalViewCount, audienceRatingImage, + genre, country, guids, + role, user); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamIncludeGuids.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamIncludeGuids.java index 5aaf2ca3..9e8cda4b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamIncludeGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentQueryParamIncludeGuids.java @@ -19,7 +19,7 @@ public enum GetTopWatchedContentQueryParamIncludeGuids { @JsonValue private final int value; - private GetTopWatchedContentQueryParamIncludeGuids(int value) { + GetTopWatchedContentQueryParamIncludeGuids(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequest.java index 9a2eed15..e518eb1f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequest.java @@ -12,11 +12,10 @@ 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 GetTopWatchedContentRequest { +public class GetTopWatchedContentRequest { /** * The type of media to retrieve or filter by. * 1 = movie @@ -71,9 +70,10 @@ public class GetTopWatchedContentRequest { return (Optional) includeGuids; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The type of media to retrieve or filter by. @@ -98,6 +98,7 @@ public class GetTopWatchedContentRequest { return this; } + /** * Adds the Guid object to the response */ @@ -107,7 +108,6 @@ public class GetTopWatchedContentRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -118,15 +118,14 @@ public class GetTopWatchedContentRequest { } GetTopWatchedContentRequest other = (GetTopWatchedContentRequest) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.includeGuids, other.includeGuids); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.includeGuids, other.includeGuids); } @Override public int hashCode() { - return Objects.hash( - type, - includeGuids); + return Utils.enhancedHash( + type, includeGuids); } @Override @@ -135,17 +134,19 @@ public class GetTopWatchedContentRequest { "type", type, "includeGuids", includeGuids); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private GetTopWatchedContentQueryParamType type; - + private Optional includeGuids; - + private Builder() { // force use of static builder() method } + /** * The type of media to retrieve or filter by. * 1 = movie @@ -160,6 +161,7 @@ public class GetTopWatchedContentRequest { return this; } + /** * Adds the Guid object to the response */ @@ -177,16 +179,17 @@ public class GetTopWatchedContentRequest { this.includeGuids = includeGuids; return this; } - + public GetTopWatchedContentRequest build() { if (includeGuids == null) { includeGuids = _SINGLETON_VALUE_IncludeGuids.value(); } + return new GetTopWatchedContentRequest( - type, - includeGuids); + type, includeGuids); } + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeGuids = new LazySingletonValue<>( "includeGuids", 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 c76331c8..7722e916 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRequestBuilder.java @@ -3,7 +3,11 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetTopWatchedContent; import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; @@ -16,10 +20,10 @@ public class GetTopWatchedContentRequestBuilder { "includeGuids", "0", new TypeReference>() {}); - private final SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk; + private final SDKConfiguration sdkConfiguration; - public GetTopWatchedContentRequestBuilder(SDKMethodInterfaces.MethodCallGetTopWatchedContent sdk) { - this.sdk = sdk; + public GetTopWatchedContentRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetTopWatchedContentRequestBuilder type(GetTopWatchedContentQueryParamType type) { @@ -40,13 +44,25 @@ public class GetTopWatchedContentRequestBuilder { return this; } - public GetTopWatchedContentResponse call() throws Exception { + + private GetTopWatchedContentRequest buildRequest() { if (includeGuids == null) { includeGuids = _SINGLETON_VALUE_IncludeGuids.value(); } - return sdk.getTopWatchedContent( - type, + + GetTopWatchedContentRequest request = new GetTopWatchedContentRequest(type, includeGuids); + + return request; + } + + public GetTopWatchedContentResponse call() throws Exception { + + RequestOperation operation + = new GetTopWatchedContent.Sync(sdkConfiguration); + GetTopWatchedContentRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } private static final LazySingletonValue> _SINGLETON_VALUE_IncludeGuids = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentResponse.java index 7ef26424..b832e065 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetTopWatchedContentResponse implements Response { +public class GetTopWatchedContentResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetTopWatchedContentResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetTopWatchedContentResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetTopWatchedContentResponse implements Response { return this; } + /** * The metadata of the library item. */ @@ -143,7 +145,6 @@ public class GetTopWatchedContentResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetTopWatchedContentResponse implements Response { } GetTopWatchedContentResponse other = (GetTopWatchedContentResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetTopWatchedContentResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetTopWatchedContentResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetTopWatchedContentResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetTopWatchedContentResponse implements Response { return this; } + /** * The metadata of the library item. */ @@ -236,13 +240,13 @@ public class GetTopWatchedContentResponse implements Response { this.object = object; return this; } - + public GetTopWatchedContentResponse build() { + return new GetTopWatchedContentResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentResponseBody.java index 53290c4a..4629153a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetTopWatchedContentResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentResponseBody withMediaContainer(GetTopWatchedContentMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetTopWatchedContentResponseBody { return this; } + public GetTopWatchedContentResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetTopWatchedContentResponseBody { } GetTopWatchedContentResponseBody other = (GetTopWatchedContentResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetTopWatchedContentResponseBody { return Utils.toString(GetTopWatchedContentResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetTopWatchedContentMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetTopWatchedContentResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetTopWatchedContentResponseBody build() { + return new GetTopWatchedContentResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRole.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRole.java index 4dcab711..8a6ed0bc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRole.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentRole.java @@ -12,31 +12,36 @@ 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 GetTopWatchedContentRole { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("filter") private Optional filter; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag") private Optional tag; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagKey") private Optional tagKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("role") private Optional role; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; @@ -64,7 +69,8 @@ public class GetTopWatchedContentRole { } public GetTopWatchedContentRole() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -97,9 +103,10 @@ public class GetTopWatchedContentRole { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentRole withId(int id) { Utils.checkNotNull(id, "id"); @@ -107,6 +114,7 @@ public class GetTopWatchedContentRole { return this; } + public GetTopWatchedContentRole withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -119,6 +127,7 @@ public class GetTopWatchedContentRole { return this; } + public GetTopWatchedContentRole withFilter(Optional filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; @@ -131,6 +140,7 @@ public class GetTopWatchedContentRole { return this; } + public GetTopWatchedContentRole withTag(Optional tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; @@ -143,6 +153,7 @@ public class GetTopWatchedContentRole { return this; } + public GetTopWatchedContentRole withTagKey(Optional tagKey) { Utils.checkNotNull(tagKey, "tagKey"); this.tagKey = tagKey; @@ -155,6 +166,7 @@ public class GetTopWatchedContentRole { return this; } + public GetTopWatchedContentRole withRole(Optional role) { Utils.checkNotNull(role, "role"); this.role = role; @@ -167,13 +179,13 @@ public class GetTopWatchedContentRole { return this; } + public GetTopWatchedContentRole withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,23 +196,19 @@ public class GetTopWatchedContentRole { } GetTopWatchedContentRole other = (GetTopWatchedContentRole) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag, - tagKey, - role, - thumb); + return Utils.enhancedHash( + id, filter, tag, + tagKey, role, thumb); } @Override @@ -213,25 +221,27 @@ public class GetTopWatchedContentRole { "role", role, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional filter = Optional.empty(); - + private Optional tag = Optional.empty(); - + private Optional tagKey = Optional.empty(); - + private Optional role = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -244,6 +254,7 @@ public class GetTopWatchedContentRole { return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = Optional.ofNullable(filter); @@ -256,6 +267,7 @@ public class GetTopWatchedContentRole { return this; } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = Optional.ofNullable(tag); @@ -268,6 +280,7 @@ public class GetTopWatchedContentRole { return this; } + public Builder tagKey(String tagKey) { Utils.checkNotNull(tagKey, "tagKey"); this.tagKey = Optional.ofNullable(tagKey); @@ -280,6 +293,7 @@ public class GetTopWatchedContentRole { return this; } + public Builder role(String role) { Utils.checkNotNull(role, "role"); this.role = Optional.ofNullable(role); @@ -292,6 +306,7 @@ public class GetTopWatchedContentRole { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -303,15 +318,13 @@ public class GetTopWatchedContentRole { this.thumb = thumb; return this; } - + public GetTopWatchedContentRole build() { + return new GetTopWatchedContentRole( - id, - filter, - tag, - tagKey, - role, - thumb); + id, filter, tag, + tagKey, role, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentUser.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentUser.java index 7f30b83d..a26c90f8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentUser.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTopWatchedContentUser.java @@ -12,9 +12,9 @@ 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 GetTopWatchedContentUser { @JsonInclude(Include.NON_ABSENT) @@ -37,9 +37,10 @@ public class GetTopWatchedContentUser { return id; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTopWatchedContentUser withId(int id) { Utils.checkNotNull(id, "id"); @@ -47,13 +48,13 @@ public class GetTopWatchedContentUser { return this; } + public GetTopWatchedContentUser withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,12 +65,12 @@ public class GetTopWatchedContentUser { } GetTopWatchedContentUser other = (GetTopWatchedContentUser) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } @@ -78,15 +79,17 @@ public class GetTopWatchedContentUser { return Utils.toString(GetTopWatchedContentUser.class, "id", id); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -98,10 +101,12 @@ public class GetTopWatchedContentUser { this.id = id; return this; } - + public GetTopWatchedContentUser build() { + return new GetTopWatchedContentUser( id); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsMediaContainer.java index 47ff0a65..717184ca 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsMediaContainer.java @@ -14,15 +14,16 @@ 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 GetTranscodeSessionsMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("TranscodeSession") private Optional> transcodeSession; @@ -52,9 +53,10 @@ public class GetTranscodeSessionsMediaContainer { return (Optional>) transcodeSession; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTranscodeSessionsMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -62,6 +64,7 @@ public class GetTranscodeSessionsMediaContainer { return this; } + public GetTranscodeSessionsMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -74,13 +77,13 @@ public class GetTranscodeSessionsMediaContainer { return this; } + public GetTranscodeSessionsMediaContainer withTranscodeSession(Optional> transcodeSession) { Utils.checkNotNull(transcodeSession, "transcodeSession"); this.transcodeSession = transcodeSession; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -91,15 +94,14 @@ public class GetTranscodeSessionsMediaContainer { } GetTranscodeSessionsMediaContainer other = (GetTranscodeSessionsMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.transcodeSession, other.transcodeSession); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.transcodeSession, other.transcodeSession); } @Override public int hashCode() { - return Objects.hash( - size, - transcodeSession); + return Utils.enhancedHash( + size, transcodeSession); } @Override @@ -108,17 +110,19 @@ public class GetTranscodeSessionsMediaContainer { "size", size, "transcodeSession", transcodeSession); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional> transcodeSession = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -131,6 +135,7 @@ public class GetTranscodeSessionsMediaContainer { return this; } + public Builder transcodeSession(List transcodeSession) { Utils.checkNotNull(transcodeSession, "transcodeSession"); this.transcodeSession = Optional.ofNullable(transcodeSession); @@ -142,11 +147,12 @@ public class GetTranscodeSessionsMediaContainer { this.transcodeSession = transcodeSession; return this; } - + public GetTranscodeSessionsMediaContainer build() { + return new GetTranscodeSessionsMediaContainer( - size, - transcodeSession); + size, transcodeSession); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsRequestBuilder.java index 88cff5f4..761aded1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetTranscodeSessions; import java.lang.Exception; public class GetTranscodeSessionsRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetTranscodeSessions sdk; + private final SDKConfiguration sdkConfiguration; - public GetTranscodeSessionsRequestBuilder(SDKMethodInterfaces.MethodCallGetTranscodeSessions sdk) { - this.sdk = sdk; + public GetTranscodeSessionsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetTranscodeSessionsResponse call() throws Exception { + + RequestlessOperation operation + = new GetTranscodeSessions.Sync(sdkConfiguration); - return sdk.getTranscodeSessionsDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsResponse.java index 37f229c1..0373eec2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetTranscodeSessionsResponse implements Response { +public class GetTranscodeSessionsResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetTranscodeSessionsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetTranscodeSessionsResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetTranscodeSessionsResponse implements Response { return this; } + /** * The Transcode Sessions */ @@ -143,7 +145,6 @@ public class GetTranscodeSessionsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetTranscodeSessionsResponse implements Response { } GetTranscodeSessionsResponse other = (GetTranscodeSessionsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetTranscodeSessionsResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetTranscodeSessionsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetTranscodeSessionsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetTranscodeSessionsResponse implements Response { return this; } + /** * The Transcode Sessions */ @@ -236,13 +240,13 @@ public class GetTranscodeSessionsResponse implements Response { this.object = object; return this; } - + public GetTranscodeSessionsResponse build() { + return new GetTranscodeSessionsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsResponseBody.java index 26e354f2..c2fa2553 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTranscodeSessionsResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetTranscodeSessionsResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetTranscodeSessionsResponseBody withMediaContainer(GetTranscodeSessionsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetTranscodeSessionsResponseBody { return this; } + public GetTranscodeSessionsResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetTranscodeSessionsResponseBody { } GetTranscodeSessionsResponseBody other = (GetTranscodeSessionsResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetTranscodeSessionsResponseBody { return Utils.toString(GetTranscodeSessionsResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetTranscodeSessionsMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetTranscodeSessionsResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetTranscodeSessionsResponseBody build() { + return new GetTranscodeSessionsResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenQueryParamType.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenQueryParamType.java index 70a58b6e..f3d1fd15 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenQueryParamType.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenQueryParamType.java @@ -19,7 +19,7 @@ public enum GetTransientTokenQueryParamType { @JsonValue private final String value; - private GetTransientTokenQueryParamType(String value) { + GetTransientTokenQueryParamType(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequest.java index e120f126..3918cc08 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class GetTransientTokenRequest { - /** * `delegation` - This is the only supported `type` parameter. */ @@ -51,9 +50,10 @@ public class GetTransientTokenRequest { return scope; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * `delegation` - This is the only supported `type` parameter. @@ -73,7 +73,6 @@ public class GetTransientTokenRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -84,15 +83,14 @@ public class GetTransientTokenRequest { } GetTransientTokenRequest other = (GetTransientTokenRequest) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.scope, other.scope); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.scope, other.scope); } @Override public int hashCode() { - return Objects.hash( - type, - scope); + return Utils.enhancedHash( + type, scope); } @Override @@ -101,17 +99,19 @@ public class GetTransientTokenRequest { "type", type, "scope", scope); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private GetTransientTokenQueryParamType type; - + private Scope scope; - + private Builder() { // force use of static builder() method } + /** * `delegation` - This is the only supported `type` parameter. */ @@ -121,6 +121,7 @@ public class GetTransientTokenRequest { return this; } + /** * `all` - This is the only supported `scope` parameter. */ @@ -129,11 +130,12 @@ public class GetTransientTokenRequest { this.scope = scope; return this; } - + public GetTransientTokenRequest build() { + return new GetTransientTokenRequest( - type, - scope); + type, scope); } + } } 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 dce1fb19..877e0d6a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetTransientToken; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; @@ -10,10 +14,10 @@ public class GetTransientTokenRequestBuilder { private GetTransientTokenQueryParamType type; private Scope scope; - private final SDKMethodInterfaces.MethodCallGetTransientToken sdk; + private final SDKConfiguration sdkConfiguration; - public GetTransientTokenRequestBuilder(SDKMethodInterfaces.MethodCallGetTransientToken sdk) { - this.sdk = sdk; + public GetTransientTokenRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetTransientTokenRequestBuilder type(GetTransientTokenQueryParamType type) { @@ -28,10 +32,21 @@ public class GetTransientTokenRequestBuilder { return this; } - public GetTransientTokenResponse call() throws Exception { - return sdk.getTransientToken( - type, + private GetTransientTokenRequest buildRequest() { + + GetTransientTokenRequest request = new GetTransientTokenRequest(type, scope); + + return request; + } + + public GetTransientTokenResponse call() throws Exception { + + RequestOperation operation + = new GetTransientToken.Sync(sdkConfiguration); + GetTransientTokenRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenResponse.java index 8a4449de..a15a71cc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetTransientTokenResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class GetTransientTokenResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class GetTransientTokenResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class GetTransientTokenResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class GetTransientTokenResponse implements Response { } GetTransientTokenResponse other = (GetTransientTokenResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class GetTransientTokenResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class GetTransientTokenResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class GetTransientTokenResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class GetTransientTokenResponse implements Response { this.rawResponse = rawResponse; return this; } - + public GetTransientTokenResponse build() { + return new GetTransientTokenResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusMediaContainer.java index 6f616ebb..0fb4a7ef 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusMediaContainer.java @@ -15,31 +15,36 @@ 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 GetUpdateStatusMediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("canInstall") private Optional canInstall; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("checkedAt") private Optional checkedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("downloadURL") private Optional downloadURL; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") private Optional status; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Release") private Optional> release; @@ -67,7 +72,8 @@ public class GetUpdateStatusMediaContainer { } public GetUpdateStatusMediaContainer() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -101,9 +107,10 @@ public class GetUpdateStatusMediaContainer { return (Optional>) release; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUpdateStatusMediaContainer withSize(int size) { Utils.checkNotNull(size, "size"); @@ -111,6 +118,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public GetUpdateStatusMediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -123,6 +131,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public GetUpdateStatusMediaContainer withCanInstall(Optional canInstall) { Utils.checkNotNull(canInstall, "canInstall"); this.canInstall = canInstall; @@ -135,6 +144,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public GetUpdateStatusMediaContainer withCheckedAt(Optional checkedAt) { Utils.checkNotNull(checkedAt, "checkedAt"); this.checkedAt = checkedAt; @@ -147,6 +157,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public GetUpdateStatusMediaContainer withDownloadURL(Optional downloadURL) { Utils.checkNotNull(downloadURL, "downloadURL"); this.downloadURL = downloadURL; @@ -159,6 +170,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public GetUpdateStatusMediaContainer withStatus(Optional status) { Utils.checkNotNull(status, "status"); this.status = status; @@ -171,13 +183,13 @@ public class GetUpdateStatusMediaContainer { return this; } + public GetUpdateStatusMediaContainer withRelease(Optional> release) { Utils.checkNotNull(release, "release"); this.release = release; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -188,23 +200,19 @@ public class GetUpdateStatusMediaContainer { } GetUpdateStatusMediaContainer other = (GetUpdateStatusMediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.canInstall, other.canInstall) && - Objects.deepEquals(this.checkedAt, other.checkedAt) && - Objects.deepEquals(this.downloadURL, other.downloadURL) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.release, other.release); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.canInstall, other.canInstall) && + Utils.enhancedDeepEquals(this.checkedAt, other.checkedAt) && + Utils.enhancedDeepEquals(this.downloadURL, other.downloadURL) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.release, other.release); } @Override public int hashCode() { - return Objects.hash( - size, - canInstall, - checkedAt, - downloadURL, - status, - release); + return Utils.enhancedHash( + size, canInstall, checkedAt, + downloadURL, status, release); } @Override @@ -217,25 +225,27 @@ public class GetUpdateStatusMediaContainer { "status", status, "release", release); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional canInstall = Optional.empty(); - + private Optional checkedAt = Optional.empty(); - + private Optional downloadURL = Optional.empty(); - + private Optional status = Optional.empty(); - + private Optional> release = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -248,6 +258,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public Builder canInstall(boolean canInstall) { Utils.checkNotNull(canInstall, "canInstall"); this.canInstall = Optional.ofNullable(canInstall); @@ -260,6 +271,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public Builder checkedAt(int checkedAt) { Utils.checkNotNull(checkedAt, "checkedAt"); this.checkedAt = Optional.ofNullable(checkedAt); @@ -272,6 +284,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public Builder downloadURL(String downloadURL) { Utils.checkNotNull(downloadURL, "downloadURL"); this.downloadURL = Optional.ofNullable(downloadURL); @@ -284,6 +297,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public Builder status(int status) { Utils.checkNotNull(status, "status"); this.status = Optional.ofNullable(status); @@ -296,6 +310,7 @@ public class GetUpdateStatusMediaContainer { return this; } + public Builder release(List release) { Utils.checkNotNull(release, "release"); this.release = Optional.ofNullable(release); @@ -307,15 +322,13 @@ public class GetUpdateStatusMediaContainer { this.release = release; return this; } - + public GetUpdateStatusMediaContainer build() { + return new GetUpdateStatusMediaContainer( - size, - canInstall, - checkedAt, - downloadURL, - status, - release); + size, canInstall, checkedAt, + downloadURL, status, release); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusRequestBuilder.java index 62988fab..8d4465ea 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetUpdateStatus; import java.lang.Exception; public class GetUpdateStatusRequestBuilder { - private final SDKMethodInterfaces.MethodCallGetUpdateStatus sdk; + private final SDKConfiguration sdkConfiguration; - public GetUpdateStatusRequestBuilder(SDKMethodInterfaces.MethodCallGetUpdateStatus sdk) { - this.sdk = sdk; + public GetUpdateStatusRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetUpdateStatusResponse call() throws Exception { + + RequestlessOperation operation + = new GetUpdateStatus.Sync(sdkConfiguration); - return sdk.getUpdateStatusDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusResponse.java index fbb25abe..678247da 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetUpdateStatusResponse implements Response { +public class GetUpdateStatusResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetUpdateStatusResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetUpdateStatusResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetUpdateStatusResponse implements Response { return this; } + /** * The Server Updates */ @@ -143,7 +145,6 @@ public class GetUpdateStatusResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetUpdateStatusResponse implements Response { } GetUpdateStatusResponse other = (GetUpdateStatusResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetUpdateStatusResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetUpdateStatusResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetUpdateStatusResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetUpdateStatusResponse implements Response { return this; } + /** * The Server Updates */ @@ -236,13 +240,13 @@ public class GetUpdateStatusResponse implements Response { this.object = object; return this; } - + public GetUpdateStatusResponse build() { + return new GetUpdateStatusResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusResponseBody.java index 58608bef..bbdea604 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUpdateStatusResponseBody.java @@ -12,7 +12,6 @@ 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; /** @@ -43,9 +42,10 @@ public class GetUpdateStatusResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetUpdateStatusResponseBody withMediaContainer(GetUpdateStatusMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); @@ -53,13 +53,13 @@ public class GetUpdateStatusResponseBody { return this; } + public GetUpdateStatusResponseBody withMediaContainer(Optional mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = mediaContainer; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,12 +70,12 @@ public class GetUpdateStatusResponseBody { } GetUpdateStatusResponseBody other = (GetUpdateStatusResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -84,15 +84,17 @@ public class GetUpdateStatusResponseBody { return Utils.toString(GetUpdateStatusResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder mediaContainer(GetUpdateStatusMediaContainer mediaContainer) { Utils.checkNotNull(mediaContainer, "mediaContainer"); this.mediaContainer = Optional.ofNullable(mediaContainer); @@ -104,10 +106,12 @@ public class GetUpdateStatusResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetUpdateStatusResponseBody build() { + return new GetUpdateStatusResponseBody( mediaContainer); } + } } 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 c9ec1529..c7453956 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetUserFriends; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -11,10 +15,10 @@ import java.util.Optional; public class GetUserFriendsRequestBuilder { private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetUserFriends sdk; + private final SDKConfiguration sdkConfiguration; - public GetUserFriendsRequestBuilder(SDKMethodInterfaces.MethodCallGetUserFriends sdk) { - this.sdk = sdk; + public GetUserFriendsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetUserFriendsRequestBuilder serverURL(String serverURL) { @@ -30,8 +34,10 @@ public class GetUserFriendsRequestBuilder { } public GetUserFriendsResponse call() throws Exception { + + RequestlessOperation operation + = new GetUserFriends.Sync(sdkConfiguration, serverURL); - return sdk.getUserFriends( - serverURL); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsResponse.java index e468079e..322f6311 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUserFriendsResponse.java @@ -14,11 +14,10 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.List; -import java.util.Objects; import java.util.Optional; -public class GetUserFriendsResponse implements Response { +public class GetUserFriendsResponse implements Response { /** * HTTP response content type for this operation */ @@ -59,7 +58,8 @@ public class GetUserFriendsResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -95,9 +95,10 @@ public class GetUserFriendsResponse implements Response { return (Optional>) friends; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -135,6 +136,7 @@ public class GetUserFriendsResponse implements Response { return this; } + /** * Friends Data */ @@ -144,7 +146,6 @@ public class GetUserFriendsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -155,18 +156,16 @@ public class GetUserFriendsResponse implements Response { } GetUserFriendsResponse other = (GetUserFriendsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.friends, other.friends); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.friends, other.friends); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, friends); } @@ -178,21 +177,23 @@ public class GetUserFriendsResponse implements Response { "rawResponse", rawResponse, "friends", friends); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional> friends = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -202,6 +203,7 @@ public class GetUserFriendsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -211,6 +213,7 @@ public class GetUserFriendsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -220,6 +223,7 @@ public class GetUserFriendsResponse implements Response { return this; } + /** * Friends Data */ @@ -237,13 +241,13 @@ public class GetUserFriendsResponse implements Response { this.friends = friends; return this; } - + public GetUserFriendsResponse build() { + return new GetUserFriendsResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, friends); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersMediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersMediaContainer.java index d8bb2c55..c5996098 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersMediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersMediaContainer.java @@ -10,7 +10,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.util.List; -import java.util.Objects; /** * GetUsersMediaContainer @@ -18,12 +17,12 @@ import java.util.Objects; *

Container holding user and server details. */ public class GetUsersMediaContainer { - /** * The friendly name of the Plex instance. */ private String friendlyName; + private String identifier; /** @@ -113,9 +112,10 @@ public class GetUsersMediaContainer { return user; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The friendly name of the Plex instance. @@ -168,7 +168,6 @@ public class GetUsersMediaContainer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -179,23 +178,19 @@ public class GetUsersMediaContainer { } GetUsersMediaContainer other = (GetUsersMediaContainer) o; return - Objects.deepEquals(this.friendlyName, other.friendlyName) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) && - Objects.deepEquals(this.totalSize, other.totalSize) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.user, other.user); + Utils.enhancedDeepEquals(this.friendlyName, other.friendlyName) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.machineIdentifier, other.machineIdentifier) && + Utils.enhancedDeepEquals(this.totalSize, other.totalSize) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.user, other.user); } @Override public int hashCode() { - return Objects.hash( - friendlyName, - identifier, - machineIdentifier, - totalSize, - size, - user); + return Utils.enhancedHash( + friendlyName, identifier, machineIdentifier, + totalSize, size, user); } @Override @@ -208,25 +203,27 @@ public class GetUsersMediaContainer { "size", size, "user", user); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String friendlyName; - + private String identifier; - + private String machineIdentifier; - + private Long totalSize; - + private Long size; - + private List user; - + private Builder() { // force use of static builder() method } + /** * The friendly name of the Plex instance. */ @@ -236,12 +233,14 @@ public class GetUsersMediaContainer { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; return this; } + /** * Unique Machine identifier of the Plex server. */ @@ -251,6 +250,7 @@ public class GetUsersMediaContainer { return this; } + /** * Total number of users. */ @@ -260,6 +260,7 @@ public class GetUsersMediaContainer { return this; } + /** * Number of users in the current response. */ @@ -269,6 +270,7 @@ public class GetUsersMediaContainer { return this; } + /** * List of users with access to the Plex server. */ @@ -277,15 +279,13 @@ public class GetUsersMediaContainer { this.user = user; return this; } - + public GetUsersMediaContainer build() { + return new GetUsersMediaContainer( - friendlyName, - identifier, - machineIdentifier, - totalSize, - size, - user); + friendlyName, identifier, machineIdentifier, + totalSize, size, user); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersRequest.java index f54fbf82..21ba652f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersRequest.java @@ -9,11 +9,10 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class GetUsersRequest { +public class GetUsersRequest { /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @@ -138,7 +137,11 @@ public class GetUsersRequest { public GetUsersRequest( String clientID, String xPlexToken) { - this(clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), xPlexToken); + this(clientID, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + xPlexToken); } /** @@ -245,9 +248,10 @@ public class GetUsersRequest { return xPlexToken; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) @@ -267,6 +271,7 @@ public class GetUsersRequest { return this; } + /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -285,6 +290,7 @@ public class GetUsersRequest { return this; } + /** * A relatively friendly name for the client device */ @@ -303,6 +309,7 @@ public class GetUsersRequest { return this; } + /** * The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.) */ @@ -321,6 +328,7 @@ public class GetUsersRequest { return this; } + /** * The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440) */ @@ -339,6 +347,7 @@ public class GetUsersRequest { return this; } + /** * The version of the client application. */ @@ -357,6 +366,7 @@ public class GetUsersRequest { return this; } + /** * The platform of the client application. */ @@ -375,6 +385,7 @@ public class GetUsersRequest { return this; } + /** * The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list) */ @@ -393,6 +404,7 @@ public class GetUsersRequest { return this; } + /** * A potentially less friendly identifier for the device model */ @@ -411,6 +423,7 @@ public class GetUsersRequest { return this; } + /** * The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca) */ @@ -429,6 +442,7 @@ public class GetUsersRequest { return this; } + /** * The language of the client application. */ @@ -447,6 +461,7 @@ public class GetUsersRequest { return this; } + /** * The version of the platform */ @@ -465,7 +480,6 @@ public class GetUsersRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -476,36 +490,28 @@ public class GetUsersRequest { } GetUsersRequest other = (GetUsersRequest) o; return - Objects.deepEquals(this.clientID, other.clientID) && - Objects.deepEquals(this.clientName, other.clientName) && - Objects.deepEquals(this.deviceNickname, other.deviceNickname) && - Objects.deepEquals(this.deviceName, other.deviceName) && - Objects.deepEquals(this.deviceScreenResolution, other.deviceScreenResolution) && - Objects.deepEquals(this.clientVersion, other.clientVersion) && - Objects.deepEquals(this.platform, other.platform) && - Objects.deepEquals(this.clientFeatures, other.clientFeatures) && - Objects.deepEquals(this.model, other.model) && - Objects.deepEquals(this.xPlexSessionId, other.xPlexSessionId) && - Objects.deepEquals(this.xPlexLanguage, other.xPlexLanguage) && - Objects.deepEquals(this.platformVersion, other.platformVersion) && - Objects.deepEquals(this.xPlexToken, other.xPlexToken); + Utils.enhancedDeepEquals(this.clientID, other.clientID) && + Utils.enhancedDeepEquals(this.clientName, other.clientName) && + Utils.enhancedDeepEquals(this.deviceNickname, other.deviceNickname) && + Utils.enhancedDeepEquals(this.deviceName, other.deviceName) && + Utils.enhancedDeepEquals(this.deviceScreenResolution, other.deviceScreenResolution) && + Utils.enhancedDeepEquals(this.clientVersion, other.clientVersion) && + Utils.enhancedDeepEquals(this.platform, other.platform) && + Utils.enhancedDeepEquals(this.clientFeatures, other.clientFeatures) && + Utils.enhancedDeepEquals(this.model, other.model) && + Utils.enhancedDeepEquals(this.xPlexSessionId, other.xPlexSessionId) && + Utils.enhancedDeepEquals(this.xPlexLanguage, other.xPlexLanguage) && + Utils.enhancedDeepEquals(this.platformVersion, other.platformVersion) && + Utils.enhancedDeepEquals(this.xPlexToken, other.xPlexToken); } @Override public int hashCode() { - return Objects.hash( - clientID, - clientName, - deviceNickname, - deviceName, - deviceScreenResolution, - clientVersion, - platform, - clientFeatures, - model, - xPlexSessionId, - xPlexLanguage, - platformVersion, + return Utils.enhancedHash( + clientID, clientName, deviceNickname, + deviceName, deviceScreenResolution, clientVersion, + platform, clientFeatures, model, + xPlexSessionId, xPlexLanguage, platformVersion, xPlexToken); } @@ -526,39 +532,41 @@ public class GetUsersRequest { "platformVersion", platformVersion, "xPlexToken", xPlexToken); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String clientID; - + private Optional clientName = Optional.empty(); - + private Optional deviceNickname = Optional.empty(); - + private Optional deviceName = Optional.empty(); - + private Optional deviceScreenResolution = Optional.empty(); - + private Optional clientVersion = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Optional clientFeatures = Optional.empty(); - + private Optional model = Optional.empty(); - + private Optional xPlexSessionId = Optional.empty(); - + private Optional xPlexLanguage = Optional.empty(); - + private Optional platformVersion = Optional.empty(); - + private String xPlexToken; - + private Builder() { // force use of static builder() method } + /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @@ -568,6 +576,7 @@ public class GetUsersRequest { return this; } + /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -586,6 +595,7 @@ public class GetUsersRequest { return this; } + /** * A relatively friendly name for the client device */ @@ -604,6 +614,7 @@ public class GetUsersRequest { return this; } + /** * The name of the device the client application is running on. This is used to track the client application and its usage. (Chrome, Safari, etc.) */ @@ -622,6 +633,7 @@ public class GetUsersRequest { return this; } + /** * The resolution of the device the client application is running on. This is used to track the client application and its usage. (1487x1165,2560x1440) */ @@ -640,6 +652,7 @@ public class GetUsersRequest { return this; } + /** * The version of the client application. */ @@ -658,6 +671,7 @@ public class GetUsersRequest { return this; } + /** * The platform of the client application. */ @@ -676,6 +690,7 @@ public class GetUsersRequest { return this; } + /** * The features of the client application. This is used to track the client application and its usage. (external-media,indirect-media,hub-style-list) */ @@ -694,6 +709,7 @@ public class GetUsersRequest { return this; } + /** * A potentially less friendly identifier for the device model */ @@ -712,6 +728,7 @@ public class GetUsersRequest { return this; } + /** * The session ID of the client application. This is used to track the client application and its usage. (97e136ef-4ddd-4ff3-89a7-a5820c96c2ca) */ @@ -730,6 +747,7 @@ public class GetUsersRequest { return this; } + /** * The language of the client application. */ @@ -748,6 +766,7 @@ public class GetUsersRequest { return this; } + /** * The version of the platform */ @@ -766,6 +785,7 @@ public class GetUsersRequest { return this; } + /** * An authentication token, obtained from plex.tv */ @@ -774,22 +794,16 @@ public class GetUsersRequest { this.xPlexToken = xPlexToken; return this; } - + public GetUsersRequest build() { + return new GetUsersRequest( - clientID, - clientName, - deviceNickname, - deviceName, - deviceScreenResolution, - clientVersion, - platform, - clientFeatures, - model, - xPlexSessionId, - xPlexLanguage, - platformVersion, + clientID, clientName, deviceNickname, + deviceName, deviceScreenResolution, clientVersion, + platform, clientFeatures, model, + xPlexSessionId, xPlexLanguage, platformVersion, xPlexToken); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersRequestBuilder.java index 05b443d0..89124204 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetUsers; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class GetUsersRequestBuilder { private GetUsersRequest request; private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetUsers sdk; + private final SDKConfiguration sdkConfiguration; - public GetUsersRequestBuilder(SDKMethodInterfaces.MethodCallGetUsers sdk) { - this.sdk = sdk; + public GetUsersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetUsersRequestBuilder request(GetUsersRequest request) { @@ -37,9 +41,10 @@ public class GetUsersRequestBuilder { } public GetUsersResponse call() throws Exception { + + RequestOperation operation + = new GetUsers.Sync(sdkConfiguration, serverURL); - return sdk.getUsers( - request, - serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersResponse.java index 42eadbec..621b7195 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersResponse.java @@ -14,11 +14,10 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetUsersResponse implements Response { +public class GetUsersResponse implements Response { /** * HTTP response content type for this operation */ @@ -34,6 +33,7 @@ public class GetUsersResponse implements Response { */ private HttpResponse rawResponse; + private Optional body; @JsonCreator @@ -56,7 +56,8 @@ public class GetUsersResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -85,19 +86,21 @@ public class GetUsersResponse implements Response { @JsonIgnore public Optional body() { - if (body.isEmpty()) { - try { - body = Optional.of(Utils.extractByteArrayFromBody(rawResponse)); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - } - return body; + this.body = body + .or(() -> { + try { + return Optional.of(Utils.extractByteArrayFromBody(rawResponse)); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + return this.body; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -132,13 +135,13 @@ public class GetUsersResponse implements Response { return this; } + public GetUsersResponse withBody(Optional body) { Utils.checkNotNull(body, "body"); this.body = body; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -149,18 +152,16 @@ public class GetUsersResponse implements Response { } GetUsersResponse other = (GetUsersResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.body, other.body); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.body, other.body); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, body); } @@ -172,21 +173,23 @@ public class GetUsersResponse implements Response { "rawResponse", rawResponse, "body", body); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional body = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -196,6 +199,7 @@ public class GetUsersResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -205,6 +209,7 @@ public class GetUsersResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -214,6 +219,7 @@ public class GetUsersResponse implements Response { return this; } + public Builder body(byte[] body) { Utils.checkNotNull(body, "body"); this.body = Optional.ofNullable(body); @@ -225,13 +231,13 @@ public class GetUsersResponse implements Response { this.body = body; return this; } - + public GetUsersResponse build() { + return new GetUsersResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, body); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersResponseBody.java index 265fff55..2192b0fd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersResponseBody.java @@ -9,7 +9,6 @@ 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; /** @@ -18,7 +17,6 @@ import java.util.Optional; *

Successful response with media container data in XML */ public class GetUsersResponseBody { - /** * Container holding user and server details. */ @@ -44,9 +42,10 @@ public class GetUsersResponseBody { return (Optional) mediaContainer; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Container holding user and server details. @@ -57,6 +56,7 @@ public class GetUsersResponseBody { return this; } + /** * Container holding user and server details. */ @@ -66,7 +66,6 @@ public class GetUsersResponseBody { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,12 +76,12 @@ public class GetUsersResponseBody { } GetUsersResponseBody other = (GetUsersResponseBody) o; return - Objects.deepEquals(this.mediaContainer, other.mediaContainer); + Utils.enhancedDeepEquals(this.mediaContainer, other.mediaContainer); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( mediaContainer); } @@ -91,15 +90,17 @@ public class GetUsersResponseBody { return Utils.toString(GetUsersResponseBody.class, "mediaContainer", mediaContainer); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional mediaContainer = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Container holding user and server details. */ @@ -117,10 +118,12 @@ public class GetUsersResponseBody { this.mediaContainer = mediaContainer; return this; } - + public GetUsersResponseBody build() { + return new GetUsersResponseBody( mediaContainer); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersServer.java b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersServer.java index c79bdc6f..0125c35e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetUsersServer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetUsersServer.java @@ -12,11 +12,10 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetUsersServer { +public class GetUsersServer { /** * Unique ID of the server of the connected user */ @@ -37,6 +36,7 @@ public class GetUsersServer { */ private String name; + private long lastSeenAt; /** @@ -44,10 +44,13 @@ public class GetUsersServer { */ private long numLibraries; + private Optional allLibraries; + private Optional owned; + private Optional pending; @JsonCreator @@ -88,7 +91,9 @@ public class GetUsersServer { String name, long lastSeenAt, long numLibraries) { - this(id, serverId, machineIdentifier, name, lastSeenAt, numLibraries, Optional.empty(), Optional.empty(), Optional.empty()); + this(id, serverId, machineIdentifier, + name, lastSeenAt, numLibraries, + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -154,9 +159,10 @@ public class GetUsersServer { return (Optional) pending; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique ID of the server of the connected user @@ -215,6 +221,7 @@ public class GetUsersServer { return this; } + public GetUsersServer withAllLibraries(Optional allLibraries) { Utils.checkNotNull(allLibraries, "allLibraries"); this.allLibraries = allLibraries; @@ -227,6 +234,7 @@ public class GetUsersServer { return this; } + public GetUsersServer withOwned(Optional owned) { Utils.checkNotNull(owned, "owned"); this.owned = owned; @@ -239,13 +247,13 @@ public class GetUsersServer { return this; } + public GetUsersServer withPending(Optional pending) { Utils.checkNotNull(pending, "pending"); this.pending = pending; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -256,29 +264,23 @@ public class GetUsersServer { } GetUsersServer other = (GetUsersServer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.serverId, other.serverId) && - Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) && - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.lastSeenAt, other.lastSeenAt) && - Objects.deepEquals(this.numLibraries, other.numLibraries) && - Objects.deepEquals(this.allLibraries, other.allLibraries) && - Objects.deepEquals(this.owned, other.owned) && - Objects.deepEquals(this.pending, other.pending); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.serverId, other.serverId) && + Utils.enhancedDeepEquals(this.machineIdentifier, other.machineIdentifier) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.lastSeenAt, other.lastSeenAt) && + Utils.enhancedDeepEquals(this.numLibraries, other.numLibraries) && + Utils.enhancedDeepEquals(this.allLibraries, other.allLibraries) && + Utils.enhancedDeepEquals(this.owned, other.owned) && + Utils.enhancedDeepEquals(this.pending, other.pending); } @Override public int hashCode() { - return Objects.hash( - id, - serverId, - machineIdentifier, - name, - lastSeenAt, - numLibraries, - allLibraries, - owned, - pending); + return Utils.enhancedHash( + id, serverId, machineIdentifier, + name, lastSeenAt, numLibraries, + allLibraries, owned, pending); } @Override @@ -294,31 +296,33 @@ public class GetUsersServer { "owned", owned, "pending", pending); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Long serverId; - + private String machineIdentifier; - + private String name; - + private Long lastSeenAt; - + private Long numLibraries; - + private Optional allLibraries; - + private Optional owned; - + private Optional pending; - + private Builder() { // force use of static builder() method } + /** * Unique ID of the server of the connected user */ @@ -328,6 +332,7 @@ public class GetUsersServer { return this; } + /** * ID of the actual Plex server. */ @@ -337,6 +342,7 @@ public class GetUsersServer { return this; } + /** * Machine identifier of the Plex server. */ @@ -346,6 +352,7 @@ public class GetUsersServer { return this; } + /** * Name of the Plex server of the connected user. */ @@ -355,12 +362,14 @@ public class GetUsersServer { return this; } + public Builder lastSeenAt(long lastSeenAt) { Utils.checkNotNull(lastSeenAt, "lastSeenAt"); this.lastSeenAt = lastSeenAt; return this; } + /** * Number of libraries in the server this user has access to. */ @@ -370,6 +379,7 @@ public class GetUsersServer { return this; } + public Builder allLibraries(AllLibraries allLibraries) { Utils.checkNotNull(allLibraries, "allLibraries"); this.allLibraries = Optional.ofNullable(allLibraries); @@ -382,6 +392,7 @@ public class GetUsersServer { return this; } + public Builder owned(Owned owned) { Utils.checkNotNull(owned, "owned"); this.owned = Optional.ofNullable(owned); @@ -394,6 +405,7 @@ public class GetUsersServer { return this; } + public Builder pending(Pending pending) { Utils.checkNotNull(pending, "pending"); this.pending = Optional.ofNullable(pending); @@ -405,7 +417,7 @@ public class GetUsersServer { this.pending = pending; return this; } - + public GetUsersServer build() { if (allLibraries == null) { allLibraries = _SINGLETON_VALUE_AllLibraries.value(); @@ -416,18 +428,14 @@ public class GetUsersServer { if (pending == null) { pending = _SINGLETON_VALUE_Pending.value(); } + return new GetUsersServer( - id, - serverId, - machineIdentifier, - name, - lastSeenAt, - numLibraries, - allLibraries, - owned, - pending); + id, serverId, machineIdentifier, + name, lastSeenAt, numLibraries, + allLibraries, owned, pending); } + private static final LazySingletonValue> _SINGLETON_VALUE_AllLibraries = new LazySingletonValue<>( "allLibraries", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequest.java index 1580592f..ab58d385 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequest.java @@ -13,11 +13,10 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class GetWatchListRequest { +public class GetWatchListRequest { /** * Filter */ @@ -113,7 +112,9 @@ public class GetWatchListRequest { public GetWatchListRequest( Filter filter, String xPlexToken) { - this(filter, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), xPlexToken); + this(filter, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), xPlexToken); } /** @@ -198,9 +199,10 @@ public class GetWatchListRequest { return xPlexToken; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Filter @@ -222,6 +224,7 @@ public class GetWatchListRequest { return this; } + /** * In the format "field:dir". Available fields are "watchlistedAt" (Added At), * "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). @@ -242,6 +245,7 @@ public class GetWatchListRequest { return this; } + /** * The type of library to filter. Can be "movie" or "show", or all if not present. */ @@ -261,6 +265,7 @@ public class GetWatchListRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -280,6 +285,7 @@ public class GetWatchListRequest { return this; } + /** * include collections in the results */ @@ -298,6 +304,7 @@ public class GetWatchListRequest { return this; } + /** * include external media in the results */ @@ -318,6 +325,7 @@ public class GetWatchListRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -340,6 +348,7 @@ public class GetWatchListRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -360,7 +369,6 @@ public class GetWatchListRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -371,29 +379,23 @@ public class GetWatchListRequest { } GetWatchListRequest other = (GetWatchListRequest) o; return - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.sort, other.sort) && - Objects.deepEquals(this.libtype, other.libtype) && - Objects.deepEquals(this.maxresults, other.maxresults) && - Objects.deepEquals(this.includeCollections, other.includeCollections) && - Objects.deepEquals(this.includeExternalMedia, other.includeExternalMedia) && - Objects.deepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && - Objects.deepEquals(this.xPlexContainerSize, other.xPlexContainerSize) && - Objects.deepEquals(this.xPlexToken, other.xPlexToken); + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.sort, other.sort) && + Utils.enhancedDeepEquals(this.libtype, other.libtype) && + Utils.enhancedDeepEquals(this.maxresults, other.maxresults) && + Utils.enhancedDeepEquals(this.includeCollections, other.includeCollections) && + Utils.enhancedDeepEquals(this.includeExternalMedia, other.includeExternalMedia) && + Utils.enhancedDeepEquals(this.xPlexContainerStart, other.xPlexContainerStart) && + Utils.enhancedDeepEquals(this.xPlexContainerSize, other.xPlexContainerSize) && + Utils.enhancedDeepEquals(this.xPlexToken, other.xPlexToken); } @Override public int hashCode() { - return Objects.hash( - filter, - sort, - libtype, - maxresults, - includeCollections, - includeExternalMedia, - xPlexContainerStart, - xPlexContainerSize, - xPlexToken); + return Utils.enhancedHash( + filter, sort, libtype, + maxresults, includeCollections, includeExternalMedia, + xPlexContainerStart, xPlexContainerSize, xPlexToken); } @Override @@ -409,31 +411,33 @@ public class GetWatchListRequest { "xPlexContainerSize", xPlexContainerSize, "xPlexToken", xPlexToken); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Filter filter; - + private Optional sort = Optional.empty(); - + private Optional libtype = Optional.empty(); - + private Optional maxresults = Optional.empty(); - + private Optional includeCollections = Optional.empty(); - + private Optional includeExternalMedia = Optional.empty(); - + private Optional xPlexContainerStart; - + private Optional xPlexContainerSize; - + private String xPlexToken; - + private Builder() { // force use of static builder() method } + /** * Filter */ @@ -443,6 +447,7 @@ public class GetWatchListRequest { return this; } + /** * In the format "field:dir". Available fields are "watchlistedAt" (Added At), * "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). @@ -465,6 +470,7 @@ public class GetWatchListRequest { return this; } + /** * The type of library to filter. Can be "movie" or "show", or all if not present. */ @@ -483,6 +489,7 @@ public class GetWatchListRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -503,6 +510,7 @@ public class GetWatchListRequest { return this; } + /** * include collections in the results */ @@ -521,6 +529,7 @@ public class GetWatchListRequest { return this; } + /** * include external media in the results */ @@ -539,6 +548,7 @@ public class GetWatchListRequest { return this; } + /** * The index of the first item to return. If not specified, the first item will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -561,6 +571,7 @@ public class GetWatchListRequest { return this; } + /** * The number of items to return. If not specified, all items will be returned. * If the number of items exceeds the limit, the response will be paginated. @@ -583,6 +594,7 @@ public class GetWatchListRequest { return this; } + /** * An authentication token, obtained from plex.tv */ @@ -591,7 +603,7 @@ public class GetWatchListRequest { this.xPlexToken = xPlexToken; return this; } - + public GetWatchListRequest build() { if (xPlexContainerStart == null) { xPlexContainerStart = _SINGLETON_VALUE_XPlexContainerStart.value(); @@ -599,18 +611,14 @@ public class GetWatchListRequest { if (xPlexContainerSize == null) { xPlexContainerSize = _SINGLETON_VALUE_XPlexContainerSize.value(); } + return new GetWatchListRequest( - filter, - sort, - libtype, - maxresults, - includeCollections, - includeExternalMedia, - xPlexContainerStart, - xPlexContainerSize, - xPlexToken); + filter, sort, libtype, + maxresults, includeCollections, includeExternalMedia, + xPlexContainerStart, xPlexContainerSize, xPlexToken); } + private static final LazySingletonValue> _SINGLETON_VALUE_XPlexContainerStart = new LazySingletonValue<>( "X-Plex-Container-Start", 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 557a7d3b..9f4f1980 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetWatchList; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class GetWatchListRequestBuilder { private GetWatchListRequest request; private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallGetWatchList sdk; + private final SDKConfiguration sdkConfiguration; - public GetWatchListRequestBuilder(SDKMethodInterfaces.MethodCallGetWatchList sdk) { - this.sdk = sdk; + public GetWatchListRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public GetWatchListRequestBuilder request(GetWatchListRequest request) { @@ -37,9 +41,10 @@ public class GetWatchListRequestBuilder { } public GetWatchListResponse call() throws Exception { + + RequestOperation operation + = new GetWatchList.Sync(sdkConfiguration, serverURL); - return sdk.getWatchList( - request, - serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListResponse.java index 3576fcb3..4b04793a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class GetWatchListResponse implements Response { +public class GetWatchListResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class GetWatchListResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class GetWatchListResponse implements Response { return (Optional) object; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class GetWatchListResponse implements Response { return this; } + /** * Watchlist Data */ @@ -143,7 +145,6 @@ public class GetWatchListResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class GetWatchListResponse implements Response { } GetWatchListResponse other = (GetWatchListResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.object, other.object); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, object); } @@ -177,21 +176,23 @@ public class GetWatchListResponse implements Response { "rawResponse", rawResponse, "object", object); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional object = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class GetWatchListResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class GetWatchListResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class GetWatchListResponse implements Response { return this; } + /** * Watchlist Data */ @@ -236,13 +240,13 @@ public class GetWatchListResponse implements Response { this.object = object; return this; } - + public GetWatchListResponse build() { + return new GetWatchListResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, object); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListResponseBody.java index 6d8a5067..02628579 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/GetWatchListResponseBody.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -28,26 +27,32 @@ public class GetWatchListResponseBody { @JsonProperty("librarySectionID") private Optional librarySectionID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("librarySectionTitle") private Optional librarySectionTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("offset") private Optional offset; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("totalSize") private Optional totalSize; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -78,7 +83,9 @@ public class GetWatchListResponseBody { } public GetWatchListResponseBody() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -117,9 +124,10 @@ public class GetWatchListResponseBody { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public GetWatchListResponseBody withLibrarySectionID(String librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); @@ -127,6 +135,7 @@ public class GetWatchListResponseBody { return this; } + public GetWatchListResponseBody withLibrarySectionID(Optional librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = librarySectionID; @@ -139,6 +148,7 @@ public class GetWatchListResponseBody { return this; } + public GetWatchListResponseBody withLibrarySectionTitle(Optional librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = librarySectionTitle; @@ -151,6 +161,7 @@ public class GetWatchListResponseBody { return this; } + public GetWatchListResponseBody withOffset(Optional offset) { Utils.checkNotNull(offset, "offset"); this.offset = offset; @@ -163,6 +174,7 @@ public class GetWatchListResponseBody { return this; } + public GetWatchListResponseBody withTotalSize(Optional totalSize) { Utils.checkNotNull(totalSize, "totalSize"); this.totalSize = totalSize; @@ -175,6 +187,7 @@ public class GetWatchListResponseBody { return this; } + public GetWatchListResponseBody withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -187,6 +200,7 @@ public class GetWatchListResponseBody { return this; } + public GetWatchListResponseBody withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -199,13 +213,13 @@ public class GetWatchListResponseBody { return this; } + public GetWatchListResponseBody withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -216,24 +230,20 @@ public class GetWatchListResponseBody { } GetWatchListResponseBody other = (GetWatchListResponseBody) o; return - Objects.deepEquals(this.librarySectionID, other.librarySectionID) && - Objects.deepEquals(this.librarySectionTitle, other.librarySectionTitle) && - Objects.deepEquals(this.offset, other.offset) && - Objects.deepEquals(this.totalSize, other.totalSize) && - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.librarySectionID, other.librarySectionID) && + Utils.enhancedDeepEquals(this.librarySectionTitle, other.librarySectionTitle) && + Utils.enhancedDeepEquals(this.offset, other.offset) && + Utils.enhancedDeepEquals(this.totalSize, other.totalSize) && + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - librarySectionID, - librarySectionTitle, - offset, - totalSize, - identifier, - size, + return Utils.enhancedHash( + librarySectionID, librarySectionTitle, offset, + totalSize, identifier, size, metadata); } @@ -248,27 +258,29 @@ public class GetWatchListResponseBody { "size", size, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional librarySectionID = Optional.empty(); - + private Optional librarySectionTitle = Optional.empty(); - + private Optional offset = Optional.empty(); - + private Optional totalSize = Optional.empty(); - + private Optional identifier = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder librarySectionID(String librarySectionID) { Utils.checkNotNull(librarySectionID, "librarySectionID"); this.librarySectionID = Optional.ofNullable(librarySectionID); @@ -281,6 +293,7 @@ public class GetWatchListResponseBody { return this; } + public Builder librarySectionTitle(String librarySectionTitle) { Utils.checkNotNull(librarySectionTitle, "librarySectionTitle"); this.librarySectionTitle = Optional.ofNullable(librarySectionTitle); @@ -293,6 +306,7 @@ public class GetWatchListResponseBody { return this; } + public Builder offset(int offset) { Utils.checkNotNull(offset, "offset"); this.offset = Optional.ofNullable(offset); @@ -305,6 +319,7 @@ public class GetWatchListResponseBody { return this; } + public Builder totalSize(int totalSize) { Utils.checkNotNull(totalSize, "totalSize"); this.totalSize = Optional.ofNullable(totalSize); @@ -317,6 +332,7 @@ public class GetWatchListResponseBody { return this; } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -329,6 +345,7 @@ public class GetWatchListResponseBody { return this; } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -341,6 +358,7 @@ public class GetWatchListResponseBody { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -352,16 +370,14 @@ public class GetWatchListResponseBody { this.metadata = metadata; return this; } - + public GetWatchListResponseBody build() { + return new GetWatchListResponseBody( - librarySectionID, - librarySectionTitle, - offset, - totalSize, - identifier, - size, + librarySectionID, librarySectionTitle, offset, + totalSize, identifier, size, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Guids.java b/src/main/java/dev/plexapi/sdk/models/operations/Guids.java index cb81721a..6f39fbce 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Guids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Guids.java @@ -9,10 +9,9 @@ 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 Guids { - /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -34,9 +33,10 @@ public class Guids { return id; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// @@ -47,7 +47,6 @@ public class Guids { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class Guids { } Guids other = (Guids) o; return - Objects.deepEquals(this.id, other.id); + Utils.enhancedDeepEquals(this.id, other.id); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( id); } @@ -72,15 +71,17 @@ public class Guids { return Utils.toString(Guids.class, "id", id); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String id; - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the Guid. Can be prefixed with imdb://, tmdb://, tvdb:// */ @@ -89,10 +90,12 @@ public class Guids { this.id = id; return this; } - + public Guids build() { + return new Guids( id); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/HasThumbnail.java b/src/main/java/dev/plexapi/sdk/models/operations/HasThumbnail.java index baeae247..08890774 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/HasThumbnail.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/HasThumbnail.java @@ -20,7 +20,7 @@ public enum HasThumbnail { @JsonValue private final String value; - private HasThumbnail(String value) { + HasThumbnail(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Hidden.java b/src/main/java/dev/plexapi/sdk/models/operations/Hidden.java index 8faba5ae..6975125c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Hidden.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Hidden.java @@ -20,7 +20,7 @@ public enum Hidden { @JsonValue private final int value; - private Hidden(int value) { + Hidden(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Home.java b/src/main/java/dev/plexapi/sdk/models/operations/Home.java index e4172f50..b4b279f4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Home.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Home.java @@ -19,7 +19,7 @@ public enum Home { @JsonValue private final int value; - private Home(int value) { + Home(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Hub.java b/src/main/java/dev/plexapi/sdk/models/operations/Hub.java index f25dbd4b..dcbfb914 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Hub.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Hub.java @@ -15,51 +15,61 @@ 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 Hub { @JsonInclude(Include.NON_ABSENT) @JsonProperty("hubKey") private Optional hubKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hubIdentifier") private Optional hubIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("context") private Optional context; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("more") private Optional more; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("style") private Optional style; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("promoted") private Optional promoted; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional> metadata; @@ -102,7 +112,10 @@ public class Hub { } public Hub() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -161,9 +174,10 @@ public class Hub { return (Optional>) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Hub withHubKey(String hubKey) { Utils.checkNotNull(hubKey, "hubKey"); @@ -171,6 +185,7 @@ public class Hub { return this; } + public Hub withHubKey(Optional hubKey) { Utils.checkNotNull(hubKey, "hubKey"); this.hubKey = hubKey; @@ -183,6 +198,7 @@ public class Hub { return this; } + public Hub withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -195,6 +211,7 @@ public class Hub { return this; } + public Hub withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -207,6 +224,7 @@ public class Hub { return this; } + public Hub withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -219,6 +237,7 @@ public class Hub { return this; } + public Hub withHubIdentifier(Optional hubIdentifier) { Utils.checkNotNull(hubIdentifier, "hubIdentifier"); this.hubIdentifier = hubIdentifier; @@ -231,6 +250,7 @@ public class Hub { return this; } + public Hub withContext(Optional context) { Utils.checkNotNull(context, "context"); this.context = context; @@ -243,6 +263,7 @@ public class Hub { return this; } + public Hub withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -255,6 +276,7 @@ public class Hub { return this; } + public Hub withMore(Optional more) { Utils.checkNotNull(more, "more"); this.more = more; @@ -267,6 +289,7 @@ public class Hub { return this; } + public Hub withStyle(Optional style) { Utils.checkNotNull(style, "style"); this.style = style; @@ -279,6 +302,7 @@ public class Hub { return this; } + public Hub withPromoted(Optional promoted) { Utils.checkNotNull(promoted, "promoted"); this.promoted = promoted; @@ -291,13 +315,13 @@ public class Hub { return this; } + public Hub withMetadata(Optional> metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -308,33 +332,26 @@ public class Hub { } Hub other = (Hub) o; return - Objects.deepEquals(this.hubKey, other.hubKey) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.hubIdentifier, other.hubIdentifier) && - Objects.deepEquals(this.context, other.context) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.more, other.more) && - Objects.deepEquals(this.style, other.style) && - Objects.deepEquals(this.promoted, other.promoted) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.hubKey, other.hubKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.hubIdentifier, other.hubIdentifier) && + Utils.enhancedDeepEquals(this.context, other.context) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.more, other.more) && + Utils.enhancedDeepEquals(this.style, other.style) && + Utils.enhancedDeepEquals(this.promoted, other.promoted) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - hubKey, - key, - title, - type, - hubIdentifier, - context, - size, - more, - style, - promoted, - metadata); + return Utils.enhancedHash( + hubKey, key, title, + type, hubIdentifier, context, + size, more, style, + promoted, metadata); } @Override @@ -352,35 +369,37 @@ public class Hub { "promoted", promoted, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional hubKey = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional hubIdentifier = Optional.empty(); - + private Optional context = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional more = Optional.empty(); - + private Optional style = Optional.empty(); - + private Optional promoted = Optional.empty(); - + private Optional> metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder hubKey(String hubKey) { Utils.checkNotNull(hubKey, "hubKey"); this.hubKey = Optional.ofNullable(hubKey); @@ -393,6 +412,7 @@ public class Hub { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -405,6 +425,7 @@ public class Hub { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -417,6 +438,7 @@ public class Hub { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -429,6 +451,7 @@ public class Hub { return this; } + public Builder hubIdentifier(String hubIdentifier) { Utils.checkNotNull(hubIdentifier, "hubIdentifier"); this.hubIdentifier = Optional.ofNullable(hubIdentifier); @@ -441,6 +464,7 @@ public class Hub { return this; } + public Builder context(String context) { Utils.checkNotNull(context, "context"); this.context = Optional.ofNullable(context); @@ -453,6 +477,7 @@ public class Hub { return this; } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -465,6 +490,7 @@ public class Hub { return this; } + public Builder more(boolean more) { Utils.checkNotNull(more, "more"); this.more = Optional.ofNullable(more); @@ -477,6 +503,7 @@ public class Hub { return this; } + public Builder style(String style) { Utils.checkNotNull(style, "style"); this.style = Optional.ofNullable(style); @@ -489,6 +516,7 @@ public class Hub { return this; } + public Builder promoted(boolean promoted) { Utils.checkNotNull(promoted, "promoted"); this.promoted = Optional.ofNullable(promoted); @@ -501,6 +529,7 @@ public class Hub { return this; } + public Builder metadata(List metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -512,20 +541,15 @@ public class Hub { this.metadata = metadata; return this; } - + public Hub build() { + return new Hub( - hubKey, - key, - title, - type, - hubIdentifier, - context, - size, - more, - style, - promoted, - metadata); + hubKey, key, title, + type, hubIdentifier, context, + size, more, style, + promoted, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Image.java b/src/main/java/dev/plexapi/sdk/models/operations/Image.java index 5bc20b66..94e32dd7 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Image.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Image.java @@ -11,19 +11,21 @@ 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 Image { @JsonInclude(Include.NON_ABSENT) @JsonProperty("alt") private Optional alt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("url") private Optional url; @@ -60,9 +62,10 @@ public class Image { return url; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Image withAlt(String alt) { Utils.checkNotNull(alt, "alt"); @@ -70,6 +73,7 @@ public class Image { return this; } + public Image withAlt(Optional alt) { Utils.checkNotNull(alt, "alt"); this.alt = alt; @@ -82,6 +86,7 @@ public class Image { return this; } + public Image withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -94,13 +99,13 @@ public class Image { return this; } + public Image withUrl(Optional url) { Utils.checkNotNull(url, "url"); this.url = url; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,17 +116,15 @@ public class Image { } Image other = (Image) o; return - Objects.deepEquals(this.alt, other.alt) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.url, other.url); + Utils.enhancedDeepEquals(this.alt, other.alt) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.url, other.url); } @Override public int hashCode() { - return Objects.hash( - alt, - type, - url); + return Utils.enhancedHash( + alt, type, url); } @Override @@ -131,19 +134,21 @@ public class Image { "type", type, "url", url); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional alt = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional url = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder alt(String alt) { Utils.checkNotNull(alt, "alt"); this.alt = Optional.ofNullable(alt); @@ -156,6 +161,7 @@ public class Image { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -168,6 +174,7 @@ public class Image { return this; } + public Builder url(String url) { Utils.checkNotNull(url, "url"); this.url = Optional.ofNullable(url); @@ -179,12 +186,12 @@ public class Image { this.url = url; return this; } - + public Image build() { + return new Image( - alt, - type, - url); + alt, type, url); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeAdvanced.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeAdvanced.java index 22143ff3..8e141e01 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeAdvanced.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeAdvanced.java @@ -17,7 +17,7 @@ public enum IncludeAdvanced { @JsonValue private final int value; - private IncludeAdvanced(int value) { + IncludeAdvanced(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeCollections.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeCollections.java index 74257d11..ce0df524 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeCollections.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeCollections.java @@ -19,7 +19,7 @@ public enum IncludeCollections { @JsonValue private final long value; - private IncludeCollections(long value) { + IncludeCollections(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeDetails.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeDetails.java index 94cc24c0..f500e72c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeDetails.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeDetails.java @@ -20,7 +20,7 @@ public enum IncludeDetails { @JsonValue private final long value; - private IncludeDetails(long value) { + IncludeDetails(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/IncludeExternalMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/IncludeExternalMedia.java index 5f315fe7..0cb59fba 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeExternalMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeExternalMedia.java @@ -19,7 +19,7 @@ public enum IncludeExternalMedia { @JsonValue private final long value; - private IncludeExternalMedia(long value) { + IncludeExternalMedia(long value) { this.value = value; } 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 61d73941..3030c163 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeGuids.java @@ -19,7 +19,7 @@ public enum IncludeGuids { @JsonValue private final int value; - private IncludeGuids(int value) { + IncludeGuids(int value) { this.value = 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 d79f273c..452059af 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeHttps.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeHttps.java @@ -19,7 +19,7 @@ public enum IncludeHttps { @JsonValue private final int value; - private IncludeHttps(int value) { + IncludeHttps(int value) { this.value = 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 58272d90..0e0bff5e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeIPv6.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeIPv6.java @@ -19,7 +19,7 @@ public enum IncludeIPv6 { @JsonValue private final int value; - private IncludeIPv6(int value) { + IncludeIPv6(int value) { this.value = 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 73f25897..a8f84c4e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeMeta.java @@ -19,7 +19,7 @@ public enum IncludeMeta { @JsonValue private final int value; - private IncludeMeta(int value) { + IncludeMeta(int value) { this.value = 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 fa6a397f..75c6000c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/IncludeRelay.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/IncludeRelay.java @@ -20,7 +20,7 @@ public enum IncludeRelay { @JsonValue private final int value; - private IncludeRelay(int value) { + IncludeRelay(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/InternalPaymentMethod.java b/src/main/java/dev/plexapi/sdk/models/operations/InternalPaymentMethod.java index 10fd509b..faf6c0b2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/InternalPaymentMethod.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/InternalPaymentMethod.java @@ -7,21 +7,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class InternalPaymentMethod { - @JsonCreator public InternalPaymentMethod() { - - } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -35,7 +32,7 @@ public class InternalPaymentMethod { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } @@ -43,16 +40,19 @@ public class InternalPaymentMethod { public String toString() { return Utils.toString(InternalPaymentMethod.class); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Builder() { // force use of static builder() method } - + public InternalPaymentMethod build() { + return new InternalPaymentMethod( ); } + } } 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 8ab14af9..c32854b0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Location.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Location.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * Location @@ -33,9 +32,10 @@ public class Location { return path; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Location withPath(String path) { Utils.checkNotNull(path, "path"); @@ -43,7 +43,6 @@ public class Location { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -54,12 +53,12 @@ public class Location { } Location other = (Location) o; return - Objects.deepEquals(this.path, other.path); + Utils.enhancedDeepEquals(this.path, other.path); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( path); } @@ -68,24 +67,28 @@ public class Location { return Utils.toString(Location.class, "path", path); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String path; - + private Builder() { // force use of static builder() method } + public Builder path(String path) { Utils.checkNotNull(path, "path"); this.path = path; return this; } - + public Location build() { + return new Location( path); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequest.java index 0d2011fc..c43549f3 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class LogLineRequest { - /** * An integer log level to write to the PMS log with. * 0: Error @@ -78,9 +77,10 @@ public class LogLineRequest { return source; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * An integer log level to write to the PMS log with. @@ -114,7 +114,6 @@ public class LogLineRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -125,17 +124,15 @@ public class LogLineRequest { } LogLineRequest other = (LogLineRequest) o; return - Objects.deepEquals(this.level, other.level) && - Objects.deepEquals(this.message, other.message) && - Objects.deepEquals(this.source, other.source); + Utils.enhancedDeepEquals(this.level, other.level) && + Utils.enhancedDeepEquals(this.message, other.message) && + Utils.enhancedDeepEquals(this.source, other.source); } @Override public int hashCode() { - return Objects.hash( - level, - message, - source); + return Utils.enhancedHash( + level, message, source); } @Override @@ -145,19 +142,21 @@ public class LogLineRequest { "message", message, "source", source); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Level level; - + private String message; - + private String source; - + private Builder() { // force use of static builder() method } + /** * An integer log level to write to the PMS log with. * 0: Error @@ -172,6 +171,7 @@ public class LogLineRequest { return this; } + /** * The text of the message to write to the log. */ @@ -181,6 +181,7 @@ public class LogLineRequest { return this; } + /** * a string indicating the source of the message. */ @@ -189,12 +190,12 @@ public class LogLineRequest { this.source = source; return this; } - + public LogLineRequest build() { + return new LogLineRequest( - level, - message, - source); + level, message, source); } + } } 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 ad94ea62..e1b898df 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogLineRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.LogLine; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class LogLineRequestBuilder { private Level level; private String message; private String source; - private final SDKMethodInterfaces.MethodCallLogLine sdk; + private final SDKConfiguration sdkConfiguration; - public LogLineRequestBuilder(SDKMethodInterfaces.MethodCallLogLine sdk) { - this.sdk = sdk; + public LogLineRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public LogLineRequestBuilder level(Level level) { @@ -36,11 +40,22 @@ public class LogLineRequestBuilder { return this; } - public LogLineResponse call() throws Exception { - return sdk.logLine( - level, + private LogLineRequest buildRequest() { + + LogLineRequest request = new LogLineRequest(level, message, source); + + return request; + } + + public LogLineResponse call() throws Exception { + + RequestOperation operation + = new LogLine.Sync(sdkConfiguration); + LogLineRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/LogLineResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/LogLineResponse.java index b61c4a51..b14ee54b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogLineResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogLineResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class LogLineResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class LogLineResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class LogLineResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class LogLineResponse implements Response { } LogLineResponse other = (LogLineResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class LogLineResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class LogLineResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class LogLineResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class LogLineResponse implements Response { this.rawResponse = rawResponse; return this; } - + public LogLineResponse build() { + return new LogLineResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } 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 dfcd8741..1ab3ae04 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.LogMultiLine; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ import java.lang.String; public class LogMultiLineRequestBuilder { private String request; - private final SDKMethodInterfaces.MethodCallLogMultiLine sdk; + private final SDKConfiguration sdkConfiguration; - public LogMultiLineRequestBuilder(SDKMethodInterfaces.MethodCallLogMultiLine sdk) { - this.sdk = sdk; + public LogMultiLineRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public LogMultiLineRequestBuilder request(String request) { @@ -23,8 +27,10 @@ public class LogMultiLineRequestBuilder { } public LogMultiLineResponse call() throws Exception { + + RequestOperation operation + = new LogMultiLine.Sync(sdkConfiguration); - return sdk.logMultiLine( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineResponse.java index d329e6d4..ae40fdfd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/LogMultiLineResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class LogMultiLineResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class LogMultiLineResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class LogMultiLineResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class LogMultiLineResponse implements Response { } LogMultiLineResponse other = (LogMultiLineResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class LogMultiLineResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class LogMultiLineResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class LogMultiLineResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class LogMultiLineResponse implements Response { this.rawResponse = rawResponse; return this; } - + public LogMultiLineResponse build() { + return new LogMultiLineResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequest.java index b8af7691..e3390e88 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class MarkPlayedRequest { - /** * The media key to mark as played */ @@ -35,9 +34,10 @@ public class MarkPlayedRequest { return key; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The media key to mark as played @@ -48,7 +48,6 @@ public class MarkPlayedRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,12 +58,12 @@ public class MarkPlayedRequest { } MarkPlayedRequest other = (MarkPlayedRequest) o; return - Objects.deepEquals(this.key, other.key); + Utils.enhancedDeepEquals(this.key, other.key); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( key); } @@ -73,15 +72,17 @@ public class MarkPlayedRequest { return Utils.toString(MarkPlayedRequest.class, "key", key); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double key; - + private Builder() { // force use of static builder() method } + /** * The media key to mark as played */ @@ -90,10 +91,12 @@ public class MarkPlayedRequest { this.key = key; return this; } - + public MarkPlayedRequest build() { + return new MarkPlayedRequest( key); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequestBuilder.java index f896ad7f..83f0d3e2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.MarkPlayed; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -10,10 +14,10 @@ import java.lang.Exception; public class MarkPlayedRequestBuilder { private Double key; - private final SDKMethodInterfaces.MethodCallMarkPlayed sdk; + private final SDKConfiguration sdkConfiguration; - public MarkPlayedRequestBuilder(SDKMethodInterfaces.MethodCallMarkPlayed sdk) { - this.sdk = sdk; + public MarkPlayedRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public MarkPlayedRequestBuilder key(double key) { @@ -22,9 +26,20 @@ public class MarkPlayedRequestBuilder { return this; } - public MarkPlayedResponse call() throws Exception { - return sdk.markPlayed( - key); + private MarkPlayedRequest buildRequest() { + + MarkPlayedRequest request = new MarkPlayedRequest(key); + + return request; + } + + public MarkPlayedResponse call() throws Exception { + + RequestOperation operation + = new MarkPlayed.Sync(sdkConfiguration); + MarkPlayedRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedResponse.java index 5ee290c9..ba2fae04 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MarkPlayedResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class MarkPlayedResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class MarkPlayedResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class MarkPlayedResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class MarkPlayedResponse implements Response { } MarkPlayedResponse other = (MarkPlayedResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class MarkPlayedResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class MarkPlayedResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class MarkPlayedResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class MarkPlayedResponse implements Response { this.rawResponse = rawResponse; return this; } - + public MarkPlayedResponse build() { + return new MarkPlayedResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequest.java index dcb12f3a..8ead217a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class MarkUnplayedRequest { - /** * The media key to mark as Unplayed */ @@ -35,9 +34,10 @@ public class MarkUnplayedRequest { return key; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The media key to mark as Unplayed @@ -48,7 +48,6 @@ public class MarkUnplayedRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,12 +58,12 @@ public class MarkUnplayedRequest { } MarkUnplayedRequest other = (MarkUnplayedRequest) o; return - Objects.deepEquals(this.key, other.key); + Utils.enhancedDeepEquals(this.key, other.key); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( key); } @@ -73,15 +72,17 @@ public class MarkUnplayedRequest { return Utils.toString(MarkUnplayedRequest.class, "key", key); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double key; - + private Builder() { // force use of static builder() method } + /** * The media key to mark as Unplayed */ @@ -90,10 +91,12 @@ public class MarkUnplayedRequest { this.key = key; return this; } - + public MarkUnplayedRequest build() { + return new MarkUnplayedRequest( key); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequestBuilder.java index f217697e..69030721 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.MarkUnplayed; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -10,10 +14,10 @@ import java.lang.Exception; public class MarkUnplayedRequestBuilder { private Double key; - private final SDKMethodInterfaces.MethodCallMarkUnplayed sdk; + private final SDKConfiguration sdkConfiguration; - public MarkUnplayedRequestBuilder(SDKMethodInterfaces.MethodCallMarkUnplayed sdk) { - this.sdk = sdk; + public MarkUnplayedRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public MarkUnplayedRequestBuilder key(double key) { @@ -22,9 +26,20 @@ public class MarkUnplayedRequestBuilder { return this; } - public MarkUnplayedResponse call() throws Exception { - return sdk.markUnplayed( - key); + private MarkUnplayedRequest buildRequest() { + + MarkUnplayedRequest request = new MarkUnplayedRequest(key); + + return request; + } + + public MarkUnplayedResponse call() throws Exception { + + RequestOperation operation + = new MarkUnplayed.Sync(sdkConfiguration); + MarkUnplayedRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedResponse.java index 2df891f8..07179d62 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MarkUnplayedResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class MarkUnplayedResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class MarkUnplayedResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class MarkUnplayedResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class MarkUnplayedResponse implements Response { } MarkUnplayedResponse other = (MarkUnplayedResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class MarkUnplayedResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class MarkUnplayedResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class MarkUnplayedResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class MarkUnplayedResponse implements Response { this.rawResponse = rawResponse; return this; } - + public MarkUnplayedResponse build() { + return new MarkUnplayedResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Marker.java b/src/main/java/dev/plexapi/sdk/models/operations/Marker.java index 2cd3b61e..0d8b848f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Marker.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Marker.java @@ -14,7 +14,6 @@ import java.lang.Long; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; /** @@ -27,15 +26,19 @@ public class Marker { @JsonProperty("id") private long id; + @JsonProperty("type") private String type; + @JsonProperty("startTimeOffset") private long startTimeOffset; + @JsonProperty("endTimeOffset") private long endTimeOffset; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("final") private Optional final_; @@ -74,7 +77,8 @@ public class Marker { String type, long startTimeOffset, long endTimeOffset) { - this(id, type, startTimeOffset, endTimeOffset, Optional.empty(), Optional.empty()); + this(id, type, startTimeOffset, + endTimeOffset, Optional.empty(), Optional.empty()); } @JsonIgnore @@ -111,9 +115,10 @@ public class Marker { return (Optional) attributes; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Marker withId(long id) { Utils.checkNotNull(id, "id"); @@ -145,6 +150,7 @@ public class Marker { return this; } + public Marker withFinal(Optional final_) { Utils.checkNotNull(final_, "final_"); this.final_ = final_; @@ -160,6 +166,7 @@ public class Marker { return this; } + /** * Attributes associated with the marker. */ @@ -169,7 +176,6 @@ public class Marker { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -180,23 +186,19 @@ public class Marker { } Marker other = (Marker) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.startTimeOffset, other.startTimeOffset) && - Objects.deepEquals(this.endTimeOffset, other.endTimeOffset) && - Objects.deepEquals(this.final_, other.final_) && - Objects.deepEquals(this.attributes, other.attributes); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.startTimeOffset, other.startTimeOffset) && + Utils.enhancedDeepEquals(this.endTimeOffset, other.endTimeOffset) && + Utils.enhancedDeepEquals(this.final_, other.final_) && + Utils.enhancedDeepEquals(this.attributes, other.attributes); } @Override public int hashCode() { - return Objects.hash( - id, - type, - startTimeOffset, - endTimeOffset, - final_, - attributes); + return Utils.enhancedHash( + id, type, startTimeOffset, + endTimeOffset, final_, attributes); } @Override @@ -209,49 +211,55 @@ public class Marker { "final_", final_, "attributes", attributes); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String type; - + private Long startTimeOffset; - + private Long endTimeOffset; - + private Optional final_ = Optional.empty(); - + private Optional attributes = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(long id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder startTimeOffset(long startTimeOffset) { Utils.checkNotNull(startTimeOffset, "startTimeOffset"); this.startTimeOffset = startTimeOffset; return this; } + public Builder endTimeOffset(long endTimeOffset) { Utils.checkNotNull(endTimeOffset, "endTimeOffset"); this.endTimeOffset = endTimeOffset; return this; } + public Builder final_(boolean final_) { Utils.checkNotNull(final_, "final_"); this.final_ = Optional.ofNullable(final_); @@ -264,6 +272,7 @@ public class Marker { return this; } + /** * Attributes associated with the marker. */ @@ -281,15 +290,13 @@ public class Marker { this.attributes = attributes; return this; } - + public Marker build() { + return new Marker( - id, - type, - startTimeOffset, - endTimeOffset, - final_, - attributes); + id, type, startTimeOffset, + endTimeOffset, final_, attributes); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Media.java b/src/main/java/dev/plexapi/sdk/models/operations/Media.java index 41a591ec..47e01c93 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Media.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Media.java @@ -17,11 +17,10 @@ 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 Media { +public class Media { /** * Unique media identifier. */ @@ -70,6 +69,7 @@ public class Media { @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("displayOffset") private Optional displayOffset; @@ -137,6 +137,7 @@ public class Media { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; @@ -211,7 +212,13 @@ public class Media { public Media( long id) { - this(id, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -362,9 +369,10 @@ public class Media { return (Optional>) part; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique media identifier. @@ -384,6 +392,7 @@ public class Media { return this; } + /** * Duration of the media in milliseconds. */ @@ -402,6 +411,7 @@ public class Media { return this; } + /** * Bitrate in bits per second. */ @@ -420,6 +430,7 @@ public class Media { return this; } + /** * Video width in pixels. */ @@ -438,6 +449,7 @@ public class Media { return this; } + /** * Video height in pixels. */ @@ -456,6 +468,7 @@ public class Media { return this; } + /** * Aspect ratio of the video. */ @@ -474,6 +487,7 @@ public class Media { return this; } + /** * Number of audio channels. */ @@ -489,6 +503,7 @@ public class Media { return this; } + public Media withDisplayOffset(Optional displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = displayOffset; @@ -504,6 +519,7 @@ public class Media { return this; } + /** * Audio codec used. */ @@ -522,6 +538,7 @@ public class Media { return this; } + /** * Video codec used. */ @@ -540,6 +557,7 @@ public class Media { return this; } + /** * Video resolution (e.g., 4k). */ @@ -558,6 +576,7 @@ public class Media { return this; } + /** * File container type. */ @@ -576,6 +595,7 @@ public class Media { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -594,6 +614,7 @@ public class Media { return this; } + /** * Video profile (e.g., main 10). */ @@ -612,6 +633,7 @@ public class Media { return this; } + /** * Indicates whether voice activity is detected. */ @@ -630,6 +652,7 @@ public class Media { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -648,6 +671,7 @@ public class Media { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -663,6 +687,7 @@ public class Media { return this; } + public Media withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -678,6 +703,7 @@ public class Media { return this; } + /** * An array of parts for this media item. */ @@ -687,7 +713,6 @@ public class Media { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -698,48 +723,36 @@ public class Media { } Media other = (Media) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.aspectRatio, other.aspectRatio) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.displayOffset, other.displayOffset) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.videoResolution, other.videoResolution) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoFrameRate, other.videoFrameRate) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.part, other.part); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.aspectRatio, other.aspectRatio) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.displayOffset, other.displayOffset) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.videoResolution, other.videoResolution) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoFrameRate, other.videoFrameRate) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.hasVoiceActivity, other.hasVoiceActivity) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.part, other.part); } @Override public int hashCode() { - return Objects.hash( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + return Utils.enhancedHash( + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } @@ -766,51 +779,53 @@ public class Media { "has64bitOffsets", has64bitOffsets, "part", part); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional duration = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional width = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional aspectRatio = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional displayOffset = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional videoResolution = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoFrameRate = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional hasVoiceActivity = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional> part = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique media identifier. */ @@ -820,6 +835,7 @@ public class Media { return this; } + /** * Duration of the media in milliseconds. */ @@ -838,6 +854,7 @@ public class Media { return this; } + /** * Bitrate in bits per second. */ @@ -856,6 +873,7 @@ public class Media { return this; } + /** * Video width in pixels. */ @@ -874,6 +892,7 @@ public class Media { return this; } + /** * Video height in pixels. */ @@ -892,6 +911,7 @@ public class Media { return this; } + /** * Aspect ratio of the video. */ @@ -910,6 +930,7 @@ public class Media { return this; } + /** * Number of audio channels. */ @@ -928,6 +949,7 @@ public class Media { return this; } + public Builder displayOffset(int displayOffset) { Utils.checkNotNull(displayOffset, "displayOffset"); this.displayOffset = Optional.ofNullable(displayOffset); @@ -940,6 +962,7 @@ public class Media { return this; } + /** * Audio codec used. */ @@ -958,6 +981,7 @@ public class Media { return this; } + /** * Video codec used. */ @@ -976,6 +1000,7 @@ public class Media { return this; } + /** * Video resolution (e.g., 4k). */ @@ -994,6 +1019,7 @@ public class Media { return this; } + /** * File container type. */ @@ -1012,6 +1038,7 @@ public class Media { return this; } + /** * Frame rate of the video. Values found include NTSC, PAL, 24p */ @@ -1030,6 +1057,7 @@ public class Media { return this; } + /** * Video profile (e.g., main 10). */ @@ -1048,6 +1076,7 @@ public class Media { return this; } + /** * Indicates whether voice activity is detected. */ @@ -1066,6 +1095,7 @@ public class Media { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -1084,6 +1114,7 @@ public class Media { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -1102,6 +1133,7 @@ public class Media { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -1114,6 +1146,7 @@ public class Media { return this; } + /** * An array of parts for this media item. */ @@ -1131,28 +1164,18 @@ public class Media { this.part = part; return this; } - + public Media build() { + return new Media( - id, - duration, - bitrate, - width, - height, - aspectRatio, - audioChannels, - displayOffset, - audioCodec, - videoCodec, - videoResolution, - container, - videoFrameRate, - videoProfile, - hasVoiceActivity, - audioProfile, - optimizedForStreaming, - has64bitOffsets, + id, duration, bitrate, + width, height, aspectRatio, + audioChannels, displayOffset, audioCodec, + videoCodec, videoResolution, container, + videoFrameRate, videoProfile, hasVoiceActivity, + audioProfile, optimizedForStreaming, has64bitOffsets, part); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MediaContainer.java b/src/main/java/dev/plexapi/sdk/models/operations/MediaContainer.java index 390e5a2f..b6851c41 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MediaContainer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MediaContainer.java @@ -15,211 +15,261 @@ 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 MediaContainer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowCameraUpload") private Optional allowCameraUpload; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowChannelAccess") private Optional allowChannelAccess; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowMediaDeletion") private Optional allowMediaDeletion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSharing") private Optional allowSharing; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowSync") private Optional allowSync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("allowTuners") private Optional allowTuners; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("backgroundProcessing") private Optional backgroundProcessing; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("certificate") private Optional certificate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("companionProxy") private Optional companionProxy; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("countryCode") private Optional countryCode; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("diagnostics") private Optional diagnostics; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("eventStream") private Optional eventStream; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("friendlyName") private Optional friendlyName; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hubSearch") private Optional hubSearch; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("itemClusters") private Optional itemClusters; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("livetv") private Optional livetv; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("machineIdentifier") private Optional machineIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaProviders") private Optional mediaProviders; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("multiuser") private Optional multiuser; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("musicAnalysis") private Optional musicAnalysis; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlex") private Optional myPlex; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlexMappingState") private Optional myPlexMappingState; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlexSigninState") private Optional myPlexSigninState; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlexSubscription") private Optional myPlexSubscription; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("myPlexUsername") private Optional myPlexUsername; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("offlineTranscode") private Optional offlineTranscode; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ownerFeatures") private Optional ownerFeatures; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("photoAutoTag") private Optional photoAutoTag; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("platform") private Optional platform; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("platformVersion") private Optional platformVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("pluginHost") private Optional pluginHost; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("pushNotifications") private Optional pushNotifications; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("readOnlyLibraries") private Optional readOnlyLibraries; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("streamingBrainABRVersion") private Optional streamingBrainABRVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("streamingBrainVersion") private Optional streamingBrainVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("sync") private Optional sync; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderActiveVideoSessions") private Optional transcoderActiveVideoSessions; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderAudio") private Optional transcoderAudio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderLyrics") private Optional transcoderLyrics; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderPhoto") private Optional transcoderPhoto; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderSubtitles") private Optional transcoderSubtitles; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderVideo") private Optional transcoderVideo; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderVideoBitrates") private Optional transcoderVideoBitrates; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderVideoQualities") private Optional transcoderVideoQualities; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcoderVideoResolutions") private Optional transcoderVideoResolutions; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updatedAt") private Optional updatedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("updater") private Optional updater; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("version") private Optional version; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("voiceSearch") private Optional voiceSearch; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Directory") private Optional> directory; @@ -382,7 +432,23 @@ public class MediaContainer { } public MediaContainer() { - 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()); + 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()); } @JsonIgnore @@ -641,9 +707,10 @@ public class MediaContainer { return (Optional>) directory; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MediaContainer withSize(double size) { Utils.checkNotNull(size, "size"); @@ -651,6 +718,7 @@ public class MediaContainer { return this; } + public MediaContainer withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -663,6 +731,7 @@ public class MediaContainer { return this; } + public MediaContainer withAllowCameraUpload(Optional allowCameraUpload) { Utils.checkNotNull(allowCameraUpload, "allowCameraUpload"); this.allowCameraUpload = allowCameraUpload; @@ -675,6 +744,7 @@ public class MediaContainer { return this; } + public MediaContainer withAllowChannelAccess(Optional allowChannelAccess) { Utils.checkNotNull(allowChannelAccess, "allowChannelAccess"); this.allowChannelAccess = allowChannelAccess; @@ -687,6 +757,7 @@ public class MediaContainer { return this; } + public MediaContainer withAllowMediaDeletion(Optional allowMediaDeletion) { Utils.checkNotNull(allowMediaDeletion, "allowMediaDeletion"); this.allowMediaDeletion = allowMediaDeletion; @@ -699,6 +770,7 @@ public class MediaContainer { return this; } + public MediaContainer withAllowSharing(Optional allowSharing) { Utils.checkNotNull(allowSharing, "allowSharing"); this.allowSharing = allowSharing; @@ -711,6 +783,7 @@ public class MediaContainer { return this; } + public MediaContainer withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -723,6 +796,7 @@ public class MediaContainer { return this; } + public MediaContainer withAllowTuners(Optional allowTuners) { Utils.checkNotNull(allowTuners, "allowTuners"); this.allowTuners = allowTuners; @@ -735,6 +809,7 @@ public class MediaContainer { return this; } + public MediaContainer withBackgroundProcessing(Optional backgroundProcessing) { Utils.checkNotNull(backgroundProcessing, "backgroundProcessing"); this.backgroundProcessing = backgroundProcessing; @@ -747,6 +822,7 @@ public class MediaContainer { return this; } + public MediaContainer withCertificate(Optional certificate) { Utils.checkNotNull(certificate, "certificate"); this.certificate = certificate; @@ -759,6 +835,7 @@ public class MediaContainer { return this; } + public MediaContainer withCompanionProxy(Optional companionProxy) { Utils.checkNotNull(companionProxy, "companionProxy"); this.companionProxy = companionProxy; @@ -771,6 +848,7 @@ public class MediaContainer { return this; } + public MediaContainer withCountryCode(Optional countryCode) { Utils.checkNotNull(countryCode, "countryCode"); this.countryCode = countryCode; @@ -783,6 +861,7 @@ public class MediaContainer { return this; } + public MediaContainer withDiagnostics(Optional diagnostics) { Utils.checkNotNull(diagnostics, "diagnostics"); this.diagnostics = diagnostics; @@ -795,6 +874,7 @@ public class MediaContainer { return this; } + public MediaContainer withEventStream(Optional eventStream) { Utils.checkNotNull(eventStream, "eventStream"); this.eventStream = eventStream; @@ -807,6 +887,7 @@ public class MediaContainer { return this; } + public MediaContainer withFriendlyName(Optional friendlyName) { Utils.checkNotNull(friendlyName, "friendlyName"); this.friendlyName = friendlyName; @@ -819,6 +900,7 @@ public class MediaContainer { return this; } + public MediaContainer withHubSearch(Optional hubSearch) { Utils.checkNotNull(hubSearch, "hubSearch"); this.hubSearch = hubSearch; @@ -831,6 +913,7 @@ public class MediaContainer { return this; } + public MediaContainer withItemClusters(Optional itemClusters) { Utils.checkNotNull(itemClusters, "itemClusters"); this.itemClusters = itemClusters; @@ -843,6 +926,7 @@ public class MediaContainer { return this; } + public MediaContainer withLivetv(Optional livetv) { Utils.checkNotNull(livetv, "livetv"); this.livetv = livetv; @@ -855,6 +939,7 @@ public class MediaContainer { return this; } + public MediaContainer withMachineIdentifier(Optional machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = machineIdentifier; @@ -867,6 +952,7 @@ public class MediaContainer { return this; } + public MediaContainer withMediaProviders(Optional mediaProviders) { Utils.checkNotNull(mediaProviders, "mediaProviders"); this.mediaProviders = mediaProviders; @@ -879,6 +965,7 @@ public class MediaContainer { return this; } + public MediaContainer withMultiuser(Optional multiuser) { Utils.checkNotNull(multiuser, "multiuser"); this.multiuser = multiuser; @@ -891,6 +978,7 @@ public class MediaContainer { return this; } + public MediaContainer withMusicAnalysis(Optional musicAnalysis) { Utils.checkNotNull(musicAnalysis, "musicAnalysis"); this.musicAnalysis = musicAnalysis; @@ -903,6 +991,7 @@ public class MediaContainer { return this; } + public MediaContainer withMyPlex(Optional myPlex) { Utils.checkNotNull(myPlex, "myPlex"); this.myPlex = myPlex; @@ -915,6 +1004,7 @@ public class MediaContainer { return this; } + public MediaContainer withMyPlexMappingState(Optional myPlexMappingState) { Utils.checkNotNull(myPlexMappingState, "myPlexMappingState"); this.myPlexMappingState = myPlexMappingState; @@ -927,6 +1017,7 @@ public class MediaContainer { return this; } + public MediaContainer withMyPlexSigninState(Optional myPlexSigninState) { Utils.checkNotNull(myPlexSigninState, "myPlexSigninState"); this.myPlexSigninState = myPlexSigninState; @@ -939,6 +1030,7 @@ public class MediaContainer { return this; } + public MediaContainer withMyPlexSubscription(Optional myPlexSubscription) { Utils.checkNotNull(myPlexSubscription, "myPlexSubscription"); this.myPlexSubscription = myPlexSubscription; @@ -951,6 +1043,7 @@ public class MediaContainer { return this; } + public MediaContainer withMyPlexUsername(Optional myPlexUsername) { Utils.checkNotNull(myPlexUsername, "myPlexUsername"); this.myPlexUsername = myPlexUsername; @@ -963,6 +1056,7 @@ public class MediaContainer { return this; } + public MediaContainer withOfflineTranscode(Optional offlineTranscode) { Utils.checkNotNull(offlineTranscode, "offlineTranscode"); this.offlineTranscode = offlineTranscode; @@ -975,6 +1069,7 @@ public class MediaContainer { return this; } + public MediaContainer withOwnerFeatures(Optional ownerFeatures) { Utils.checkNotNull(ownerFeatures, "ownerFeatures"); this.ownerFeatures = ownerFeatures; @@ -987,6 +1082,7 @@ public class MediaContainer { return this; } + public MediaContainer withPhotoAutoTag(Optional photoAutoTag) { Utils.checkNotNull(photoAutoTag, "photoAutoTag"); this.photoAutoTag = photoAutoTag; @@ -999,6 +1095,7 @@ public class MediaContainer { return this; } + public MediaContainer withPlatform(Optional platform) { Utils.checkNotNull(platform, "platform"); this.platform = platform; @@ -1011,6 +1108,7 @@ public class MediaContainer { return this; } + public MediaContainer withPlatformVersion(Optional platformVersion) { Utils.checkNotNull(platformVersion, "platformVersion"); this.platformVersion = platformVersion; @@ -1023,6 +1121,7 @@ public class MediaContainer { return this; } + public MediaContainer withPluginHost(Optional pluginHost) { Utils.checkNotNull(pluginHost, "pluginHost"); this.pluginHost = pluginHost; @@ -1035,6 +1134,7 @@ public class MediaContainer { return this; } + public MediaContainer withPushNotifications(Optional pushNotifications) { Utils.checkNotNull(pushNotifications, "pushNotifications"); this.pushNotifications = pushNotifications; @@ -1047,6 +1147,7 @@ public class MediaContainer { return this; } + public MediaContainer withReadOnlyLibraries(Optional readOnlyLibraries) { Utils.checkNotNull(readOnlyLibraries, "readOnlyLibraries"); this.readOnlyLibraries = readOnlyLibraries; @@ -1059,6 +1160,7 @@ public class MediaContainer { return this; } + public MediaContainer withStreamingBrainABRVersion(Optional streamingBrainABRVersion) { Utils.checkNotNull(streamingBrainABRVersion, "streamingBrainABRVersion"); this.streamingBrainABRVersion = streamingBrainABRVersion; @@ -1071,6 +1173,7 @@ public class MediaContainer { return this; } + public MediaContainer withStreamingBrainVersion(Optional streamingBrainVersion) { Utils.checkNotNull(streamingBrainVersion, "streamingBrainVersion"); this.streamingBrainVersion = streamingBrainVersion; @@ -1083,6 +1186,7 @@ public class MediaContainer { return this; } + public MediaContainer withSync(Optional sync) { Utils.checkNotNull(sync, "sync"); this.sync = sync; @@ -1095,6 +1199,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderActiveVideoSessions(Optional transcoderActiveVideoSessions) { Utils.checkNotNull(transcoderActiveVideoSessions, "transcoderActiveVideoSessions"); this.transcoderActiveVideoSessions = transcoderActiveVideoSessions; @@ -1107,6 +1212,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderAudio(Optional transcoderAudio) { Utils.checkNotNull(transcoderAudio, "transcoderAudio"); this.transcoderAudio = transcoderAudio; @@ -1119,6 +1225,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderLyrics(Optional transcoderLyrics) { Utils.checkNotNull(transcoderLyrics, "transcoderLyrics"); this.transcoderLyrics = transcoderLyrics; @@ -1131,6 +1238,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderPhoto(Optional transcoderPhoto) { Utils.checkNotNull(transcoderPhoto, "transcoderPhoto"); this.transcoderPhoto = transcoderPhoto; @@ -1143,6 +1251,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderSubtitles(Optional transcoderSubtitles) { Utils.checkNotNull(transcoderSubtitles, "transcoderSubtitles"); this.transcoderSubtitles = transcoderSubtitles; @@ -1155,6 +1264,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderVideo(Optional transcoderVideo) { Utils.checkNotNull(transcoderVideo, "transcoderVideo"); this.transcoderVideo = transcoderVideo; @@ -1167,6 +1277,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderVideoBitrates(Optional transcoderVideoBitrates) { Utils.checkNotNull(transcoderVideoBitrates, "transcoderVideoBitrates"); this.transcoderVideoBitrates = transcoderVideoBitrates; @@ -1179,6 +1290,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderVideoQualities(Optional transcoderVideoQualities) { Utils.checkNotNull(transcoderVideoQualities, "transcoderVideoQualities"); this.transcoderVideoQualities = transcoderVideoQualities; @@ -1191,6 +1303,7 @@ public class MediaContainer { return this; } + public MediaContainer withTranscoderVideoResolutions(Optional transcoderVideoResolutions) { Utils.checkNotNull(transcoderVideoResolutions, "transcoderVideoResolutions"); this.transcoderVideoResolutions = transcoderVideoResolutions; @@ -1203,6 +1316,7 @@ public class MediaContainer { return this; } + public MediaContainer withUpdatedAt(Optional updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = updatedAt; @@ -1215,6 +1329,7 @@ public class MediaContainer { return this; } + public MediaContainer withUpdater(Optional updater) { Utils.checkNotNull(updater, "updater"); this.updater = updater; @@ -1227,6 +1342,7 @@ public class MediaContainer { return this; } + public MediaContainer withVersion(Optional version) { Utils.checkNotNull(version, "version"); this.version = version; @@ -1239,6 +1355,7 @@ public class MediaContainer { return this; } + public MediaContainer withVoiceSearch(Optional voiceSearch) { Utils.checkNotNull(voiceSearch, "voiceSearch"); this.voiceSearch = voiceSearch; @@ -1251,13 +1368,13 @@ public class MediaContainer { return this; } + public MediaContainer withDirectory(Optional> directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1268,113 +1385,79 @@ public class MediaContainer { } MediaContainer other = (MediaContainer) o; return - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.allowCameraUpload, other.allowCameraUpload) && - Objects.deepEquals(this.allowChannelAccess, other.allowChannelAccess) && - Objects.deepEquals(this.allowMediaDeletion, other.allowMediaDeletion) && - Objects.deepEquals(this.allowSharing, other.allowSharing) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.allowTuners, other.allowTuners) && - Objects.deepEquals(this.backgroundProcessing, other.backgroundProcessing) && - Objects.deepEquals(this.certificate, other.certificate) && - Objects.deepEquals(this.companionProxy, other.companionProxy) && - Objects.deepEquals(this.countryCode, other.countryCode) && - Objects.deepEquals(this.diagnostics, other.diagnostics) && - Objects.deepEquals(this.eventStream, other.eventStream) && - Objects.deepEquals(this.friendlyName, other.friendlyName) && - Objects.deepEquals(this.hubSearch, other.hubSearch) && - Objects.deepEquals(this.itemClusters, other.itemClusters) && - Objects.deepEquals(this.livetv, other.livetv) && - Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) && - Objects.deepEquals(this.mediaProviders, other.mediaProviders) && - Objects.deepEquals(this.multiuser, other.multiuser) && - Objects.deepEquals(this.musicAnalysis, other.musicAnalysis) && - Objects.deepEquals(this.myPlex, other.myPlex) && - Objects.deepEquals(this.myPlexMappingState, other.myPlexMappingState) && - Objects.deepEquals(this.myPlexSigninState, other.myPlexSigninState) && - Objects.deepEquals(this.myPlexSubscription, other.myPlexSubscription) && - Objects.deepEquals(this.myPlexUsername, other.myPlexUsername) && - Objects.deepEquals(this.offlineTranscode, other.offlineTranscode) && - Objects.deepEquals(this.ownerFeatures, other.ownerFeatures) && - Objects.deepEquals(this.photoAutoTag, other.photoAutoTag) && - Objects.deepEquals(this.platform, other.platform) && - Objects.deepEquals(this.platformVersion, other.platformVersion) && - Objects.deepEquals(this.pluginHost, other.pluginHost) && - Objects.deepEquals(this.pushNotifications, other.pushNotifications) && - Objects.deepEquals(this.readOnlyLibraries, other.readOnlyLibraries) && - Objects.deepEquals(this.streamingBrainABRVersion, other.streamingBrainABRVersion) && - Objects.deepEquals(this.streamingBrainVersion, other.streamingBrainVersion) && - Objects.deepEquals(this.sync, other.sync) && - Objects.deepEquals(this.transcoderActiveVideoSessions, other.transcoderActiveVideoSessions) && - Objects.deepEquals(this.transcoderAudio, other.transcoderAudio) && - Objects.deepEquals(this.transcoderLyrics, other.transcoderLyrics) && - Objects.deepEquals(this.transcoderPhoto, other.transcoderPhoto) && - Objects.deepEquals(this.transcoderSubtitles, other.transcoderSubtitles) && - Objects.deepEquals(this.transcoderVideo, other.transcoderVideo) && - Objects.deepEquals(this.transcoderVideoBitrates, other.transcoderVideoBitrates) && - Objects.deepEquals(this.transcoderVideoQualities, other.transcoderVideoQualities) && - Objects.deepEquals(this.transcoderVideoResolutions, other.transcoderVideoResolutions) && - Objects.deepEquals(this.updatedAt, other.updatedAt) && - Objects.deepEquals(this.updater, other.updater) && - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.voiceSearch, other.voiceSearch) && - Objects.deepEquals(this.directory, other.directory); + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.allowCameraUpload, other.allowCameraUpload) && + Utils.enhancedDeepEquals(this.allowChannelAccess, other.allowChannelAccess) && + Utils.enhancedDeepEquals(this.allowMediaDeletion, other.allowMediaDeletion) && + Utils.enhancedDeepEquals(this.allowSharing, other.allowSharing) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.allowTuners, other.allowTuners) && + Utils.enhancedDeepEquals(this.backgroundProcessing, other.backgroundProcessing) && + Utils.enhancedDeepEquals(this.certificate, other.certificate) && + Utils.enhancedDeepEquals(this.companionProxy, other.companionProxy) && + Utils.enhancedDeepEquals(this.countryCode, other.countryCode) && + Utils.enhancedDeepEquals(this.diagnostics, other.diagnostics) && + Utils.enhancedDeepEquals(this.eventStream, other.eventStream) && + Utils.enhancedDeepEquals(this.friendlyName, other.friendlyName) && + Utils.enhancedDeepEquals(this.hubSearch, other.hubSearch) && + Utils.enhancedDeepEquals(this.itemClusters, other.itemClusters) && + Utils.enhancedDeepEquals(this.livetv, other.livetv) && + Utils.enhancedDeepEquals(this.machineIdentifier, other.machineIdentifier) && + Utils.enhancedDeepEquals(this.mediaProviders, other.mediaProviders) && + Utils.enhancedDeepEquals(this.multiuser, other.multiuser) && + Utils.enhancedDeepEquals(this.musicAnalysis, other.musicAnalysis) && + Utils.enhancedDeepEquals(this.myPlex, other.myPlex) && + Utils.enhancedDeepEquals(this.myPlexMappingState, other.myPlexMappingState) && + Utils.enhancedDeepEquals(this.myPlexSigninState, other.myPlexSigninState) && + Utils.enhancedDeepEquals(this.myPlexSubscription, other.myPlexSubscription) && + Utils.enhancedDeepEquals(this.myPlexUsername, other.myPlexUsername) && + Utils.enhancedDeepEquals(this.offlineTranscode, other.offlineTranscode) && + Utils.enhancedDeepEquals(this.ownerFeatures, other.ownerFeatures) && + Utils.enhancedDeepEquals(this.photoAutoTag, other.photoAutoTag) && + Utils.enhancedDeepEquals(this.platform, other.platform) && + Utils.enhancedDeepEquals(this.platformVersion, other.platformVersion) && + Utils.enhancedDeepEquals(this.pluginHost, other.pluginHost) && + Utils.enhancedDeepEquals(this.pushNotifications, other.pushNotifications) && + Utils.enhancedDeepEquals(this.readOnlyLibraries, other.readOnlyLibraries) && + Utils.enhancedDeepEquals(this.streamingBrainABRVersion, other.streamingBrainABRVersion) && + Utils.enhancedDeepEquals(this.streamingBrainVersion, other.streamingBrainVersion) && + Utils.enhancedDeepEquals(this.sync, other.sync) && + Utils.enhancedDeepEquals(this.transcoderActiveVideoSessions, other.transcoderActiveVideoSessions) && + Utils.enhancedDeepEquals(this.transcoderAudio, other.transcoderAudio) && + Utils.enhancedDeepEquals(this.transcoderLyrics, other.transcoderLyrics) && + Utils.enhancedDeepEquals(this.transcoderPhoto, other.transcoderPhoto) && + Utils.enhancedDeepEquals(this.transcoderSubtitles, other.transcoderSubtitles) && + Utils.enhancedDeepEquals(this.transcoderVideo, other.transcoderVideo) && + Utils.enhancedDeepEquals(this.transcoderVideoBitrates, other.transcoderVideoBitrates) && + Utils.enhancedDeepEquals(this.transcoderVideoQualities, other.transcoderVideoQualities) && + Utils.enhancedDeepEquals(this.transcoderVideoResolutions, other.transcoderVideoResolutions) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.updater, other.updater) && + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.voiceSearch, other.voiceSearch) && + Utils.enhancedDeepEquals(this.directory, other.directory); } @Override public int hashCode() { - return Objects.hash( - size, - allowCameraUpload, - allowChannelAccess, - allowMediaDeletion, - allowSharing, - allowSync, - allowTuners, - backgroundProcessing, - certificate, - companionProxy, - countryCode, - diagnostics, - eventStream, - friendlyName, - hubSearch, - itemClusters, - livetv, - machineIdentifier, - mediaProviders, - multiuser, - musicAnalysis, - myPlex, - myPlexMappingState, - myPlexSigninState, - myPlexSubscription, - myPlexUsername, - offlineTranscode, - ownerFeatures, - photoAutoTag, - platform, - platformVersion, - pluginHost, - pushNotifications, - readOnlyLibraries, - streamingBrainABRVersion, - streamingBrainVersion, - sync, - transcoderActiveVideoSessions, - transcoderAudio, - transcoderLyrics, - transcoderPhoto, - transcoderSubtitles, - transcoderVideo, - transcoderVideoBitrates, - transcoderVideoQualities, - transcoderVideoResolutions, - updatedAt, - updater, - version, - voiceSearch, - directory); + return Utils.enhancedHash( + size, allowCameraUpload, allowChannelAccess, + allowMediaDeletion, allowSharing, allowSync, + allowTuners, backgroundProcessing, certificate, + companionProxy, countryCode, diagnostics, + eventStream, friendlyName, hubSearch, + itemClusters, livetv, machineIdentifier, + mediaProviders, multiuser, musicAnalysis, + myPlex, myPlexMappingState, myPlexSigninState, + myPlexSubscription, myPlexUsername, offlineTranscode, + ownerFeatures, photoAutoTag, platform, + platformVersion, pluginHost, pushNotifications, + readOnlyLibraries, streamingBrainABRVersion, streamingBrainVersion, + sync, transcoderActiveVideoSessions, transcoderAudio, + transcoderLyrics, transcoderPhoto, transcoderSubtitles, + transcoderVideo, transcoderVideoBitrates, transcoderVideoQualities, + transcoderVideoResolutions, updatedAt, updater, + version, voiceSearch, directory); } @Override @@ -1432,115 +1515,117 @@ public class MediaContainer { "voiceSearch", voiceSearch, "directory", directory); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional size = Optional.empty(); - + private Optional allowCameraUpload = Optional.empty(); - + private Optional allowChannelAccess = Optional.empty(); - + private Optional allowMediaDeletion = Optional.empty(); - + private Optional allowSharing = Optional.empty(); - + private Optional allowSync = Optional.empty(); - + private Optional allowTuners = Optional.empty(); - + private Optional backgroundProcessing = Optional.empty(); - + private Optional certificate = Optional.empty(); - + private Optional companionProxy = Optional.empty(); - + private Optional countryCode = Optional.empty(); - + private Optional diagnostics = Optional.empty(); - + private Optional eventStream = Optional.empty(); - + private Optional friendlyName = Optional.empty(); - + private Optional hubSearch = Optional.empty(); - + private Optional itemClusters = Optional.empty(); - + private Optional livetv = Optional.empty(); - + private Optional machineIdentifier = Optional.empty(); - + private Optional mediaProviders = Optional.empty(); - + private Optional multiuser = Optional.empty(); - + private Optional musicAnalysis = Optional.empty(); - + private Optional myPlex = Optional.empty(); - + private Optional myPlexMappingState = Optional.empty(); - + private Optional myPlexSigninState = Optional.empty(); - + private Optional myPlexSubscription = Optional.empty(); - + private Optional myPlexUsername = Optional.empty(); - + private Optional offlineTranscode = Optional.empty(); - + private Optional ownerFeatures = Optional.empty(); - + private Optional photoAutoTag = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Optional platformVersion = Optional.empty(); - + private Optional pluginHost = Optional.empty(); - + private Optional pushNotifications = Optional.empty(); - + private Optional readOnlyLibraries = Optional.empty(); - + private Optional streamingBrainABRVersion = Optional.empty(); - + private Optional streamingBrainVersion = Optional.empty(); - + private Optional sync = Optional.empty(); - + private Optional transcoderActiveVideoSessions = Optional.empty(); - + private Optional transcoderAudio = Optional.empty(); - + private Optional transcoderLyrics = Optional.empty(); - + private Optional transcoderPhoto = Optional.empty(); - + private Optional transcoderSubtitles = Optional.empty(); - + private Optional transcoderVideo = Optional.empty(); - + private Optional transcoderVideoBitrates = Optional.empty(); - + private Optional transcoderVideoQualities = Optional.empty(); - + private Optional transcoderVideoResolutions = Optional.empty(); - + private Optional updatedAt = Optional.empty(); - + private Optional updater = Optional.empty(); - + private Optional version = Optional.empty(); - + private Optional voiceSearch = Optional.empty(); - + private Optional> directory = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder size(double size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -1553,6 +1638,7 @@ public class MediaContainer { return this; } + public Builder allowCameraUpload(boolean allowCameraUpload) { Utils.checkNotNull(allowCameraUpload, "allowCameraUpload"); this.allowCameraUpload = Optional.ofNullable(allowCameraUpload); @@ -1565,6 +1651,7 @@ public class MediaContainer { return this; } + public Builder allowChannelAccess(boolean allowChannelAccess) { Utils.checkNotNull(allowChannelAccess, "allowChannelAccess"); this.allowChannelAccess = Optional.ofNullable(allowChannelAccess); @@ -1577,6 +1664,7 @@ public class MediaContainer { return this; } + public Builder allowMediaDeletion(boolean allowMediaDeletion) { Utils.checkNotNull(allowMediaDeletion, "allowMediaDeletion"); this.allowMediaDeletion = Optional.ofNullable(allowMediaDeletion); @@ -1589,6 +1677,7 @@ public class MediaContainer { return this; } + public Builder allowSharing(boolean allowSharing) { Utils.checkNotNull(allowSharing, "allowSharing"); this.allowSharing = Optional.ofNullable(allowSharing); @@ -1601,6 +1690,7 @@ public class MediaContainer { return this; } + public Builder allowSync(boolean allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -1613,6 +1703,7 @@ public class MediaContainer { return this; } + public Builder allowTuners(boolean allowTuners) { Utils.checkNotNull(allowTuners, "allowTuners"); this.allowTuners = Optional.ofNullable(allowTuners); @@ -1625,6 +1716,7 @@ public class MediaContainer { return this; } + public Builder backgroundProcessing(boolean backgroundProcessing) { Utils.checkNotNull(backgroundProcessing, "backgroundProcessing"); this.backgroundProcessing = Optional.ofNullable(backgroundProcessing); @@ -1637,6 +1729,7 @@ public class MediaContainer { return this; } + public Builder certificate(boolean certificate) { Utils.checkNotNull(certificate, "certificate"); this.certificate = Optional.ofNullable(certificate); @@ -1649,6 +1742,7 @@ public class MediaContainer { return this; } + public Builder companionProxy(boolean companionProxy) { Utils.checkNotNull(companionProxy, "companionProxy"); this.companionProxy = Optional.ofNullable(companionProxy); @@ -1661,6 +1755,7 @@ public class MediaContainer { return this; } + public Builder countryCode(String countryCode) { Utils.checkNotNull(countryCode, "countryCode"); this.countryCode = Optional.ofNullable(countryCode); @@ -1673,6 +1768,7 @@ public class MediaContainer { return this; } + public Builder diagnostics(String diagnostics) { Utils.checkNotNull(diagnostics, "diagnostics"); this.diagnostics = Optional.ofNullable(diagnostics); @@ -1685,6 +1781,7 @@ public class MediaContainer { return this; } + public Builder eventStream(boolean eventStream) { Utils.checkNotNull(eventStream, "eventStream"); this.eventStream = Optional.ofNullable(eventStream); @@ -1697,6 +1794,7 @@ public class MediaContainer { return this; } + public Builder friendlyName(String friendlyName) { Utils.checkNotNull(friendlyName, "friendlyName"); this.friendlyName = Optional.ofNullable(friendlyName); @@ -1709,6 +1807,7 @@ public class MediaContainer { return this; } + public Builder hubSearch(boolean hubSearch) { Utils.checkNotNull(hubSearch, "hubSearch"); this.hubSearch = Optional.ofNullable(hubSearch); @@ -1721,6 +1820,7 @@ public class MediaContainer { return this; } + public Builder itemClusters(boolean itemClusters) { Utils.checkNotNull(itemClusters, "itemClusters"); this.itemClusters = Optional.ofNullable(itemClusters); @@ -1733,6 +1833,7 @@ public class MediaContainer { return this; } + public Builder livetv(double livetv) { Utils.checkNotNull(livetv, "livetv"); this.livetv = Optional.ofNullable(livetv); @@ -1745,6 +1846,7 @@ public class MediaContainer { return this; } + public Builder machineIdentifier(String machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = Optional.ofNullable(machineIdentifier); @@ -1757,6 +1859,7 @@ public class MediaContainer { return this; } + public Builder mediaProviders(boolean mediaProviders) { Utils.checkNotNull(mediaProviders, "mediaProviders"); this.mediaProviders = Optional.ofNullable(mediaProviders); @@ -1769,6 +1872,7 @@ public class MediaContainer { return this; } + public Builder multiuser(boolean multiuser) { Utils.checkNotNull(multiuser, "multiuser"); this.multiuser = Optional.ofNullable(multiuser); @@ -1781,6 +1885,7 @@ public class MediaContainer { return this; } + public Builder musicAnalysis(double musicAnalysis) { Utils.checkNotNull(musicAnalysis, "musicAnalysis"); this.musicAnalysis = Optional.ofNullable(musicAnalysis); @@ -1793,6 +1898,7 @@ public class MediaContainer { return this; } + public Builder myPlex(boolean myPlex) { Utils.checkNotNull(myPlex, "myPlex"); this.myPlex = Optional.ofNullable(myPlex); @@ -1805,6 +1911,7 @@ public class MediaContainer { return this; } + public Builder myPlexMappingState(String myPlexMappingState) { Utils.checkNotNull(myPlexMappingState, "myPlexMappingState"); this.myPlexMappingState = Optional.ofNullable(myPlexMappingState); @@ -1817,6 +1924,7 @@ public class MediaContainer { return this; } + public Builder myPlexSigninState(String myPlexSigninState) { Utils.checkNotNull(myPlexSigninState, "myPlexSigninState"); this.myPlexSigninState = Optional.ofNullable(myPlexSigninState); @@ -1829,6 +1937,7 @@ public class MediaContainer { return this; } + public Builder myPlexSubscription(boolean myPlexSubscription) { Utils.checkNotNull(myPlexSubscription, "myPlexSubscription"); this.myPlexSubscription = Optional.ofNullable(myPlexSubscription); @@ -1841,6 +1950,7 @@ public class MediaContainer { return this; } + public Builder myPlexUsername(String myPlexUsername) { Utils.checkNotNull(myPlexUsername, "myPlexUsername"); this.myPlexUsername = Optional.ofNullable(myPlexUsername); @@ -1853,6 +1963,7 @@ public class MediaContainer { return this; } + public Builder offlineTranscode(double offlineTranscode) { Utils.checkNotNull(offlineTranscode, "offlineTranscode"); this.offlineTranscode = Optional.ofNullable(offlineTranscode); @@ -1865,6 +1976,7 @@ public class MediaContainer { return this; } + public Builder ownerFeatures(String ownerFeatures) { Utils.checkNotNull(ownerFeatures, "ownerFeatures"); this.ownerFeatures = Optional.ofNullable(ownerFeatures); @@ -1877,6 +1989,7 @@ public class MediaContainer { return this; } + public Builder photoAutoTag(boolean photoAutoTag) { Utils.checkNotNull(photoAutoTag, "photoAutoTag"); this.photoAutoTag = Optional.ofNullable(photoAutoTag); @@ -1889,6 +2002,7 @@ public class MediaContainer { return this; } + public Builder platform(String platform) { Utils.checkNotNull(platform, "platform"); this.platform = Optional.ofNullable(platform); @@ -1901,6 +2015,7 @@ public class MediaContainer { return this; } + public Builder platformVersion(String platformVersion) { Utils.checkNotNull(platformVersion, "platformVersion"); this.platformVersion = Optional.ofNullable(platformVersion); @@ -1913,6 +2028,7 @@ public class MediaContainer { return this; } + public Builder pluginHost(boolean pluginHost) { Utils.checkNotNull(pluginHost, "pluginHost"); this.pluginHost = Optional.ofNullable(pluginHost); @@ -1925,6 +2041,7 @@ public class MediaContainer { return this; } + public Builder pushNotifications(boolean pushNotifications) { Utils.checkNotNull(pushNotifications, "pushNotifications"); this.pushNotifications = Optional.ofNullable(pushNotifications); @@ -1937,6 +2054,7 @@ public class MediaContainer { return this; } + public Builder readOnlyLibraries(boolean readOnlyLibraries) { Utils.checkNotNull(readOnlyLibraries, "readOnlyLibraries"); this.readOnlyLibraries = Optional.ofNullable(readOnlyLibraries); @@ -1949,6 +2067,7 @@ public class MediaContainer { return this; } + public Builder streamingBrainABRVersion(double streamingBrainABRVersion) { Utils.checkNotNull(streamingBrainABRVersion, "streamingBrainABRVersion"); this.streamingBrainABRVersion = Optional.ofNullable(streamingBrainABRVersion); @@ -1961,6 +2080,7 @@ public class MediaContainer { return this; } + public Builder streamingBrainVersion(double streamingBrainVersion) { Utils.checkNotNull(streamingBrainVersion, "streamingBrainVersion"); this.streamingBrainVersion = Optional.ofNullable(streamingBrainVersion); @@ -1973,6 +2093,7 @@ public class MediaContainer { return this; } + public Builder sync(boolean sync) { Utils.checkNotNull(sync, "sync"); this.sync = Optional.ofNullable(sync); @@ -1985,6 +2106,7 @@ public class MediaContainer { return this; } + public Builder transcoderActiveVideoSessions(double transcoderActiveVideoSessions) { Utils.checkNotNull(transcoderActiveVideoSessions, "transcoderActiveVideoSessions"); this.transcoderActiveVideoSessions = Optional.ofNullable(transcoderActiveVideoSessions); @@ -1997,6 +2119,7 @@ public class MediaContainer { return this; } + public Builder transcoderAudio(boolean transcoderAudio) { Utils.checkNotNull(transcoderAudio, "transcoderAudio"); this.transcoderAudio = Optional.ofNullable(transcoderAudio); @@ -2009,6 +2132,7 @@ public class MediaContainer { return this; } + public Builder transcoderLyrics(boolean transcoderLyrics) { Utils.checkNotNull(transcoderLyrics, "transcoderLyrics"); this.transcoderLyrics = Optional.ofNullable(transcoderLyrics); @@ -2021,6 +2145,7 @@ public class MediaContainer { return this; } + public Builder transcoderPhoto(boolean transcoderPhoto) { Utils.checkNotNull(transcoderPhoto, "transcoderPhoto"); this.transcoderPhoto = Optional.ofNullable(transcoderPhoto); @@ -2033,6 +2158,7 @@ public class MediaContainer { return this; } + public Builder transcoderSubtitles(boolean transcoderSubtitles) { Utils.checkNotNull(transcoderSubtitles, "transcoderSubtitles"); this.transcoderSubtitles = Optional.ofNullable(transcoderSubtitles); @@ -2045,6 +2171,7 @@ public class MediaContainer { return this; } + public Builder transcoderVideo(boolean transcoderVideo) { Utils.checkNotNull(transcoderVideo, "transcoderVideo"); this.transcoderVideo = Optional.ofNullable(transcoderVideo); @@ -2057,6 +2184,7 @@ public class MediaContainer { return this; } + public Builder transcoderVideoBitrates(String transcoderVideoBitrates) { Utils.checkNotNull(transcoderVideoBitrates, "transcoderVideoBitrates"); this.transcoderVideoBitrates = Optional.ofNullable(transcoderVideoBitrates); @@ -2069,6 +2197,7 @@ public class MediaContainer { return this; } + public Builder transcoderVideoQualities(String transcoderVideoQualities) { Utils.checkNotNull(transcoderVideoQualities, "transcoderVideoQualities"); this.transcoderVideoQualities = Optional.ofNullable(transcoderVideoQualities); @@ -2081,6 +2210,7 @@ public class MediaContainer { return this; } + public Builder transcoderVideoResolutions(String transcoderVideoResolutions) { Utils.checkNotNull(transcoderVideoResolutions, "transcoderVideoResolutions"); this.transcoderVideoResolutions = Optional.ofNullable(transcoderVideoResolutions); @@ -2093,6 +2223,7 @@ public class MediaContainer { return this; } + public Builder updatedAt(double updatedAt) { Utils.checkNotNull(updatedAt, "updatedAt"); this.updatedAt = Optional.ofNullable(updatedAt); @@ -2105,6 +2236,7 @@ public class MediaContainer { return this; } + public Builder updater(boolean updater) { Utils.checkNotNull(updater, "updater"); this.updater = Optional.ofNullable(updater); @@ -2117,6 +2249,7 @@ public class MediaContainer { return this; } + public Builder version(String version) { Utils.checkNotNull(version, "version"); this.version = Optional.ofNullable(version); @@ -2129,6 +2262,7 @@ public class MediaContainer { return this; } + public Builder voiceSearch(boolean voiceSearch) { Utils.checkNotNull(voiceSearch, "voiceSearch"); this.voiceSearch = Optional.ofNullable(voiceSearch); @@ -2141,6 +2275,7 @@ public class MediaContainer { return this; } + public Builder directory(List directory) { Utils.checkNotNull(directory, "directory"); this.directory = Optional.ofNullable(directory); @@ -2152,60 +2287,28 @@ public class MediaContainer { this.directory = directory; return this; } - + public MediaContainer build() { + return new MediaContainer( - size, - allowCameraUpload, - allowChannelAccess, - allowMediaDeletion, - allowSharing, - allowSync, - allowTuners, - backgroundProcessing, - certificate, - companionProxy, - countryCode, - diagnostics, - eventStream, - friendlyName, - hubSearch, - itemClusters, - livetv, - machineIdentifier, - mediaProviders, - multiuser, - musicAnalysis, - myPlex, - myPlexMappingState, - myPlexSigninState, - myPlexSubscription, - myPlexUsername, - offlineTranscode, - ownerFeatures, - photoAutoTag, - platform, - platformVersion, - pluginHost, - pushNotifications, - readOnlyLibraries, - streamingBrainABRVersion, - streamingBrainVersion, - sync, - transcoderActiveVideoSessions, - transcoderAudio, - transcoderLyrics, - transcoderPhoto, - transcoderSubtitles, - transcoderVideo, - transcoderVideoBitrates, - transcoderVideoQualities, - transcoderVideoResolutions, - updatedAt, - updater, - version, - voiceSearch, - directory); + size, allowCameraUpload, allowChannelAccess, + allowMediaDeletion, allowSharing, allowSync, + allowTuners, backgroundProcessing, certificate, + companionProxy, countryCode, diagnostics, + eventStream, friendlyName, hubSearch, + itemClusters, livetv, machineIdentifier, + mediaProviders, multiuser, musicAnalysis, + myPlex, myPlexMappingState, myPlexSigninState, + myPlexSubscription, myPlexUsername, offlineTranscode, + ownerFeatures, photoAutoTag, platform, + platformVersion, pluginHost, pushNotifications, + readOnlyLibraries, streamingBrainABRVersion, streamingBrainVersion, + sync, transcoderActiveVideoSessions, transcoderAudio, + transcoderLyrics, transcoderPhoto, transcoderSubtitles, + transcoderVideo, transcoderVideoBitrates, transcoderVideoQualities, + transcoderVideoResolutions, updatedAt, updater, + version, voiceSearch, directory); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MediaProvider.java b/src/main/java/dev/plexapi/sdk/models/operations/MediaProvider.java index 292eab8d..b432d8be 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MediaProvider.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MediaProvider.java @@ -13,27 +13,31 @@ 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 MediaProvider { @JsonInclude(Include.NON_ABSENT) @JsonProperty("identifier") private Optional identifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("types") private Optional types; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("protocols") private Optional protocols; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Feature") private Optional> feature; @@ -58,7 +62,8 @@ public class MediaProvider { } public MediaProvider() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -87,9 +92,10 @@ public class MediaProvider { return (Optional>) feature; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MediaProvider withIdentifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); @@ -97,6 +103,7 @@ public class MediaProvider { return this; } + public MediaProvider withIdentifier(Optional identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; @@ -109,6 +116,7 @@ public class MediaProvider { return this; } + public MediaProvider withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -121,6 +129,7 @@ public class MediaProvider { return this; } + public MediaProvider withTypes(Optional types) { Utils.checkNotNull(types, "types"); this.types = types; @@ -133,6 +142,7 @@ public class MediaProvider { return this; } + public MediaProvider withProtocols(Optional protocols) { Utils.checkNotNull(protocols, "protocols"); this.protocols = protocols; @@ -145,13 +155,13 @@ public class MediaProvider { return this; } + public MediaProvider withFeature(Optional> feature) { Utils.checkNotNull(feature, "feature"); this.feature = feature; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -162,21 +172,18 @@ public class MediaProvider { } MediaProvider other = (MediaProvider) o; return - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.types, other.types) && - Objects.deepEquals(this.protocols, other.protocols) && - Objects.deepEquals(this.feature, other.feature); + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.types, other.types) && + Utils.enhancedDeepEquals(this.protocols, other.protocols) && + Utils.enhancedDeepEquals(this.feature, other.feature); } @Override public int hashCode() { - return Objects.hash( - identifier, - title, - types, - protocols, - feature); + return Utils.enhancedHash( + identifier, title, types, + protocols, feature); } @Override @@ -188,23 +195,25 @@ public class MediaProvider { "protocols", protocols, "feature", feature); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional identifier = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional types = Optional.empty(); - + private Optional protocols = Optional.empty(); - + private Optional> feature = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = Optional.ofNullable(identifier); @@ -217,6 +226,7 @@ public class MediaProvider { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -229,6 +239,7 @@ public class MediaProvider { return this; } + public Builder types(String types) { Utils.checkNotNull(types, "types"); this.types = Optional.ofNullable(types); @@ -241,6 +252,7 @@ public class MediaProvider { return this; } + public Builder protocols(String protocols) { Utils.checkNotNull(protocols, "protocols"); this.protocols = Optional.ofNullable(protocols); @@ -253,6 +265,7 @@ public class MediaProvider { return this; } + public Builder feature(List feature) { Utils.checkNotNull(feature, "feature"); this.feature = Optional.ofNullable(feature); @@ -264,14 +277,13 @@ public class MediaProvider { this.feature = feature; return this; } - + public MediaProvider build() { + return new MediaProvider( - identifier, - title, - types, - protocols, - feature); + identifier, title, types, + protocols, feature); } + } } 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 f5d853d8..9d819b6c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MediaReviewsVisibility.java @@ -19,7 +19,7 @@ public enum MediaReviewsVisibility { @JsonValue private final int value; - private MediaReviewsVisibility(int value) { + MediaReviewsVisibility(int value) { this.value = 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 index 310d05d2..6bc4f6a0 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Meta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Meta.java @@ -13,7 +13,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; /** @@ -27,6 +26,7 @@ public class Meta { @JsonProperty("Type") private Optional> type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("FieldType") private Optional> fieldType; @@ -57,9 +57,10 @@ public class Meta { return (Optional>) fieldType; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Meta withType(List type) { Utils.checkNotNull(type, "type"); @@ -67,6 +68,7 @@ public class Meta { return this; } + public Meta withType(Optional> type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -79,13 +81,13 @@ public class Meta { 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) { @@ -96,15 +98,14 @@ public class Meta { } Meta other = (Meta) o; return - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.fieldType, other.fieldType); + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.fieldType, other.fieldType); } @Override public int hashCode() { - return Objects.hash( - type, - fieldType); + return Utils.enhancedHash( + type, fieldType); } @Override @@ -113,17 +114,19 @@ public class Meta { "type", type, "fieldType", fieldType); } - + + @SuppressWarnings("UnusedReturnValue") 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); @@ -136,6 +139,7 @@ public class Meta { return this; } + public Builder fieldType(List fieldType) { Utils.checkNotNull(fieldType, "fieldType"); this.fieldType = Optional.ofNullable(fieldType); @@ -147,11 +151,12 @@ public class Meta { this.fieldType = fieldType; return this; } - + public Meta build() { + return new Meta( - type, - fieldType); + type, fieldType); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Metadata.java b/src/main/java/dev/plexapi/sdk/models/operations/Metadata.java index 9a9d1a78..648cb6fa 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Metadata.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Metadata.java @@ -17,147 +17,181 @@ import java.lang.String; import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; -import java.util.Objects; import java.util.Optional; + public class Metadata { @JsonInclude(Include.NON_ABSENT) @JsonProperty("art") private Optional art; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("guid") private Optional guid; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingKey") private Optional ratingKey; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("studio") private Optional studio; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("tagline") private Optional tagline; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("thumb") private Optional thumb; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("addedAt") private Optional addedAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("publicPagesURL") private Optional publicPagesURL; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("slug") private Optional slug; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("userState") private Optional userState; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("contentRating") private Optional contentRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("originallyAvailableAt") private Optional originallyAvailableAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("year") private Optional year; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Image") private Optional> image; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("banner") private Optional banner; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("rating") private Optional rating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("expiresAt") private Optional expiresAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("originalTitle") private Optional originalTitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRating") private Optional audienceRating; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audienceRatingImage") private Optional audienceRatingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("ratingImage") private Optional ratingImage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("imdbRatingCount") private Optional imdbRatingCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtype") private Optional subtype; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("theme") private Optional theme; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("leafCount") private Optional leafCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("childCount") private Optional childCount; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("isContinuingSeries") private Optional isContinuingSeries; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("skipChildren") private Optional skipChildren; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("availabilityId") private Optional availabilityId; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("streamingMediaId") private Optional streamingMediaId; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("playableKey") private Optional playableKey; @@ -272,7 +306,18 @@ public class Metadata { } public Metadata() { - 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()); + 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()); } @JsonIgnore @@ -451,9 +496,10 @@ public class Metadata { return playableKey; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Metadata withArt(String art) { Utils.checkNotNull(art, "art"); @@ -461,6 +507,7 @@ public class Metadata { return this; } + public Metadata withArt(Optional art) { Utils.checkNotNull(art, "art"); this.art = art; @@ -473,6 +520,7 @@ public class Metadata { return this; } + public Metadata withGuid(Optional guid) { Utils.checkNotNull(guid, "guid"); this.guid = guid; @@ -485,6 +533,7 @@ public class Metadata { return this; } + public Metadata withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -497,6 +546,7 @@ public class Metadata { return this; } + public Metadata withRatingKey(Optional ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = ratingKey; @@ -509,6 +559,7 @@ public class Metadata { return this; } + public Metadata withStudio(Optional studio) { Utils.checkNotNull(studio, "studio"); this.studio = studio; @@ -521,6 +572,7 @@ public class Metadata { return this; } + public Metadata withTagline(Optional tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = tagline; @@ -533,6 +585,7 @@ public class Metadata { return this; } + public Metadata withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -545,6 +598,7 @@ public class Metadata { return this; } + public Metadata withThumb(Optional thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = thumb; @@ -557,6 +611,7 @@ public class Metadata { return this; } + public Metadata withAddedAt(Optional addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = addedAt; @@ -569,6 +624,7 @@ public class Metadata { return this; } + public Metadata withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -581,6 +637,7 @@ public class Metadata { return this; } + public Metadata withPublicPagesURL(Optional publicPagesURL) { Utils.checkNotNull(publicPagesURL, "publicPagesURL"); this.publicPagesURL = publicPagesURL; @@ -593,6 +650,7 @@ public class Metadata { return this; } + public Metadata withSlug(Optional slug) { Utils.checkNotNull(slug, "slug"); this.slug = slug; @@ -605,6 +663,7 @@ public class Metadata { return this; } + public Metadata withUserState(Optional userState) { Utils.checkNotNull(userState, "userState"); this.userState = userState; @@ -617,6 +676,7 @@ public class Metadata { return this; } + public Metadata withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -629,6 +689,7 @@ public class Metadata { return this; } + public Metadata withContentRating(Optional contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = contentRating; @@ -641,6 +702,7 @@ public class Metadata { return this; } + public Metadata withOriginallyAvailableAt(Optional originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = originallyAvailableAt; @@ -653,6 +715,7 @@ public class Metadata { return this; } + public Metadata withYear(Optional year) { Utils.checkNotNull(year, "year"); this.year = year; @@ -665,6 +728,7 @@ public class Metadata { return this; } + public Metadata withImage(Optional> image) { Utils.checkNotNull(image, "image"); this.image = image; @@ -677,6 +741,7 @@ public class Metadata { return this; } + public Metadata withBanner(Optional banner) { Utils.checkNotNull(banner, "banner"); this.banner = banner; @@ -689,6 +754,7 @@ public class Metadata { return this; } + public Metadata withRating(Optional rating) { Utils.checkNotNull(rating, "rating"); this.rating = rating; @@ -701,6 +767,7 @@ public class Metadata { return this; } + public Metadata withExpiresAt(Optional expiresAt) { Utils.checkNotNull(expiresAt, "expiresAt"); this.expiresAt = expiresAt; @@ -713,6 +780,7 @@ public class Metadata { return this; } + public Metadata withOriginalTitle(Optional originalTitle) { Utils.checkNotNull(originalTitle, "originalTitle"); this.originalTitle = originalTitle; @@ -725,6 +793,7 @@ public class Metadata { return this; } + public Metadata withAudienceRating(Optional audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = audienceRating; @@ -737,6 +806,7 @@ public class Metadata { return this; } + public Metadata withAudienceRatingImage(Optional audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = audienceRatingImage; @@ -749,6 +819,7 @@ public class Metadata { return this; } + public Metadata withRatingImage(Optional ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = ratingImage; @@ -761,6 +832,7 @@ public class Metadata { return this; } + public Metadata withImdbRatingCount(Optional imdbRatingCount) { Utils.checkNotNull(imdbRatingCount, "imdbRatingCount"); this.imdbRatingCount = imdbRatingCount; @@ -773,6 +845,7 @@ public class Metadata { return this; } + public Metadata withSubtype(Optional subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = subtype; @@ -785,6 +858,7 @@ public class Metadata { return this; } + public Metadata withTheme(Optional theme) { Utils.checkNotNull(theme, "theme"); this.theme = theme; @@ -797,6 +871,7 @@ public class Metadata { return this; } + public Metadata withLeafCount(Optional leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = leafCount; @@ -809,6 +884,7 @@ public class Metadata { return this; } + public Metadata withChildCount(Optional childCount) { Utils.checkNotNull(childCount, "childCount"); this.childCount = childCount; @@ -821,6 +897,7 @@ public class Metadata { return this; } + public Metadata withIsContinuingSeries(Optional isContinuingSeries) { Utils.checkNotNull(isContinuingSeries, "isContinuingSeries"); this.isContinuingSeries = isContinuingSeries; @@ -833,6 +910,7 @@ public class Metadata { return this; } + public Metadata withSkipChildren(Optional skipChildren) { Utils.checkNotNull(skipChildren, "skipChildren"); this.skipChildren = skipChildren; @@ -845,6 +923,7 @@ public class Metadata { return this; } + public Metadata withAvailabilityId(Optional availabilityId) { Utils.checkNotNull(availabilityId, "availabilityId"); this.availabilityId = availabilityId; @@ -857,6 +936,7 @@ public class Metadata { return this; } + public Metadata withStreamingMediaId(Optional streamingMediaId) { Utils.checkNotNull(streamingMediaId, "streamingMediaId"); this.streamingMediaId = streamingMediaId; @@ -869,13 +949,13 @@ public class Metadata { return this; } + public Metadata withPlayableKey(Optional playableKey) { Utils.checkNotNull(playableKey, "playableKey"); this.playableKey = playableKey; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -886,81 +966,58 @@ public class Metadata { } Metadata other = (Metadata) o; return - Objects.deepEquals(this.art, other.art) && - Objects.deepEquals(this.guid, other.guid) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.studio, other.studio) && - Objects.deepEquals(this.tagline, other.tagline) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.addedAt, other.addedAt) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.publicPagesURL, other.publicPagesURL) && - Objects.deepEquals(this.slug, other.slug) && - Objects.deepEquals(this.userState, other.userState) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.contentRating, other.contentRating) && - Objects.deepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && - Objects.deepEquals(this.year, other.year) && - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.banner, other.banner) && - Objects.deepEquals(this.rating, other.rating) && - Objects.deepEquals(this.expiresAt, other.expiresAt) && - Objects.deepEquals(this.originalTitle, other.originalTitle) && - Objects.deepEquals(this.audienceRating, other.audienceRating) && - Objects.deepEquals(this.audienceRatingImage, other.audienceRatingImage) && - Objects.deepEquals(this.ratingImage, other.ratingImage) && - Objects.deepEquals(this.imdbRatingCount, other.imdbRatingCount) && - Objects.deepEquals(this.subtype, other.subtype) && - Objects.deepEquals(this.theme, other.theme) && - Objects.deepEquals(this.leafCount, other.leafCount) && - Objects.deepEquals(this.childCount, other.childCount) && - Objects.deepEquals(this.isContinuingSeries, other.isContinuingSeries) && - Objects.deepEquals(this.skipChildren, other.skipChildren) && - Objects.deepEquals(this.availabilityId, other.availabilityId) && - Objects.deepEquals(this.streamingMediaId, other.streamingMediaId) && - Objects.deepEquals(this.playableKey, other.playableKey); + Utils.enhancedDeepEquals(this.art, other.art) && + Utils.enhancedDeepEquals(this.guid, other.guid) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.studio, other.studio) && + Utils.enhancedDeepEquals(this.tagline, other.tagline) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.addedAt, other.addedAt) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.publicPagesURL, other.publicPagesURL) && + Utils.enhancedDeepEquals(this.slug, other.slug) && + Utils.enhancedDeepEquals(this.userState, other.userState) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.contentRating, other.contentRating) && + Utils.enhancedDeepEquals(this.originallyAvailableAt, other.originallyAvailableAt) && + Utils.enhancedDeepEquals(this.year, other.year) && + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.banner, other.banner) && + Utils.enhancedDeepEquals(this.rating, other.rating) && + Utils.enhancedDeepEquals(this.expiresAt, other.expiresAt) && + Utils.enhancedDeepEquals(this.originalTitle, other.originalTitle) && + Utils.enhancedDeepEquals(this.audienceRating, other.audienceRating) && + Utils.enhancedDeepEquals(this.audienceRatingImage, other.audienceRatingImage) && + Utils.enhancedDeepEquals(this.ratingImage, other.ratingImage) && + Utils.enhancedDeepEquals(this.imdbRatingCount, other.imdbRatingCount) && + Utils.enhancedDeepEquals(this.subtype, other.subtype) && + Utils.enhancedDeepEquals(this.theme, other.theme) && + Utils.enhancedDeepEquals(this.leafCount, other.leafCount) && + Utils.enhancedDeepEquals(this.childCount, other.childCount) && + Utils.enhancedDeepEquals(this.isContinuingSeries, other.isContinuingSeries) && + Utils.enhancedDeepEquals(this.skipChildren, other.skipChildren) && + Utils.enhancedDeepEquals(this.availabilityId, other.availabilityId) && + Utils.enhancedDeepEquals(this.streamingMediaId, other.streamingMediaId) && + Utils.enhancedDeepEquals(this.playableKey, other.playableKey); } @Override public int hashCode() { - return Objects.hash( - art, - guid, - key, - ratingKey, - studio, - tagline, - type, - thumb, - addedAt, - duration, - publicPagesURL, - slug, - userState, - title, - contentRating, - originallyAvailableAt, - year, - image, - banner, - rating, - expiresAt, - originalTitle, - audienceRating, - audienceRatingImage, - ratingImage, - imdbRatingCount, - subtype, - theme, - leafCount, - childCount, - isContinuingSeries, - skipChildren, - availabilityId, - streamingMediaId, - playableKey); + return Utils.enhancedHash( + art, guid, key, + ratingKey, studio, tagline, + type, thumb, addedAt, + duration, publicPagesURL, slug, + userState, title, contentRating, + originallyAvailableAt, year, image, + banner, rating, expiresAt, + originalTitle, audienceRating, audienceRatingImage, + ratingImage, imdbRatingCount, subtype, + theme, leafCount, childCount, + isContinuingSeries, skipChildren, availabilityId, + streamingMediaId, playableKey); } @Override @@ -1002,83 +1059,85 @@ public class Metadata { "streamingMediaId", streamingMediaId, "playableKey", playableKey); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional art = Optional.empty(); - + private Optional guid = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional ratingKey = Optional.empty(); - + private Optional studio = Optional.empty(); - + private Optional tagline = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Optional addedAt = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional publicPagesURL = Optional.empty(); - + private Optional slug = Optional.empty(); - + private Optional userState = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional contentRating = Optional.empty(); - + private Optional originallyAvailableAt = Optional.empty(); - + private Optional year = Optional.empty(); - + private Optional> image = Optional.empty(); - + private Optional banner = Optional.empty(); - + private Optional rating = Optional.empty(); - + private Optional expiresAt = Optional.empty(); - + private Optional originalTitle = Optional.empty(); - + private Optional audienceRating = Optional.empty(); - + private Optional audienceRatingImage = Optional.empty(); - + private Optional ratingImage = Optional.empty(); - + private Optional imdbRatingCount = Optional.empty(); - + private Optional subtype = Optional.empty(); - + private Optional theme = Optional.empty(); - + private Optional leafCount = Optional.empty(); - + private Optional childCount = Optional.empty(); - + private Optional isContinuingSeries = Optional.empty(); - + private Optional skipChildren = Optional.empty(); - + private Optional availabilityId = Optional.empty(); - + private Optional streamingMediaId = Optional.empty(); - + private Optional playableKey = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder art(String art) { Utils.checkNotNull(art, "art"); this.art = Optional.ofNullable(art); @@ -1091,6 +1150,7 @@ public class Metadata { return this; } + public Builder guid(String guid) { Utils.checkNotNull(guid, "guid"); this.guid = Optional.ofNullable(guid); @@ -1103,6 +1163,7 @@ public class Metadata { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -1115,6 +1176,7 @@ public class Metadata { return this; } + public Builder ratingKey(String ratingKey) { Utils.checkNotNull(ratingKey, "ratingKey"); this.ratingKey = Optional.ofNullable(ratingKey); @@ -1127,6 +1189,7 @@ public class Metadata { return this; } + public Builder studio(String studio) { Utils.checkNotNull(studio, "studio"); this.studio = Optional.ofNullable(studio); @@ -1139,6 +1202,7 @@ public class Metadata { return this; } + public Builder tagline(String tagline) { Utils.checkNotNull(tagline, "tagline"); this.tagline = Optional.ofNullable(tagline); @@ -1151,6 +1215,7 @@ public class Metadata { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -1163,6 +1228,7 @@ public class Metadata { return this; } + public Builder thumb(String thumb) { Utils.checkNotNull(thumb, "thumb"); this.thumb = Optional.ofNullable(thumb); @@ -1175,6 +1241,7 @@ public class Metadata { return this; } + public Builder addedAt(int addedAt) { Utils.checkNotNull(addedAt, "addedAt"); this.addedAt = Optional.ofNullable(addedAt); @@ -1187,6 +1254,7 @@ public class Metadata { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -1199,6 +1267,7 @@ public class Metadata { return this; } + public Builder publicPagesURL(String publicPagesURL) { Utils.checkNotNull(publicPagesURL, "publicPagesURL"); this.publicPagesURL = Optional.ofNullable(publicPagesURL); @@ -1211,6 +1280,7 @@ public class Metadata { return this; } + public Builder slug(String slug) { Utils.checkNotNull(slug, "slug"); this.slug = Optional.ofNullable(slug); @@ -1223,6 +1293,7 @@ public class Metadata { return this; } + public Builder userState(boolean userState) { Utils.checkNotNull(userState, "userState"); this.userState = Optional.ofNullable(userState); @@ -1235,6 +1306,7 @@ public class Metadata { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -1247,6 +1319,7 @@ public class Metadata { return this; } + public Builder contentRating(String contentRating) { Utils.checkNotNull(contentRating, "contentRating"); this.contentRating = Optional.ofNullable(contentRating); @@ -1259,6 +1332,7 @@ public class Metadata { return this; } + public Builder originallyAvailableAt(LocalDate originallyAvailableAt) { Utils.checkNotNull(originallyAvailableAt, "originallyAvailableAt"); this.originallyAvailableAt = Optional.ofNullable(originallyAvailableAt); @@ -1271,6 +1345,7 @@ public class Metadata { return this; } + public Builder year(int year) { Utils.checkNotNull(year, "year"); this.year = Optional.ofNullable(year); @@ -1283,6 +1358,7 @@ public class Metadata { return this; } + public Builder image(List image) { Utils.checkNotNull(image, "image"); this.image = Optional.ofNullable(image); @@ -1295,6 +1371,7 @@ public class Metadata { return this; } + public Builder banner(String banner) { Utils.checkNotNull(banner, "banner"); this.banner = Optional.ofNullable(banner); @@ -1307,6 +1384,7 @@ public class Metadata { return this; } + public Builder rating(double rating) { Utils.checkNotNull(rating, "rating"); this.rating = Optional.ofNullable(rating); @@ -1319,6 +1397,7 @@ public class Metadata { return this; } + public Builder expiresAt(int expiresAt) { Utils.checkNotNull(expiresAt, "expiresAt"); this.expiresAt = Optional.ofNullable(expiresAt); @@ -1331,6 +1410,7 @@ public class Metadata { return this; } + public Builder originalTitle(String originalTitle) { Utils.checkNotNull(originalTitle, "originalTitle"); this.originalTitle = Optional.ofNullable(originalTitle); @@ -1343,6 +1423,7 @@ public class Metadata { return this; } + public Builder audienceRating(double audienceRating) { Utils.checkNotNull(audienceRating, "audienceRating"); this.audienceRating = Optional.ofNullable(audienceRating); @@ -1355,6 +1436,7 @@ public class Metadata { return this; } + public Builder audienceRatingImage(String audienceRatingImage) { Utils.checkNotNull(audienceRatingImage, "audienceRatingImage"); this.audienceRatingImage = Optional.ofNullable(audienceRatingImage); @@ -1367,6 +1449,7 @@ public class Metadata { return this; } + public Builder ratingImage(String ratingImage) { Utils.checkNotNull(ratingImage, "ratingImage"); this.ratingImage = Optional.ofNullable(ratingImage); @@ -1379,6 +1462,7 @@ public class Metadata { return this; } + public Builder imdbRatingCount(int imdbRatingCount) { Utils.checkNotNull(imdbRatingCount, "imdbRatingCount"); this.imdbRatingCount = Optional.ofNullable(imdbRatingCount); @@ -1391,6 +1475,7 @@ public class Metadata { return this; } + public Builder subtype(String subtype) { Utils.checkNotNull(subtype, "subtype"); this.subtype = Optional.ofNullable(subtype); @@ -1403,6 +1488,7 @@ public class Metadata { return this; } + public Builder theme(String theme) { Utils.checkNotNull(theme, "theme"); this.theme = Optional.ofNullable(theme); @@ -1415,6 +1501,7 @@ public class Metadata { return this; } + public Builder leafCount(int leafCount) { Utils.checkNotNull(leafCount, "leafCount"); this.leafCount = Optional.ofNullable(leafCount); @@ -1427,6 +1514,7 @@ public class Metadata { return this; } + public Builder childCount(int childCount) { Utils.checkNotNull(childCount, "childCount"); this.childCount = Optional.ofNullable(childCount); @@ -1439,6 +1527,7 @@ public class Metadata { return this; } + public Builder isContinuingSeries(boolean isContinuingSeries) { Utils.checkNotNull(isContinuingSeries, "isContinuingSeries"); this.isContinuingSeries = Optional.ofNullable(isContinuingSeries); @@ -1451,6 +1540,7 @@ public class Metadata { return this; } + public Builder skipChildren(boolean skipChildren) { Utils.checkNotNull(skipChildren, "skipChildren"); this.skipChildren = Optional.ofNullable(skipChildren); @@ -1463,6 +1553,7 @@ public class Metadata { return this; } + public Builder availabilityId(String availabilityId) { Utils.checkNotNull(availabilityId, "availabilityId"); this.availabilityId = Optional.ofNullable(availabilityId); @@ -1475,6 +1566,7 @@ public class Metadata { return this; } + public Builder streamingMediaId(String streamingMediaId) { Utils.checkNotNull(streamingMediaId, "streamingMediaId"); this.streamingMediaId = Optional.ofNullable(streamingMediaId); @@ -1487,6 +1579,7 @@ public class Metadata { return this; } + public Builder playableKey(String playableKey) { Utils.checkNotNull(playableKey, "playableKey"); this.playableKey = Optional.ofNullable(playableKey); @@ -1498,44 +1591,23 @@ public class Metadata { this.playableKey = playableKey; return this; } - + public Metadata build() { + return new Metadata( - art, - guid, - key, - ratingKey, - studio, - tagline, - type, - thumb, - addedAt, - duration, - publicPagesURL, - slug, - userState, - title, - contentRating, - originallyAvailableAt, - year, - image, - banner, - rating, - expiresAt, - originalTitle, - audienceRating, - audienceRatingImage, - ratingImage, - imdbRatingCount, - subtype, - theme, - leafCount, - childCount, - isContinuingSeries, - skipChildren, - availabilityId, - streamingMediaId, - playableKey); + art, guid, key, + ratingKey, studio, tagline, + type, thumb, addedAt, + duration, publicPagesURL, slug, + userState, title, contentRating, + originallyAvailableAt, year, image, + banner, rating, expiresAt, + originalTitle, audienceRating, audienceRatingImage, + ratingImage, imdbRatingCount, subtype, + theme, leafCount, childCount, + isContinuingSeries, skipChildren, availabilityId, + streamingMediaId, playableKey); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MinSize.java b/src/main/java/dev/plexapi/sdk/models/operations/MinSize.java index 363208ed..812b3337 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MinSize.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MinSize.java @@ -19,7 +19,7 @@ public enum MinSize { @JsonValue private final long value; - private MinSize(long value) { + MinSize(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/MyPlex.java b/src/main/java/dev/plexapi/sdk/models/operations/MyPlex.java index 33c46265..da7ac6bf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/MyPlex.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/MyPlex.java @@ -13,55 +13,66 @@ import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class MyPlex { @JsonInclude(Include.NON_ABSENT) @JsonProperty("authToken") private Optional authToken; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("username") private Optional username; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mappingState") private Optional mappingState; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mappingError") private Optional mappingError; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("signInState") private Optional signInState; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("publicAddress") private Optional publicAddress; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("publicPort") private Optional publicPort; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("privateAddress") private Optional privateAddress; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("privatePort") private Optional privatePort; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subscriptionFeatures") private Optional subscriptionFeatures; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subscriptionActive") private Optional subscriptionActive; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subscriptionState") private Optional subscriptionState; @@ -107,7 +118,10 @@ public class MyPlex { } public MyPlex() { - 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()); + 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()); } @JsonIgnore @@ -170,9 +184,10 @@ public class MyPlex { return subscriptionState; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public MyPlex withAuthToken(String authToken) { Utils.checkNotNull(authToken, "authToken"); @@ -180,6 +195,7 @@ public class MyPlex { return this; } + public MyPlex withAuthToken(Optional authToken) { Utils.checkNotNull(authToken, "authToken"); this.authToken = authToken; @@ -192,6 +208,7 @@ public class MyPlex { return this; } + public MyPlex withUsername(Optional username) { Utils.checkNotNull(username, "username"); this.username = username; @@ -204,6 +221,7 @@ public class MyPlex { return this; } + public MyPlex withMappingState(Optional mappingState) { Utils.checkNotNull(mappingState, "mappingState"); this.mappingState = mappingState; @@ -216,6 +234,7 @@ public class MyPlex { return this; } + public MyPlex withMappingError(Optional mappingError) { Utils.checkNotNull(mappingError, "mappingError"); this.mappingError = mappingError; @@ -228,6 +247,7 @@ public class MyPlex { return this; } + public MyPlex withSignInState(Optional signInState) { Utils.checkNotNull(signInState, "signInState"); this.signInState = signInState; @@ -240,6 +260,7 @@ public class MyPlex { return this; } + public MyPlex withPublicAddress(Optional publicAddress) { Utils.checkNotNull(publicAddress, "publicAddress"); this.publicAddress = publicAddress; @@ -252,6 +273,7 @@ public class MyPlex { return this; } + public MyPlex withPublicPort(Optional publicPort) { Utils.checkNotNull(publicPort, "publicPort"); this.publicPort = publicPort; @@ -264,6 +286,7 @@ public class MyPlex { return this; } + public MyPlex withPrivateAddress(Optional privateAddress) { Utils.checkNotNull(privateAddress, "privateAddress"); this.privateAddress = privateAddress; @@ -276,6 +299,7 @@ public class MyPlex { return this; } + public MyPlex withPrivatePort(Optional privatePort) { Utils.checkNotNull(privatePort, "privatePort"); this.privatePort = privatePort; @@ -288,6 +312,7 @@ public class MyPlex { return this; } + public MyPlex withSubscriptionFeatures(Optional subscriptionFeatures) { Utils.checkNotNull(subscriptionFeatures, "subscriptionFeatures"); this.subscriptionFeatures = subscriptionFeatures; @@ -300,6 +325,7 @@ public class MyPlex { return this; } + public MyPlex withSubscriptionActive(Optional subscriptionActive) { Utils.checkNotNull(subscriptionActive, "subscriptionActive"); this.subscriptionActive = subscriptionActive; @@ -312,13 +338,13 @@ public class MyPlex { return this; } + public MyPlex withSubscriptionState(Optional subscriptionState) { Utils.checkNotNull(subscriptionState, "subscriptionState"); this.subscriptionState = subscriptionState; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -329,35 +355,27 @@ public class MyPlex { } MyPlex other = (MyPlex) o; return - Objects.deepEquals(this.authToken, other.authToken) && - Objects.deepEquals(this.username, other.username) && - Objects.deepEquals(this.mappingState, other.mappingState) && - Objects.deepEquals(this.mappingError, other.mappingError) && - Objects.deepEquals(this.signInState, other.signInState) && - Objects.deepEquals(this.publicAddress, other.publicAddress) && - Objects.deepEquals(this.publicPort, other.publicPort) && - Objects.deepEquals(this.privateAddress, other.privateAddress) && - Objects.deepEquals(this.privatePort, other.privatePort) && - Objects.deepEquals(this.subscriptionFeatures, other.subscriptionFeatures) && - Objects.deepEquals(this.subscriptionActive, other.subscriptionActive) && - Objects.deepEquals(this.subscriptionState, other.subscriptionState); + Utils.enhancedDeepEquals(this.authToken, other.authToken) && + Utils.enhancedDeepEquals(this.username, other.username) && + Utils.enhancedDeepEquals(this.mappingState, other.mappingState) && + Utils.enhancedDeepEquals(this.mappingError, other.mappingError) && + Utils.enhancedDeepEquals(this.signInState, other.signInState) && + Utils.enhancedDeepEquals(this.publicAddress, other.publicAddress) && + Utils.enhancedDeepEquals(this.publicPort, other.publicPort) && + Utils.enhancedDeepEquals(this.privateAddress, other.privateAddress) && + Utils.enhancedDeepEquals(this.privatePort, other.privatePort) && + Utils.enhancedDeepEquals(this.subscriptionFeatures, other.subscriptionFeatures) && + Utils.enhancedDeepEquals(this.subscriptionActive, other.subscriptionActive) && + Utils.enhancedDeepEquals(this.subscriptionState, other.subscriptionState); } @Override public int hashCode() { - return Objects.hash( - authToken, - username, - mappingState, - mappingError, - signInState, - publicAddress, - publicPort, - privateAddress, - privatePort, - subscriptionFeatures, - subscriptionActive, - subscriptionState); + return Utils.enhancedHash( + authToken, username, mappingState, + mappingError, signInState, publicAddress, + publicPort, privateAddress, privatePort, + subscriptionFeatures, subscriptionActive, subscriptionState); } @Override @@ -376,37 +394,39 @@ public class MyPlex { "subscriptionActive", subscriptionActive, "subscriptionState", subscriptionState); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional authToken = Optional.empty(); - + private Optional username = Optional.empty(); - + private Optional mappingState = Optional.empty(); - + private Optional mappingError = Optional.empty(); - + private Optional signInState = Optional.empty(); - + private Optional publicAddress = Optional.empty(); - + private Optional publicPort = Optional.empty(); - + private Optional privateAddress = Optional.empty(); - + private Optional privatePort = Optional.empty(); - + private Optional subscriptionFeatures = Optional.empty(); - + private Optional subscriptionActive = Optional.empty(); - + private Optional subscriptionState = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder authToken(String authToken) { Utils.checkNotNull(authToken, "authToken"); this.authToken = Optional.ofNullable(authToken); @@ -419,6 +439,7 @@ public class MyPlex { return this; } + public Builder username(String username) { Utils.checkNotNull(username, "username"); this.username = Optional.ofNullable(username); @@ -431,6 +452,7 @@ public class MyPlex { return this; } + public Builder mappingState(String mappingState) { Utils.checkNotNull(mappingState, "mappingState"); this.mappingState = Optional.ofNullable(mappingState); @@ -443,6 +465,7 @@ public class MyPlex { return this; } + public Builder mappingError(String mappingError) { Utils.checkNotNull(mappingError, "mappingError"); this.mappingError = Optional.ofNullable(mappingError); @@ -455,6 +478,7 @@ public class MyPlex { return this; } + public Builder signInState(String signInState) { Utils.checkNotNull(signInState, "signInState"); this.signInState = Optional.ofNullable(signInState); @@ -467,6 +491,7 @@ public class MyPlex { return this; } + public Builder publicAddress(String publicAddress) { Utils.checkNotNull(publicAddress, "publicAddress"); this.publicAddress = Optional.ofNullable(publicAddress); @@ -479,6 +504,7 @@ public class MyPlex { return this; } + public Builder publicPort(double publicPort) { Utils.checkNotNull(publicPort, "publicPort"); this.publicPort = Optional.ofNullable(publicPort); @@ -491,6 +517,7 @@ public class MyPlex { return this; } + public Builder privateAddress(String privateAddress) { Utils.checkNotNull(privateAddress, "privateAddress"); this.privateAddress = Optional.ofNullable(privateAddress); @@ -503,6 +530,7 @@ public class MyPlex { return this; } + public Builder privatePort(double privatePort) { Utils.checkNotNull(privatePort, "privatePort"); this.privatePort = Optional.ofNullable(privatePort); @@ -515,6 +543,7 @@ public class MyPlex { return this; } + public Builder subscriptionFeatures(String subscriptionFeatures) { Utils.checkNotNull(subscriptionFeatures, "subscriptionFeatures"); this.subscriptionFeatures = Optional.ofNullable(subscriptionFeatures); @@ -527,6 +556,7 @@ public class MyPlex { return this; } + public Builder subscriptionActive(boolean subscriptionActive) { Utils.checkNotNull(subscriptionActive, "subscriptionActive"); this.subscriptionActive = Optional.ofNullable(subscriptionActive); @@ -539,6 +569,7 @@ public class MyPlex { return this; } + public Builder subscriptionState(String subscriptionState) { Utils.checkNotNull(subscriptionState, "subscriptionState"); this.subscriptionState = Optional.ofNullable(subscriptionState); @@ -550,21 +581,15 @@ public class MyPlex { this.subscriptionState = subscriptionState; return this; } - + public MyPlex build() { + return new MyPlex( - authToken, - username, - mappingState, - mappingError, - signInState, - publicAddress, - publicPort, - privateAddress, - privatePort, - subscriptionFeatures, - subscriptionActive, - subscriptionState); + authToken, username, mappingState, + mappingError, signInState, publicAddress, + publicPort, privateAddress, privatePort, + subscriptionFeatures, subscriptionActive, subscriptionState); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/One.java b/src/main/java/dev/plexapi/sdk/models/operations/One.java index 08b2edb7..46b8e041 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/One.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/One.java @@ -14,7 +14,7 @@ public enum One { @JsonValue private final int value; - private One(int value) { + One(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/OnlyTransient.java b/src/main/java/dev/plexapi/sdk/models/operations/OnlyTransient.java index 89ae32ca..db6318aa 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/OnlyTransient.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/OnlyTransient.java @@ -19,7 +19,7 @@ public enum OnlyTransient { @JsonValue private final long value; - private OnlyTransient(long value) { + OnlyTransient(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Operator.java b/src/main/java/dev/plexapi/sdk/models/operations/Operator.java index 8e3eae76..f1bb0e8d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Operator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Operator.java @@ -9,13 +9,14 @@ 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 Operator { @JsonProperty("key") private String key; + @JsonProperty("title") private String title; @@ -39,9 +40,10 @@ public class Operator { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Operator withKey(String key) { Utils.checkNotNull(key, "key"); @@ -55,7 +57,6 @@ public class Operator { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,15 +67,14 @@ public class Operator { } Operator other = (Operator) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - key, - title); + return Utils.enhancedHash( + key, title); } @Override @@ -83,33 +83,37 @@ public class Operator { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") 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 Operator build() { + return new Operator( - key, - title); + key, title); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming.java b/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming.java index 4675fc98..5e14a0c1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming.java @@ -15,7 +15,6 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; /** * OptimizedForStreaming @@ -73,12 +72,12 @@ public class OptimizedForStreaming { return false; } OptimizedForStreaming other = (OptimizedForStreaming) o; - return Objects.deepEquals(this.value.value(), other.value.value()); + return Utils.enhancedDeepEquals(this.value.value(), other.value.value()); } @Override public int hashCode() { - return Objects.hash(value.value()); + return Utils.enhancedHash(value.value()); } @SuppressWarnings("serial") diff --git a/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming1.java b/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming1.java index 6164b92f..00d0fb05 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming1.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/OptimizedForStreaming1.java @@ -14,7 +14,7 @@ public enum OptimizedForStreaming1 { @JsonValue private final int value; - private OptimizedForStreaming1(int value) { + OptimizedForStreaming1(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Owned.java b/src/main/java/dev/plexapi/sdk/models/operations/Owned.java index 0403daa4..66c4e6cc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Owned.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Owned.java @@ -19,7 +19,7 @@ public enum Owned { @JsonValue private final int value; - private Owned(int value) { + Owned(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Part.java b/src/main/java/dev/plexapi/sdk/models/operations/Part.java index 71b7d39d..457ad9bf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Part.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Part.java @@ -18,11 +18,10 @@ 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 Part { +public class Part { /** * Indicates if the part is accessible. */ @@ -49,6 +48,7 @@ public class Part { @JsonProperty("key") private String key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("indexes") private Optional indexes; @@ -72,6 +72,7 @@ public class Part { @JsonProperty("size") private long size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("packetLength") private Optional packetLength; @@ -97,6 +98,7 @@ public class Part { @JsonProperty("audioProfile") private Optional audioProfile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("has64bitOffsets") private Optional has64bitOffsets; @@ -108,6 +110,7 @@ public class Part { @JsonProperty("optimizedForStreaming") private Optional optimizedForStreaming; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasThumbnail") private Optional hasThumbnail; @@ -176,7 +179,12 @@ public class Part { String key, String file, long size) { - this(Optional.empty(), Optional.empty(), id, key, Optional.empty(), Optional.empty(), file, size, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), id, + key, Optional.empty(), Optional.empty(), + file, size, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -298,9 +306,10 @@ public class Part { return (Optional>) stream; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Indicates if the part is accessible. @@ -311,6 +320,7 @@ public class Part { return this; } + /** * Indicates if the part is accessible. */ @@ -329,6 +339,7 @@ public class Part { return this; } + /** * Indicates if the part exists. */ @@ -362,6 +373,7 @@ public class Part { return this; } + public Part withIndexes(Optional indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = indexes; @@ -377,6 +389,7 @@ public class Part { return this; } + /** * Duration of the part in milliseconds. */ @@ -410,6 +423,7 @@ public class Part { return this; } + public Part withPacketLength(Optional packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = packetLength; @@ -425,6 +439,7 @@ public class Part { return this; } + /** * Container format of the part. */ @@ -443,6 +458,7 @@ public class Part { return this; } + /** * Video profile for the part. */ @@ -461,6 +477,7 @@ public class Part { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -476,6 +493,7 @@ public class Part { return this; } + public Part withHas64bitOffsets(Optional has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = has64bitOffsets; @@ -491,6 +509,7 @@ public class Part { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -506,6 +525,7 @@ public class Part { return this; } + public Part withHasThumbnail(Optional hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = hasThumbnail; @@ -521,6 +541,7 @@ public class Part { return this; } + /** * An array of streams for this part. */ @@ -530,7 +551,6 @@ public class Part { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -541,42 +561,32 @@ public class Part { } Part other = (Part) o; return - Objects.deepEquals(this.accessible, other.accessible) && - Objects.deepEquals(this.exists, other.exists) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.indexes, other.indexes) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.file, other.file) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.packetLength, other.packetLength) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoProfile, other.videoProfile) && - Objects.deepEquals(this.audioProfile, other.audioProfile) && - Objects.deepEquals(this.has64bitOffsets, other.has64bitOffsets) && - Objects.deepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && - Objects.deepEquals(this.hasThumbnail, other.hasThumbnail) && - Objects.deepEquals(this.stream, other.stream); + Utils.enhancedDeepEquals(this.accessible, other.accessible) && + Utils.enhancedDeepEquals(this.exists, other.exists) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.indexes, other.indexes) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.file, other.file) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.packetLength, other.packetLength) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoProfile, other.videoProfile) && + Utils.enhancedDeepEquals(this.audioProfile, other.audioProfile) && + Utils.enhancedDeepEquals(this.has64bitOffsets, other.has64bitOffsets) && + Utils.enhancedDeepEquals(this.optimizedForStreaming, other.optimizedForStreaming) && + Utils.enhancedDeepEquals(this.hasThumbnail, other.hasThumbnail) && + Utils.enhancedDeepEquals(this.stream, other.stream); } @Override public int hashCode() { - return Objects.hash( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail, + return Utils.enhancedHash( + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail, stream); } @@ -600,45 +610,47 @@ public class Part { "hasThumbnail", hasThumbnail, "stream", stream); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional accessible = Optional.empty(); - + private Optional exists = Optional.empty(); - + private Long id; - + private String key; - + private Optional indexes = Optional.empty(); - + private Optional duration = Optional.empty(); - + private String file; - + private Long size; - + private Optional packetLength = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoProfile = Optional.empty(); - + private Optional audioProfile = Optional.empty(); - + private Optional has64bitOffsets = Optional.empty(); - + private Optional optimizedForStreaming = Optional.empty(); - + private Optional hasThumbnail; - + private Optional> stream = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Indicates if the part is accessible. */ @@ -657,6 +669,7 @@ public class Part { return this; } + /** * Indicates if the part exists. */ @@ -675,6 +688,7 @@ public class Part { return this; } + /** * Unique part identifier. */ @@ -684,6 +698,7 @@ public class Part { return this; } + /** * Key to access this part. */ @@ -693,6 +708,7 @@ public class Part { return this; } + public Builder indexes(String indexes) { Utils.checkNotNull(indexes, "indexes"); this.indexes = Optional.ofNullable(indexes); @@ -705,6 +721,7 @@ public class Part { return this; } + /** * Duration of the part in milliseconds. */ @@ -723,6 +740,7 @@ public class Part { return this; } + /** * File path for the part. */ @@ -732,6 +750,7 @@ public class Part { return this; } + /** * File size in bytes. */ @@ -741,6 +760,7 @@ public class Part { return this; } + public Builder packetLength(int packetLength) { Utils.checkNotNull(packetLength, "packetLength"); this.packetLength = Optional.ofNullable(packetLength); @@ -753,6 +773,7 @@ public class Part { return this; } + /** * Container format of the part. */ @@ -771,6 +792,7 @@ public class Part { return this; } + /** * Video profile for the part. */ @@ -789,6 +811,7 @@ public class Part { return this; } + /** * The audio profile used for the media (e.g., DTS, Dolby Digital, etc.). */ @@ -807,6 +830,7 @@ public class Part { return this; } + public Builder has64bitOffsets(boolean has64bitOffsets) { Utils.checkNotNull(has64bitOffsets, "has64bitOffsets"); this.has64bitOffsets = Optional.ofNullable(has64bitOffsets); @@ -819,6 +843,7 @@ public class Part { return this; } + /** * Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true */ @@ -837,6 +862,7 @@ public class Part { return this; } + public Builder hasThumbnail(HasThumbnail hasThumbnail) { Utils.checkNotNull(hasThumbnail, "hasThumbnail"); this.hasThumbnail = Optional.ofNullable(hasThumbnail); @@ -849,6 +875,7 @@ public class Part { return this; } + /** * An array of streams for this part. */ @@ -866,30 +893,22 @@ public class Part { this.stream = stream; return this; } - + public Part build() { if (hasThumbnail == null) { hasThumbnail = _SINGLETON_VALUE_HasThumbnail.value(); } + return new Part( - accessible, - exists, - id, - key, - indexes, - duration, - file, - size, - packetLength, - container, - videoProfile, - audioProfile, - has64bitOffsets, - optimizedForStreaming, - hasThumbnail, + accessible, exists, id, + key, indexes, duration, + file, size, packetLength, + container, videoProfile, audioProfile, + has64bitOffsets, optimizedForStreaming, hasThumbnail, stream); } + private static final LazySingletonValue> _SINGLETON_VALUE_HasThumbnail = new LazySingletonValue<>( "hasThumbnail", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PastSubscription.java b/src/main/java/dev/plexapi/sdk/models/operations/PastSubscription.java index d98772c1..651b41ff 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PastSubscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PastSubscription.java @@ -15,65 +15,79 @@ import java.lang.Boolean; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class PastSubscription { @JsonInclude(Include.ALWAYS) @JsonProperty("id") private Optional id; + @JsonInclude(Include.ALWAYS) @JsonProperty("mode") private Optional mode; + @JsonInclude(Include.ALWAYS) @JsonProperty("renewsAt") private Optional renewsAt; + @JsonInclude(Include.ALWAYS) @JsonProperty("endsAt") private Optional endsAt; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("canceled") private Optional canceled; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("gracePeriod") private Optional gracePeriod; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("onHold") private Optional onHold; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("canReactivate") private Optional canReactivate; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("canUpgrade") private Optional canUpgrade; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("canDowngrade") private Optional canDowngrade; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("canConvert") private Optional canConvert; + @JsonProperty("type") private String type; + @JsonInclude(Include.ALWAYS) @JsonProperty("transfer") private Optional transfer; + @JsonProperty("state") private PostUsersSignInDataState state; + @JsonProperty("billing") private Billing billing; @@ -130,7 +144,11 @@ public class PastSubscription { String type, PostUsersSignInDataState state, Billing billing) { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), type, Optional.empty(), state, billing); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), type, + Optional.empty(), state, billing); } @JsonIgnore @@ -208,9 +226,10 @@ public class PastSubscription { return billing; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PastSubscription withId(String id) { Utils.checkNotNull(id, "id"); @@ -218,6 +237,7 @@ public class PastSubscription { return this; } + public PastSubscription withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -230,6 +250,7 @@ public class PastSubscription { return this; } + public PastSubscription withMode(Optional mode) { Utils.checkNotNull(mode, "mode"); this.mode = mode; @@ -242,6 +263,7 @@ public class PastSubscription { return this; } + public PastSubscription withRenewsAt(Optional renewsAt) { Utils.checkNotNull(renewsAt, "renewsAt"); this.renewsAt = renewsAt; @@ -254,6 +276,7 @@ public class PastSubscription { return this; } + public PastSubscription withEndsAt(Optional endsAt) { Utils.checkNotNull(endsAt, "endsAt"); this.endsAt = endsAt; @@ -266,6 +289,7 @@ public class PastSubscription { return this; } + public PastSubscription withCanceled(Optional canceled) { Utils.checkNotNull(canceled, "canceled"); this.canceled = canceled; @@ -278,6 +302,7 @@ public class PastSubscription { return this; } + public PastSubscription withGracePeriod(Optional gracePeriod) { Utils.checkNotNull(gracePeriod, "gracePeriod"); this.gracePeriod = gracePeriod; @@ -290,6 +315,7 @@ public class PastSubscription { return this; } + public PastSubscription withOnHold(Optional onHold) { Utils.checkNotNull(onHold, "onHold"); this.onHold = onHold; @@ -302,6 +328,7 @@ public class PastSubscription { return this; } + public PastSubscription withCanReactivate(Optional canReactivate) { Utils.checkNotNull(canReactivate, "canReactivate"); this.canReactivate = canReactivate; @@ -314,6 +341,7 @@ public class PastSubscription { return this; } + public PastSubscription withCanUpgrade(Optional canUpgrade) { Utils.checkNotNull(canUpgrade, "canUpgrade"); this.canUpgrade = canUpgrade; @@ -326,6 +354,7 @@ public class PastSubscription { return this; } + public PastSubscription withCanDowngrade(Optional canDowngrade) { Utils.checkNotNull(canDowngrade, "canDowngrade"); this.canDowngrade = canDowngrade; @@ -338,6 +367,7 @@ public class PastSubscription { return this; } + public PastSubscription withCanConvert(Optional canConvert) { Utils.checkNotNull(canConvert, "canConvert"); this.canConvert = canConvert; @@ -356,6 +386,7 @@ public class PastSubscription { return this; } + public PastSubscription withTransfer(Optional transfer) { Utils.checkNotNull(transfer, "transfer"); this.transfer = transfer; @@ -374,7 +405,6 @@ public class PastSubscription { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -385,41 +415,31 @@ public class PastSubscription { } PastSubscription other = (PastSubscription) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.mode, other.mode) && - Objects.deepEquals(this.renewsAt, other.renewsAt) && - Objects.deepEquals(this.endsAt, other.endsAt) && - Objects.deepEquals(this.canceled, other.canceled) && - Objects.deepEquals(this.gracePeriod, other.gracePeriod) && - Objects.deepEquals(this.onHold, other.onHold) && - Objects.deepEquals(this.canReactivate, other.canReactivate) && - Objects.deepEquals(this.canUpgrade, other.canUpgrade) && - Objects.deepEquals(this.canDowngrade, other.canDowngrade) && - Objects.deepEquals(this.canConvert, other.canConvert) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.transfer, other.transfer) && - Objects.deepEquals(this.state, other.state) && - Objects.deepEquals(this.billing, other.billing); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.mode, other.mode) && + Utils.enhancedDeepEquals(this.renewsAt, other.renewsAt) && + Utils.enhancedDeepEquals(this.endsAt, other.endsAt) && + Utils.enhancedDeepEquals(this.canceled, other.canceled) && + Utils.enhancedDeepEquals(this.gracePeriod, other.gracePeriod) && + Utils.enhancedDeepEquals(this.onHold, other.onHold) && + Utils.enhancedDeepEquals(this.canReactivate, other.canReactivate) && + Utils.enhancedDeepEquals(this.canUpgrade, other.canUpgrade) && + Utils.enhancedDeepEquals(this.canDowngrade, other.canDowngrade) && + Utils.enhancedDeepEquals(this.canConvert, other.canConvert) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.transfer, other.transfer) && + Utils.enhancedDeepEquals(this.state, other.state) && + Utils.enhancedDeepEquals(this.billing, other.billing); } @Override public int hashCode() { - return Objects.hash( - id, - mode, - renewsAt, - endsAt, - canceled, - gracePeriod, - onHold, - canReactivate, - canUpgrade, - canDowngrade, - canConvert, - type, - transfer, - state, - billing); + return Utils.enhancedHash( + id, mode, renewsAt, + endsAt, canceled, gracePeriod, + onHold, canReactivate, canUpgrade, + canDowngrade, canConvert, type, + transfer, state, billing); } @Override @@ -441,43 +461,45 @@ public class PastSubscription { "state", state, "billing", billing); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional mode = Optional.empty(); - + private Optional renewsAt = Optional.empty(); - + private Optional endsAt = Optional.empty(); - + private Optional canceled; - + private Optional gracePeriod; - + private Optional onHold; - + private Optional canReactivate; - + private Optional canUpgrade; - + private Optional canDowngrade; - + private Optional canConvert; - + private String type; - + private Optional transfer = Optional.empty(); - + private PostUsersSignInDataState state; - + private Billing billing; - + private Builder() { // force use of static builder() method } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -490,6 +512,7 @@ public class PastSubscription { return this; } + public Builder mode(String mode) { Utils.checkNotNull(mode, "mode"); this.mode = Optional.ofNullable(mode); @@ -502,6 +525,7 @@ public class PastSubscription { return this; } + public Builder renewsAt(long renewsAt) { Utils.checkNotNull(renewsAt, "renewsAt"); this.renewsAt = Optional.ofNullable(renewsAt); @@ -514,6 +538,7 @@ public class PastSubscription { return this; } + public Builder endsAt(long endsAt) { Utils.checkNotNull(endsAt, "endsAt"); this.endsAt = Optional.ofNullable(endsAt); @@ -526,6 +551,7 @@ public class PastSubscription { return this; } + public Builder canceled(boolean canceled) { Utils.checkNotNull(canceled, "canceled"); this.canceled = Optional.ofNullable(canceled); @@ -538,6 +564,7 @@ public class PastSubscription { return this; } + public Builder gracePeriod(boolean gracePeriod) { Utils.checkNotNull(gracePeriod, "gracePeriod"); this.gracePeriod = Optional.ofNullable(gracePeriod); @@ -550,6 +577,7 @@ public class PastSubscription { return this; } + public Builder onHold(boolean onHold) { Utils.checkNotNull(onHold, "onHold"); this.onHold = Optional.ofNullable(onHold); @@ -562,6 +590,7 @@ public class PastSubscription { return this; } + public Builder canReactivate(boolean canReactivate) { Utils.checkNotNull(canReactivate, "canReactivate"); this.canReactivate = Optional.ofNullable(canReactivate); @@ -574,6 +603,7 @@ public class PastSubscription { return this; } + public Builder canUpgrade(boolean canUpgrade) { Utils.checkNotNull(canUpgrade, "canUpgrade"); this.canUpgrade = Optional.ofNullable(canUpgrade); @@ -586,6 +616,7 @@ public class PastSubscription { return this; } + public Builder canDowngrade(boolean canDowngrade) { Utils.checkNotNull(canDowngrade, "canDowngrade"); this.canDowngrade = Optional.ofNullable(canDowngrade); @@ -598,6 +629,7 @@ public class PastSubscription { return this; } + public Builder canConvert(boolean canConvert) { Utils.checkNotNull(canConvert, "canConvert"); this.canConvert = Optional.ofNullable(canConvert); @@ -610,12 +642,14 @@ public class PastSubscription { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } + public Builder transfer(String transfer) { Utils.checkNotNull(transfer, "transfer"); this.transfer = Optional.ofNullable(transfer); @@ -628,18 +662,20 @@ public class PastSubscription { return this; } + public Builder state(PostUsersSignInDataState state) { Utils.checkNotNull(state, "state"); this.state = state; return this; } + public Builder billing(Billing billing) { Utils.checkNotNull(billing, "billing"); this.billing = billing; return this; } - + public PastSubscription build() { if (canceled == null) { canceled = _SINGLETON_VALUE_Canceled.value(); @@ -662,24 +698,16 @@ public class PastSubscription { if (canConvert == null) { canConvert = _SINGLETON_VALUE_CanConvert.value(); } + return new PastSubscription( - id, - mode, - renewsAt, - endsAt, - canceled, - gracePeriod, - onHold, - canReactivate, - canUpgrade, - canDowngrade, - canConvert, - type, - transfer, - state, - billing); + id, mode, renewsAt, + endsAt, canceled, gracePeriod, + onHold, canReactivate, canUpgrade, + canDowngrade, canConvert, type, + transfer, state, billing); } + private static final LazySingletonValue> _SINGLETON_VALUE_Canceled = new LazySingletonValue<>( "canceled", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Pending.java b/src/main/java/dev/plexapi/sdk/models/operations/Pending.java index 30a9ab4e..3f06258d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Pending.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Pending.java @@ -19,7 +19,7 @@ public enum Pending { @JsonValue private final int value; - private Pending(int value) { + Pending(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequest.java index 974ef3bd..f837f298 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequest.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class PerformSearchRequest { +public class PerformSearchRequest { /** * The query term */ @@ -77,9 +76,10 @@ public class PerformSearchRequest { return limit; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The query term @@ -99,6 +99,7 @@ public class PerformSearchRequest { return this; } + /** * This gives context to the search, and can result in re-ordering of search result hubs */ @@ -117,6 +118,7 @@ public class PerformSearchRequest { return this; } + /** * The number of items to return per hub */ @@ -126,7 +128,6 @@ public class PerformSearchRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,17 +138,15 @@ public class PerformSearchRequest { } PerformSearchRequest other = (PerformSearchRequest) o; return - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.sectionId, other.sectionId) && - Objects.deepEquals(this.limit, other.limit); + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.sectionId, other.sectionId) && + Utils.enhancedDeepEquals(this.limit, other.limit); } @Override public int hashCode() { - return Objects.hash( - query, - sectionId, - limit); + return Utils.enhancedHash( + query, sectionId, limit); } @Override @@ -157,19 +156,21 @@ public class PerformSearchRequest { "sectionId", sectionId, "limit", limit); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String query; - + private Optional sectionId = Optional.empty(); - + private Optional limit; - + private Builder() { // force use of static builder() method } + /** * The query term */ @@ -179,6 +180,7 @@ public class PerformSearchRequest { return this; } + /** * This gives context to the search, and can result in re-ordering of search result hubs */ @@ -197,6 +199,7 @@ public class PerformSearchRequest { return this; } + /** * The number of items to return per hub */ @@ -214,17 +217,17 @@ public class PerformSearchRequest { this.limit = limit; return this; } - + public PerformSearchRequest build() { if (limit == null) { limit = _SINGLETON_VALUE_Limit.value(); } + return new PerformSearchRequest( - query, - sectionId, - limit); + query, sectionId, limit); } + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", 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 2de8c21e..c4d3677b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchRequestBuilder.java @@ -3,7 +3,11 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.PerformSearch; import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; @@ -19,10 +23,10 @@ public class PerformSearchRequestBuilder { "limit", "3", new TypeReference>() {}); - private final SDKMethodInterfaces.MethodCallPerformSearch sdk; + private final SDKConfiguration sdkConfiguration; - public PerformSearchRequestBuilder(SDKMethodInterfaces.MethodCallPerformSearch sdk) { - this.sdk = sdk; + public PerformSearchRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PerformSearchRequestBuilder query(String query) { @@ -55,14 +59,26 @@ public class PerformSearchRequestBuilder { return this; } - public PerformSearchResponse call() throws Exception { + + private PerformSearchRequest buildRequest() { if (limit == null) { limit = _SINGLETON_VALUE_Limit.value(); } - return sdk.performSearch( - query, + + PerformSearchRequest request = new PerformSearchRequest(query, sectionId, limit); + + return request; + } + + public PerformSearchResponse call() throws Exception { + + RequestOperation operation + = new PerformSearch.Sync(sdkConfiguration); + PerformSearchRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } private static final LazySingletonValue> _SINGLETON_VALUE_Limit = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchResponse.java index 48cb37b6..eec030bd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformSearchResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class PerformSearchResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class PerformSearchResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class PerformSearchResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class PerformSearchResponse implements Response { } PerformSearchResponse other = (PerformSearchResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class PerformSearchResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class PerformSearchResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class PerformSearchResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class PerformSearchResponse implements Response { this.rawResponse = rawResponse; return this; } - + public PerformSearchResponse build() { + return new PerformSearchResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequest.java index 2f449829..25c29e69 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequest.java @@ -12,11 +12,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class PerformVoiceSearchRequest { +public class PerformVoiceSearchRequest { /** * The query term */ @@ -77,9 +76,10 @@ public class PerformVoiceSearchRequest { return limit; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The query term @@ -99,6 +99,7 @@ public class PerformVoiceSearchRequest { return this; } + /** * This gives context to the search, and can result in re-ordering of search result hubs */ @@ -117,6 +118,7 @@ public class PerformVoiceSearchRequest { return this; } + /** * The number of items to return per hub */ @@ -126,7 +128,6 @@ public class PerformVoiceSearchRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,17 +138,15 @@ public class PerformVoiceSearchRequest { } PerformVoiceSearchRequest other = (PerformVoiceSearchRequest) o; return - Objects.deepEquals(this.query, other.query) && - Objects.deepEquals(this.sectionId, other.sectionId) && - Objects.deepEquals(this.limit, other.limit); + Utils.enhancedDeepEquals(this.query, other.query) && + Utils.enhancedDeepEquals(this.sectionId, other.sectionId) && + Utils.enhancedDeepEquals(this.limit, other.limit); } @Override public int hashCode() { - return Objects.hash( - query, - sectionId, - limit); + return Utils.enhancedHash( + query, sectionId, limit); } @Override @@ -157,19 +156,21 @@ public class PerformVoiceSearchRequest { "sectionId", sectionId, "limit", limit); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String query; - + private Optional sectionId = Optional.empty(); - + private Optional limit; - + private Builder() { // force use of static builder() method } + /** * The query term */ @@ -179,6 +180,7 @@ public class PerformVoiceSearchRequest { return this; } + /** * This gives context to the search, and can result in re-ordering of search result hubs */ @@ -197,6 +199,7 @@ public class PerformVoiceSearchRequest { return this; } + /** * The number of items to return per hub */ @@ -214,17 +217,17 @@ public class PerformVoiceSearchRequest { this.limit = limit; return this; } - + public PerformVoiceSearchRequest build() { if (limit == null) { limit = _SINGLETON_VALUE_Limit.value(); } + return new PerformVoiceSearchRequest( - query, - sectionId, - limit); + query, sectionId, limit); } + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java index 0e09f7bb..1e415b0c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchRequestBuilder.java @@ -3,7 +3,11 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.PerformVoiceSearch; import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; @@ -19,10 +23,10 @@ public class PerformVoiceSearchRequestBuilder { "limit", "3", new TypeReference>() {}); - private final SDKMethodInterfaces.MethodCallPerformVoiceSearch sdk; + private final SDKConfiguration sdkConfiguration; - public PerformVoiceSearchRequestBuilder(SDKMethodInterfaces.MethodCallPerformVoiceSearch sdk) { - this.sdk = sdk; + public PerformVoiceSearchRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PerformVoiceSearchRequestBuilder query(String query) { @@ -55,14 +59,26 @@ public class PerformVoiceSearchRequestBuilder { return this; } - public PerformVoiceSearchResponse call() throws Exception { + + private PerformVoiceSearchRequest buildRequest() { if (limit == null) { limit = _SINGLETON_VALUE_Limit.value(); } - return sdk.performVoiceSearch( - query, + + PerformVoiceSearchRequest request = new PerformVoiceSearchRequest(query, sectionId, limit); + + return request; + } + + public PerformVoiceSearchResponse call() throws Exception { + + RequestOperation operation + = new PerformVoiceSearch.Sync(sdkConfiguration); + PerformVoiceSearchRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } private static final LazySingletonValue> _SINGLETON_VALUE_Limit = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchResponse.java index a6ac25aa..5fa99cdf 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PerformVoiceSearchResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class PerformVoiceSearchResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class PerformVoiceSearchResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class PerformVoiceSearchResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class PerformVoiceSearchResponse implements Response { } PerformVoiceSearchResponse other = (PerformVoiceSearchResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class PerformVoiceSearchResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class PerformVoiceSearchResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class PerformVoiceSearchResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class PerformVoiceSearchResponse implements Response { this.rawResponse = rawResponse; return this; } - + public PerformVoiceSearchResponse build() { + return new PerformVoiceSearchResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Pivot.java b/src/main/java/dev/plexapi/sdk/models/operations/Pivot.java index baac8019..fb98c521 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Pivot.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Pivot.java @@ -11,31 +11,36 @@ 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 Pivot { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("context") private Optional context; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("symbol") private Optional symbol; @@ -63,7 +68,8 @@ public class Pivot { } public Pivot() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -96,9 +102,10 @@ public class Pivot { return symbol; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Pivot withId(String id) { Utils.checkNotNull(id, "id"); @@ -106,6 +113,7 @@ public class Pivot { return this; } + public Pivot withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -118,6 +126,7 @@ public class Pivot { return this; } + public Pivot withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -130,6 +139,7 @@ public class Pivot { return this; } + public Pivot withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -142,6 +152,7 @@ public class Pivot { return this; } + public Pivot withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -154,6 +165,7 @@ public class Pivot { return this; } + public Pivot withContext(Optional context) { Utils.checkNotNull(context, "context"); this.context = context; @@ -166,13 +178,13 @@ public class Pivot { return this; } + public Pivot withSymbol(Optional symbol) { Utils.checkNotNull(symbol, "symbol"); this.symbol = symbol; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -183,23 +195,19 @@ public class Pivot { } Pivot other = (Pivot) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.context, other.context) && - Objects.deepEquals(this.symbol, other.symbol); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.context, other.context) && + Utils.enhancedDeepEquals(this.symbol, other.symbol); } @Override public int hashCode() { - return Objects.hash( - id, - key, - type, - title, - context, - symbol); + return Utils.enhancedHash( + id, key, type, + title, context, symbol); } @Override @@ -212,25 +220,27 @@ public class Pivot { "context", context, "symbol", symbol); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional context = Optional.empty(); - + private Optional symbol = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -243,6 +253,7 @@ public class Pivot { return this; } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -255,6 +266,7 @@ public class Pivot { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -267,6 +279,7 @@ public class Pivot { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -279,6 +292,7 @@ public class Pivot { return this; } + public Builder context(String context) { Utils.checkNotNull(context, "context"); this.context = Optional.ofNullable(context); @@ -291,6 +305,7 @@ public class Pivot { return this; } + public Builder symbol(String symbol) { Utils.checkNotNull(symbol, "symbol"); this.symbol = Optional.ofNullable(symbol); @@ -302,15 +317,13 @@ public class Pivot { this.symbol = symbol; return this; } - + public Pivot build() { + return new Pivot( - id, - key, - type, - title, - context, - symbol); + id, key, type, + title, context, symbol); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Player.java b/src/main/java/dev/plexapi/sdk/models/operations/Player.java index 2bac3669..eb9ec590 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Player.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Player.java @@ -13,67 +13,81 @@ import java.lang.Boolean; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class Player { @JsonInclude(Include.NON_ABSENT) @JsonProperty("address") private Optional address; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("machineIdentifier") private Optional machineIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("model") private Optional model; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("platform") private Optional platform; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("platformVersion") private Optional platformVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("product") private Optional product; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("profile") private Optional profile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("remotePublicAddress") private Optional remotePublicAddress; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("state") private Optional state; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("version") private Optional version; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("local") private Optional local; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("relayed") private Optional relayed; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("secure") private Optional secure; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("userID") private Optional userID; @@ -128,7 +142,11 @@ public class Player { } public Player() { - 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()); + 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()); } @JsonIgnore @@ -206,9 +224,10 @@ public class Player { return userID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Player withAddress(String address) { Utils.checkNotNull(address, "address"); @@ -216,6 +235,7 @@ public class Player { return this; } + public Player withAddress(Optional address) { Utils.checkNotNull(address, "address"); this.address = address; @@ -228,6 +248,7 @@ public class Player { return this; } + public Player withMachineIdentifier(Optional machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = machineIdentifier; @@ -240,6 +261,7 @@ public class Player { return this; } + public Player withModel(Optional model) { Utils.checkNotNull(model, "model"); this.model = model; @@ -252,6 +274,7 @@ public class Player { return this; } + public Player withPlatform(Optional platform) { Utils.checkNotNull(platform, "platform"); this.platform = platform; @@ -264,6 +287,7 @@ public class Player { return this; } + public Player withPlatformVersion(Optional platformVersion) { Utils.checkNotNull(platformVersion, "platformVersion"); this.platformVersion = platformVersion; @@ -276,6 +300,7 @@ public class Player { return this; } + public Player withProduct(Optional product) { Utils.checkNotNull(product, "product"); this.product = product; @@ -288,6 +313,7 @@ public class Player { return this; } + public Player withProfile(Optional profile) { Utils.checkNotNull(profile, "profile"); this.profile = profile; @@ -300,6 +326,7 @@ public class Player { return this; } + public Player withRemotePublicAddress(Optional remotePublicAddress) { Utils.checkNotNull(remotePublicAddress, "remotePublicAddress"); this.remotePublicAddress = remotePublicAddress; @@ -312,6 +339,7 @@ public class Player { return this; } + public Player withState(Optional state) { Utils.checkNotNull(state, "state"); this.state = state; @@ -324,6 +352,7 @@ public class Player { return this; } + public Player withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -336,6 +365,7 @@ public class Player { return this; } + public Player withVersion(Optional version) { Utils.checkNotNull(version, "version"); this.version = version; @@ -348,6 +378,7 @@ public class Player { return this; } + public Player withLocal(Optional local) { Utils.checkNotNull(local, "local"); this.local = local; @@ -360,6 +391,7 @@ public class Player { return this; } + public Player withRelayed(Optional relayed) { Utils.checkNotNull(relayed, "relayed"); this.relayed = relayed; @@ -372,6 +404,7 @@ public class Player { return this; } + public Player withSecure(Optional secure) { Utils.checkNotNull(secure, "secure"); this.secure = secure; @@ -384,13 +417,13 @@ public class Player { return this; } + public Player withUserID(Optional userID) { Utils.checkNotNull(userID, "userID"); this.userID = userID; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -401,41 +434,31 @@ public class Player { } Player other = (Player) o; return - Objects.deepEquals(this.address, other.address) && - Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) && - Objects.deepEquals(this.model, other.model) && - Objects.deepEquals(this.platform, other.platform) && - Objects.deepEquals(this.platformVersion, other.platformVersion) && - Objects.deepEquals(this.product, other.product) && - Objects.deepEquals(this.profile, other.profile) && - Objects.deepEquals(this.remotePublicAddress, other.remotePublicAddress) && - Objects.deepEquals(this.state, other.state) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.local, other.local) && - Objects.deepEquals(this.relayed, other.relayed) && - Objects.deepEquals(this.secure, other.secure) && - Objects.deepEquals(this.userID, other.userID); + Utils.enhancedDeepEquals(this.address, other.address) && + Utils.enhancedDeepEquals(this.machineIdentifier, other.machineIdentifier) && + Utils.enhancedDeepEquals(this.model, other.model) && + Utils.enhancedDeepEquals(this.platform, other.platform) && + Utils.enhancedDeepEquals(this.platformVersion, other.platformVersion) && + Utils.enhancedDeepEquals(this.product, other.product) && + Utils.enhancedDeepEquals(this.profile, other.profile) && + Utils.enhancedDeepEquals(this.remotePublicAddress, other.remotePublicAddress) && + Utils.enhancedDeepEquals(this.state, other.state) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.local, other.local) && + Utils.enhancedDeepEquals(this.relayed, other.relayed) && + Utils.enhancedDeepEquals(this.secure, other.secure) && + Utils.enhancedDeepEquals(this.userID, other.userID); } @Override public int hashCode() { - return Objects.hash( - address, - machineIdentifier, - model, - platform, - platformVersion, - product, - profile, - remotePublicAddress, - state, - title, - version, - local, - relayed, - secure, - userID); + return Utils.enhancedHash( + address, machineIdentifier, model, + platform, platformVersion, product, + profile, remotePublicAddress, state, + title, version, local, + relayed, secure, userID); } @Override @@ -457,43 +480,45 @@ public class Player { "secure", secure, "userID", userID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional address = Optional.empty(); - + private Optional machineIdentifier = Optional.empty(); - + private Optional model = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Optional platformVersion = Optional.empty(); - + private Optional product = Optional.empty(); - + private Optional profile = Optional.empty(); - + private Optional remotePublicAddress = Optional.empty(); - + private Optional state = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional version = Optional.empty(); - + private Optional local = Optional.empty(); - + private Optional relayed = Optional.empty(); - + private Optional secure = Optional.empty(); - + private Optional userID = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder address(String address) { Utils.checkNotNull(address, "address"); this.address = Optional.ofNullable(address); @@ -506,6 +531,7 @@ public class Player { return this; } + public Builder machineIdentifier(String machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = Optional.ofNullable(machineIdentifier); @@ -518,6 +544,7 @@ public class Player { return this; } + public Builder model(String model) { Utils.checkNotNull(model, "model"); this.model = Optional.ofNullable(model); @@ -530,6 +557,7 @@ public class Player { return this; } + public Builder platform(String platform) { Utils.checkNotNull(platform, "platform"); this.platform = Optional.ofNullable(platform); @@ -542,6 +570,7 @@ public class Player { return this; } + public Builder platformVersion(String platformVersion) { Utils.checkNotNull(platformVersion, "platformVersion"); this.platformVersion = Optional.ofNullable(platformVersion); @@ -554,6 +583,7 @@ public class Player { return this; } + public Builder product(String product) { Utils.checkNotNull(product, "product"); this.product = Optional.ofNullable(product); @@ -566,6 +596,7 @@ public class Player { return this; } + public Builder profile(String profile) { Utils.checkNotNull(profile, "profile"); this.profile = Optional.ofNullable(profile); @@ -578,6 +609,7 @@ public class Player { return this; } + public Builder remotePublicAddress(String remotePublicAddress) { Utils.checkNotNull(remotePublicAddress, "remotePublicAddress"); this.remotePublicAddress = Optional.ofNullable(remotePublicAddress); @@ -590,6 +622,7 @@ public class Player { return this; } + public Builder state(String state) { Utils.checkNotNull(state, "state"); this.state = Optional.ofNullable(state); @@ -602,6 +635,7 @@ public class Player { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -614,6 +648,7 @@ public class Player { return this; } + public Builder version(String version) { Utils.checkNotNull(version, "version"); this.version = Optional.ofNullable(version); @@ -626,6 +661,7 @@ public class Player { return this; } + public Builder local(boolean local) { Utils.checkNotNull(local, "local"); this.local = Optional.ofNullable(local); @@ -638,6 +674,7 @@ public class Player { return this; } + public Builder relayed(boolean relayed) { Utils.checkNotNull(relayed, "relayed"); this.relayed = Optional.ofNullable(relayed); @@ -650,6 +687,7 @@ public class Player { return this; } + public Builder secure(boolean secure) { Utils.checkNotNull(secure, "secure"); this.secure = Optional.ofNullable(secure); @@ -662,6 +700,7 @@ public class Player { return this; } + public Builder userID(int userID) { Utils.checkNotNull(userID, "userID"); this.userID = Optional.ofNullable(userID); @@ -673,24 +712,16 @@ public class Player { this.userID = userID; return this; } - + public Player build() { + return new Player( - address, - machineIdentifier, - model, - platform, - platformVersion, - product, - profile, - remotePublicAddress, - state, - title, - version, - local, - relayed, - secure, - userID); + address, machineIdentifier, model, + platform, platformVersion, product, + profile, remotePublicAddress, state, + title, version, local, + relayed, secure, userID); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PlexDevice.java b/src/main/java/dev/plexapi/sdk/models/operations/PlexDevice.java index 26129e9f..e49d424b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PlexDevice.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PlexDevice.java @@ -15,41 +15,50 @@ import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; import java.util.List; -import java.util.Objects; import java.util.Optional; + public class PlexDevice { @JsonProperty("name") private String name; + @JsonProperty("product") private String product; + @JsonProperty("productVersion") private String productVersion; + @JsonInclude(Include.ALWAYS) @JsonProperty("platform") private Optional platform; + @JsonInclude(Include.ALWAYS) @JsonProperty("platformVersion") private Optional platformVersion; + @JsonInclude(Include.ALWAYS) @JsonProperty("device") private Optional device; + @JsonProperty("clientIdentifier") private String clientIdentifier; + @JsonProperty("createdAt") private OffsetDateTime createdAt; + @JsonProperty("lastSeenAt") private OffsetDateTime lastSeenAt; + @JsonProperty("provides") private String provides; @@ -60,43 +69,56 @@ public class PlexDevice { @JsonProperty("ownerId") private Optional ownerId; + @JsonInclude(Include.ALWAYS) @JsonProperty("sourceTitle") private Optional sourceTitle; + @JsonProperty("publicAddress") private String publicAddress; + @JsonProperty("accessToken") private String accessToken; + @JsonProperty("owned") private boolean owned; + @JsonProperty("home") private boolean home; + @JsonProperty("synced") private boolean synced; + @JsonProperty("relay") private boolean relay; + @JsonProperty("presence") private boolean presence; + @JsonProperty("httpsRequired") private boolean httpsRequired; + @JsonProperty("publicAddressMatches") private boolean publicAddressMatches; + @JsonProperty("dnsRebindingProtection") private boolean dnsRebindingProtection; + @JsonProperty("natLoopbackSupported") private boolean natLoopbackSupported; + @JsonProperty("connections") private List connections; @@ -196,7 +218,14 @@ public class PlexDevice { boolean dnsRebindingProtection, boolean natLoopbackSupported, List connections) { - this(name, product, productVersion, Optional.empty(), Optional.empty(), Optional.empty(), clientIdentifier, createdAt, lastSeenAt, provides, Optional.empty(), Optional.empty(), publicAddress, accessToken, owned, home, synced, relay, presence, httpsRequired, publicAddressMatches, dnsRebindingProtection, natLoopbackSupported, connections); + this(name, product, productVersion, + Optional.empty(), Optional.empty(), Optional.empty(), + clientIdentifier, createdAt, lastSeenAt, + provides, Optional.empty(), Optional.empty(), + publicAddress, accessToken, owned, + home, synced, relay, + presence, httpsRequired, publicAddressMatches, + dnsRebindingProtection, natLoopbackSupported, connections); } @JsonIgnore @@ -322,9 +351,10 @@ public class PlexDevice { return connections; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PlexDevice withName(String name) { Utils.checkNotNull(name, "name"); @@ -350,6 +380,7 @@ public class PlexDevice { return this; } + public PlexDevice withPlatform(Optional platform) { Utils.checkNotNull(platform, "platform"); this.platform = platform; @@ -362,6 +393,7 @@ public class PlexDevice { return this; } + public PlexDevice withPlatformVersion(Optional platformVersion) { Utils.checkNotNull(platformVersion, "platformVersion"); this.platformVersion = platformVersion; @@ -374,6 +406,7 @@ public class PlexDevice { return this; } + public PlexDevice withDevice(Optional device) { Utils.checkNotNull(device, "device"); this.device = device; @@ -413,6 +446,7 @@ public class PlexDevice { return this; } + /** * ownerId is null when the device is owned by the token used to send the request */ @@ -428,6 +462,7 @@ public class PlexDevice { return this; } + public PlexDevice withSourceTitle(Optional sourceTitle) { Utils.checkNotNull(sourceTitle, "sourceTitle"); this.sourceTitle = sourceTitle; @@ -506,7 +541,6 @@ public class PlexDevice { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -517,59 +551,43 @@ public class PlexDevice { } PlexDevice other = (PlexDevice) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.product, other.product) && - Objects.deepEquals(this.productVersion, other.productVersion) && - Objects.deepEquals(this.platform, other.platform) && - Objects.deepEquals(this.platformVersion, other.platformVersion) && - Objects.deepEquals(this.device, other.device) && - Objects.deepEquals(this.clientIdentifier, other.clientIdentifier) && - Objects.deepEquals(this.createdAt, other.createdAt) && - Objects.deepEquals(this.lastSeenAt, other.lastSeenAt) && - Objects.deepEquals(this.provides, other.provides) && - Objects.deepEquals(this.ownerId, other.ownerId) && - Objects.deepEquals(this.sourceTitle, other.sourceTitle) && - Objects.deepEquals(this.publicAddress, other.publicAddress) && - Objects.deepEquals(this.accessToken, other.accessToken) && - Objects.deepEquals(this.owned, other.owned) && - Objects.deepEquals(this.home, other.home) && - Objects.deepEquals(this.synced, other.synced) && - Objects.deepEquals(this.relay, other.relay) && - Objects.deepEquals(this.presence, other.presence) && - Objects.deepEquals(this.httpsRequired, other.httpsRequired) && - Objects.deepEquals(this.publicAddressMatches, other.publicAddressMatches) && - Objects.deepEquals(this.dnsRebindingProtection, other.dnsRebindingProtection) && - Objects.deepEquals(this.natLoopbackSupported, other.natLoopbackSupported) && - Objects.deepEquals(this.connections, other.connections); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.product, other.product) && + Utils.enhancedDeepEquals(this.productVersion, other.productVersion) && + Utils.enhancedDeepEquals(this.platform, other.platform) && + Utils.enhancedDeepEquals(this.platformVersion, other.platformVersion) && + Utils.enhancedDeepEquals(this.device, other.device) && + Utils.enhancedDeepEquals(this.clientIdentifier, other.clientIdentifier) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.lastSeenAt, other.lastSeenAt) && + Utils.enhancedDeepEquals(this.provides, other.provides) && + Utils.enhancedDeepEquals(this.ownerId, other.ownerId) && + Utils.enhancedDeepEquals(this.sourceTitle, other.sourceTitle) && + Utils.enhancedDeepEquals(this.publicAddress, other.publicAddress) && + Utils.enhancedDeepEquals(this.accessToken, other.accessToken) && + Utils.enhancedDeepEquals(this.owned, other.owned) && + Utils.enhancedDeepEquals(this.home, other.home) && + Utils.enhancedDeepEquals(this.synced, other.synced) && + Utils.enhancedDeepEquals(this.relay, other.relay) && + Utils.enhancedDeepEquals(this.presence, other.presence) && + Utils.enhancedDeepEquals(this.httpsRequired, other.httpsRequired) && + Utils.enhancedDeepEquals(this.publicAddressMatches, other.publicAddressMatches) && + Utils.enhancedDeepEquals(this.dnsRebindingProtection, other.dnsRebindingProtection) && + Utils.enhancedDeepEquals(this.natLoopbackSupported, other.natLoopbackSupported) && + Utils.enhancedDeepEquals(this.connections, other.connections); } @Override public int hashCode() { - return Objects.hash( - name, - product, - productVersion, - platform, - platformVersion, - device, - clientIdentifier, - createdAt, - lastSeenAt, - provides, - ownerId, - sourceTitle, - publicAddress, - accessToken, - owned, - home, - synced, - relay, - presence, - httpsRequired, - publicAddressMatches, - dnsRebindingProtection, - natLoopbackSupported, - connections); + return Utils.enhancedHash( + name, product, productVersion, + platform, platformVersion, device, + clientIdentifier, createdAt, lastSeenAt, + provides, ownerId, sourceTitle, + publicAddress, accessToken, owned, + home, synced, relay, + presence, httpsRequired, publicAddressMatches, + dnsRebindingProtection, natLoopbackSupported, connections); } @Override @@ -600,79 +618,84 @@ public class PlexDevice { "natLoopbackSupported", natLoopbackSupported, "connections", connections); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String name; - + private String product; - + private String productVersion; - + private Optional platform = Optional.empty(); - + private Optional platformVersion = Optional.empty(); - + private Optional device = Optional.empty(); - + private String clientIdentifier; - + private OffsetDateTime createdAt; - + private OffsetDateTime lastSeenAt; - + private String provides; - + private Optional ownerId = Optional.empty(); - + private Optional sourceTitle = Optional.empty(); - + private String publicAddress; - + private String accessToken; - + private Boolean owned; - + private Boolean home; - + private Boolean synced; - + private Boolean relay; - + private Boolean presence; - + private Boolean httpsRequired; - + private Boolean publicAddressMatches; - + private Boolean dnsRebindingProtection; - + private Boolean natLoopbackSupported; - + private List connections; - + private Builder() { // force use of static builder() method } + public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = name; return this; } + public Builder product(String product) { Utils.checkNotNull(product, "product"); this.product = product; return this; } + public Builder productVersion(String productVersion) { Utils.checkNotNull(productVersion, "productVersion"); this.productVersion = productVersion; return this; } + public Builder platform(String platform) { Utils.checkNotNull(platform, "platform"); this.platform = Optional.ofNullable(platform); @@ -685,6 +708,7 @@ public class PlexDevice { return this; } + public Builder platformVersion(String platformVersion) { Utils.checkNotNull(platformVersion, "platformVersion"); this.platformVersion = Optional.ofNullable(platformVersion); @@ -697,6 +721,7 @@ public class PlexDevice { return this; } + public Builder device(String device) { Utils.checkNotNull(device, "device"); this.device = Optional.ofNullable(device); @@ -709,30 +734,35 @@ public class PlexDevice { return this; } + public Builder clientIdentifier(String clientIdentifier) { Utils.checkNotNull(clientIdentifier, "clientIdentifier"); this.clientIdentifier = clientIdentifier; return this; } + public Builder createdAt(OffsetDateTime createdAt) { Utils.checkNotNull(createdAt, "createdAt"); this.createdAt = createdAt; return this; } + public Builder lastSeenAt(OffsetDateTime lastSeenAt) { Utils.checkNotNull(lastSeenAt, "lastSeenAt"); this.lastSeenAt = lastSeenAt; return this; } + public Builder provides(String provides) { Utils.checkNotNull(provides, "provides"); this.provides = provides; return this; } + /** * ownerId is null when the device is owned by the token used to send the request */ @@ -751,6 +781,7 @@ public class PlexDevice { return this; } + public Builder sourceTitle(String sourceTitle) { Utils.checkNotNull(sourceTitle, "sourceTitle"); this.sourceTitle = Optional.ofNullable(sourceTitle); @@ -763,104 +794,102 @@ public class PlexDevice { return this; } + public Builder publicAddress(String publicAddress) { Utils.checkNotNull(publicAddress, "publicAddress"); this.publicAddress = publicAddress; return this; } + public Builder accessToken(String accessToken) { Utils.checkNotNull(accessToken, "accessToken"); this.accessToken = accessToken; return this; } + public Builder owned(boolean owned) { Utils.checkNotNull(owned, "owned"); this.owned = owned; return this; } + public Builder home(boolean home) { Utils.checkNotNull(home, "home"); this.home = home; return this; } + public Builder synced(boolean synced) { Utils.checkNotNull(synced, "synced"); this.synced = synced; return this; } + public Builder relay(boolean relay) { Utils.checkNotNull(relay, "relay"); this.relay = relay; return this; } + public Builder presence(boolean presence) { Utils.checkNotNull(presence, "presence"); this.presence = presence; return this; } + public Builder httpsRequired(boolean httpsRequired) { Utils.checkNotNull(httpsRequired, "httpsRequired"); this.httpsRequired = httpsRequired; return this; } + public Builder publicAddressMatches(boolean publicAddressMatches) { Utils.checkNotNull(publicAddressMatches, "publicAddressMatches"); this.publicAddressMatches = publicAddressMatches; return this; } + public Builder dnsRebindingProtection(boolean dnsRebindingProtection) { Utils.checkNotNull(dnsRebindingProtection, "dnsRebindingProtection"); this.dnsRebindingProtection = dnsRebindingProtection; return this; } + public Builder natLoopbackSupported(boolean natLoopbackSupported) { Utils.checkNotNull(natLoopbackSupported, "natLoopbackSupported"); this.natLoopbackSupported = natLoopbackSupported; return this; } + public Builder connections(List connections) { Utils.checkNotNull(connections, "connections"); this.connections = connections; return this; } - + public PlexDevice build() { + return new PlexDevice( - name, - product, - productVersion, - platform, - platformVersion, - device, - clientIdentifier, - createdAt, - lastSeenAt, - provides, - ownerId, - sourceTitle, - publicAddress, - accessToken, - owned, - home, - synced, - relay, - presence, - httpsRequired, - publicAddressMatches, - dnsRebindingProtection, - natLoopbackSupported, - connections); + name, product, productVersion, + platform, platformVersion, device, + clientIdentifier, createdAt, lastSeenAt, + provides, ownerId, sourceTitle, + publicAddress, accessToken, owned, + home, synced, relay, + presence, httpsRequired, publicAddressMatches, + dnsRebindingProtection, natLoopbackSupported, connections); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsRequest.java index 0bd0cf15..e109367c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class PostMediaArtsRequest { +public class PostMediaArtsRequest { /** * the id of the library item to return the posters of. */ @@ -75,9 +74,10 @@ public class PostMediaArtsRequest { return requestBody; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the id of the library item to return the posters of. @@ -97,6 +97,7 @@ public class PostMediaArtsRequest { return this; } + /** * The URL of the image, if uploading a remote image */ @@ -115,6 +116,7 @@ public class PostMediaArtsRequest { return this; } + /** * The contents of the image, if uploading a local file */ @@ -124,7 +126,6 @@ public class PostMediaArtsRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -135,17 +136,15 @@ public class PostMediaArtsRequest { } PostMediaArtsRequest other = (PostMediaArtsRequest) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.requestBody, other.requestBody); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.requestBody, other.requestBody); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - url, - requestBody); + return Utils.enhancedHash( + ratingKey, url, requestBody); } @Override @@ -155,19 +154,21 @@ public class PostMediaArtsRequest { "url", url, "requestBody", requestBody); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long ratingKey; - + private Optional url = Optional.empty(); - + private Optional requestBody = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * the id of the library item to return the posters of. */ @@ -177,6 +178,7 @@ public class PostMediaArtsRequest { return this; } + /** * The URL of the image, if uploading a remote image */ @@ -195,6 +197,7 @@ public class PostMediaArtsRequest { return this; } + /** * The contents of the image, if uploading a local file */ @@ -212,12 +215,12 @@ public class PostMediaArtsRequest { this.requestBody = requestBody; return this; } - + public PostMediaArtsRequest build() { + return new PostMediaArtsRequest( - ratingKey, - url, - requestBody); + ratingKey, url, requestBody); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsRequestBuilder.java index d24053ed..daec007b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.PostMediaArts; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -14,10 +18,10 @@ public class PostMediaArtsRequestBuilder { private Long ratingKey; private Optional url = Optional.empty(); private Optional requestBody = Optional.empty(); - private final SDKMethodInterfaces.MethodCallPostMediaArts sdk; + private final SDKConfiguration sdkConfiguration; - public PostMediaArtsRequestBuilder(SDKMethodInterfaces.MethodCallPostMediaArts sdk) { - this.sdk = sdk; + public PostMediaArtsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostMediaArtsRequestBuilder ratingKey(long ratingKey) { @@ -50,11 +54,22 @@ public class PostMediaArtsRequestBuilder { return this; } - public PostMediaArtsResponse call() throws Exception { - return sdk.postMediaArts( - ratingKey, + private PostMediaArtsRequest buildRequest() { + + PostMediaArtsRequest request = new PostMediaArtsRequest(ratingKey, url, requestBody); + + return request; + } + + public PostMediaArtsResponse call() throws Exception { + + RequestOperation operation + = new PostMediaArts.Sync(sdkConfiguration); + PostMediaArtsRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsResponse.java index 80ac19f4..8428eb26 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaArtsResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class PostMediaArtsResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class PostMediaArtsResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class PostMediaArtsResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class PostMediaArtsResponse implements Response { } PostMediaArtsResponse other = (PostMediaArtsResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class PostMediaArtsResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class PostMediaArtsResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class PostMediaArtsResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class PostMediaArtsResponse implements Response { this.rawResponse = rawResponse; return this; } - + public PostMediaArtsResponse build() { + return new PostMediaArtsResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterRequest.java index 2615c346..478e8909 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class PostMediaPosterRequest { +public class PostMediaPosterRequest { /** * the id of the library item to return the posters of. */ @@ -75,9 +74,10 @@ public class PostMediaPosterRequest { return requestBody; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the id of the library item to return the posters of. @@ -97,6 +97,7 @@ public class PostMediaPosterRequest { return this; } + /** * The URL of the image, if uploading a remote image */ @@ -115,6 +116,7 @@ public class PostMediaPosterRequest { return this; } + /** * The contents of the image, if uploading a local file */ @@ -124,7 +126,6 @@ public class PostMediaPosterRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -135,17 +136,15 @@ public class PostMediaPosterRequest { } PostMediaPosterRequest other = (PostMediaPosterRequest) o; return - Objects.deepEquals(this.ratingKey, other.ratingKey) && - Objects.deepEquals(this.url, other.url) && - Objects.deepEquals(this.requestBody, other.requestBody); + Utils.enhancedDeepEquals(this.ratingKey, other.ratingKey) && + Utils.enhancedDeepEquals(this.url, other.url) && + Utils.enhancedDeepEquals(this.requestBody, other.requestBody); } @Override public int hashCode() { - return Objects.hash( - ratingKey, - url, - requestBody); + return Utils.enhancedHash( + ratingKey, url, requestBody); } @Override @@ -155,19 +154,21 @@ public class PostMediaPosterRequest { "url", url, "requestBody", requestBody); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long ratingKey; - + private Optional url = Optional.empty(); - + private Optional requestBody = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * the id of the library item to return the posters of. */ @@ -177,6 +178,7 @@ public class PostMediaPosterRequest { return this; } + /** * The URL of the image, if uploading a remote image */ @@ -195,6 +197,7 @@ public class PostMediaPosterRequest { return this; } + /** * The contents of the image, if uploading a local file */ @@ -212,12 +215,12 @@ public class PostMediaPosterRequest { this.requestBody = requestBody; return this; } - + public PostMediaPosterRequest build() { + return new PostMediaPosterRequest( - ratingKey, - url, - requestBody); + ratingKey, url, requestBody); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterRequestBuilder.java index f17dff69..79028a82 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.PostMediaPoster; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.Long; @@ -14,10 +18,10 @@ public class PostMediaPosterRequestBuilder { private Long ratingKey; private Optional url = Optional.empty(); private Optional requestBody = Optional.empty(); - private final SDKMethodInterfaces.MethodCallPostMediaPoster sdk; + private final SDKConfiguration sdkConfiguration; - public PostMediaPosterRequestBuilder(SDKMethodInterfaces.MethodCallPostMediaPoster sdk) { - this.sdk = sdk; + public PostMediaPosterRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostMediaPosterRequestBuilder ratingKey(long ratingKey) { @@ -50,11 +54,22 @@ public class PostMediaPosterRequestBuilder { return this; } - public PostMediaPosterResponse call() throws Exception { - return sdk.postMediaPoster( - ratingKey, + private PostMediaPosterRequest buildRequest() { + + PostMediaPosterRequest request = new PostMediaPosterRequest(ratingKey, url, requestBody); + + return request; + } + + public PostMediaPosterResponse call() throws Exception { + + RequestOperation operation + = new PostMediaPoster.Sync(sdkConfiguration); + PostMediaPosterRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterResponse.java index 52b0c0fc..7fa649ef 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostMediaPosterResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class PostMediaPosterResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class PostMediaPosterResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class PostMediaPosterResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class PostMediaPosterResponse implements Response { } PostMediaPosterResponse other = (PostMediaPosterResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class PostMediaPosterResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class PostMediaPosterResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class PostMediaPosterResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class PostMediaPosterResponse implements Response { this.rawResponse = rawResponse; return this; } - + public PostMediaPosterResponse build() { + return new PostMediaPosterResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java index 0deb36d6..d297afaa 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAuthenticationSubscription.java @@ -14,12 +14,11 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; -public class PostUsersSignInDataAuthenticationSubscription { +public class PostUsersSignInDataAuthenticationSubscription { /** * List of features allowed on your Plex Pass subscription */ @@ -85,7 +84,8 @@ public class PostUsersSignInDataAuthenticationSubscription { } public PostUsersSignInDataAuthenticationSubscription() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); } /** @@ -138,9 +138,10 @@ public class PostUsersSignInDataAuthenticationSubscription { return plan; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * List of features allowed on your Plex Pass subscription @@ -151,6 +152,7 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } + /** * List of features allowed on your Plex Pass subscription */ @@ -169,6 +171,7 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } + /** * If the account's Plex Pass subscription is active */ @@ -205,6 +208,7 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } + /** * String representation of subscriptionActive */ @@ -250,7 +254,6 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -261,23 +264,19 @@ public class PostUsersSignInDataAuthenticationSubscription { } PostUsersSignInDataAuthenticationSubscription other = (PostUsersSignInDataAuthenticationSubscription) o; return - Objects.deepEquals(this.features, other.features) && - Objects.deepEquals(this.active, other.active) && - Objects.deepEquals(this.subscribedAt, other.subscribedAt) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.paymentService, other.paymentService) && - Objects.deepEquals(this.plan, other.plan); + Utils.enhancedDeepEquals(this.features, other.features) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.subscribedAt, other.subscribedAt) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.paymentService, other.paymentService) && + Utils.enhancedDeepEquals(this.plan, other.plan); } @Override public int hashCode() { - return Objects.hash( - features, - active, - subscribedAt, - status, - paymentService, - plan); + return Utils.enhancedHash( + features, active, subscribedAt, + status, paymentService, plan); } @Override @@ -290,25 +289,27 @@ public class PostUsersSignInDataAuthenticationSubscription { "paymentService", paymentService, "plan", plan); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> features = Optional.empty(); - + private Optional active = Optional.empty(); - + private JsonNullable subscribedAt = JsonNullable.undefined(); - + private Optional status = Optional.empty(); - + private JsonNullable paymentService = JsonNullable.undefined(); - + private JsonNullable plan = JsonNullable.undefined(); - + private Builder() { // force use of static builder() method } + /** * List of features allowed on your Plex Pass subscription */ @@ -327,6 +328,7 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } + /** * If the account's Plex Pass subscription is active */ @@ -345,6 +347,7 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } + /** * Date the account subscribed to Plex Pass */ @@ -363,6 +366,7 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } + /** * String representation of subscriptionActive */ @@ -381,6 +385,7 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } + /** * Payment service used for your Plex Pass subscription */ @@ -399,6 +404,7 @@ public class PostUsersSignInDataAuthenticationSubscription { return this; } + /** * Name of Plex Pass subscription plan */ @@ -416,15 +422,13 @@ public class PostUsersSignInDataAuthenticationSubscription { this.plan = plan; return this; } - + public PostUsersSignInDataAuthenticationSubscription build() { + return new PostUsersSignInDataAuthenticationSubscription( - features, - active, - subscribedAt, - status, - paymentService, - plan); + features, active, subscribedAt, + status, paymentService, plan); } + } } 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 f000fbbc..587d2965 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataAutoSelectSubtitle.java @@ -19,7 +19,7 @@ public enum PostUsersSignInDataAutoSelectSubtitle { @JsonValue private final int value; - private PostUsersSignInDataAutoSelectSubtitle(int value) { + PostUsersSignInDataAutoSelectSubtitle(int value) { this.value = 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 6dfa90b3..7c166525 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleAccessibility.java @@ -19,7 +19,7 @@ public enum PostUsersSignInDataDefaultSubtitleAccessibility { @JsonValue private final int value; - private PostUsersSignInDataDefaultSubtitleAccessibility(int value) { + PostUsersSignInDataDefaultSubtitleAccessibility(int value) { this.value = 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 47c5559a..d9476cbb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataDefaultSubtitleForced.java @@ -19,7 +19,7 @@ public enum PostUsersSignInDataDefaultSubtitleForced { @JsonValue private final int value; - private PostUsersSignInDataDefaultSubtitleForced(int value) { + PostUsersSignInDataDefaultSubtitleForced(int value) { this.value = 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 fdcad61c..2c111a91 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataMediaReviewsVisibility.java @@ -19,7 +19,7 @@ public enum PostUsersSignInDataMediaReviewsVisibility { @JsonValue private final int value; - private PostUsersSignInDataMediaReviewsVisibility(int value) { + PostUsersSignInDataMediaReviewsVisibility(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java index 46c0f707..5d7f4017 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequest.java @@ -10,11 +10,10 @@ 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 { +public class PostUsersSignInDataRequest { /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @@ -75,7 +74,8 @@ public class PostUsersSignInDataRequest { public PostUsersSignInDataRequest( String clientID) { - this(clientID, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(clientID, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -127,9 +127,10 @@ public class PostUsersSignInDataRequest { return (Optional) requestBody; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) @@ -149,6 +150,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -167,6 +169,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * A relatively friendly name for the client device */ @@ -185,6 +188,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * The version of the client application. */ @@ -203,6 +207,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * The platform of the client application. */ @@ -221,6 +226,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * Login credentials */ @@ -230,7 +236,6 @@ public class PostUsersSignInDataRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -241,23 +246,19 @@ public class PostUsersSignInDataRequest { } PostUsersSignInDataRequest other = (PostUsersSignInDataRequest) o; return - Objects.deepEquals(this.clientID, other.clientID) && - Objects.deepEquals(this.clientName, other.clientName) && - Objects.deepEquals(this.deviceNickname, other.deviceNickname) && - Objects.deepEquals(this.clientVersion, other.clientVersion) && - Objects.deepEquals(this.platform, other.platform) && - Objects.deepEquals(this.requestBody, other.requestBody); + Utils.enhancedDeepEquals(this.clientID, other.clientID) && + Utils.enhancedDeepEquals(this.clientName, other.clientName) && + Utils.enhancedDeepEquals(this.deviceNickname, other.deviceNickname) && + Utils.enhancedDeepEquals(this.clientVersion, other.clientVersion) && + Utils.enhancedDeepEquals(this.platform, other.platform) && + Utils.enhancedDeepEquals(this.requestBody, other.requestBody); } @Override public int hashCode() { - return Objects.hash( - clientID, - clientName, - deviceNickname, - clientVersion, - platform, - requestBody); + return Utils.enhancedHash( + clientID, clientName, deviceNickname, + clientVersion, platform, requestBody); } @Override @@ -270,25 +271,27 @@ public class PostUsersSignInDataRequest { "platform", platform, "requestBody", requestBody); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String clientID; - + private Optional clientName = Optional.empty(); - + private Optional deviceNickname = Optional.empty(); - + private Optional clientVersion = Optional.empty(); - + private Optional platform = Optional.empty(); - + private Optional requestBody = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ @@ -298,6 +301,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -316,6 +320,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * A relatively friendly name for the client device */ @@ -334,6 +339,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * The version of the client application. */ @@ -352,6 +358,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * The platform of the client application. */ @@ -370,6 +377,7 @@ public class PostUsersSignInDataRequest { return this; } + /** * Login credentials */ @@ -387,15 +395,13 @@ public class PostUsersSignInDataRequest { this.requestBody = requestBody; return this; } - + public PostUsersSignInDataRequest build() { + return new PostUsersSignInDataRequest( - clientID, - clientName, - deviceNickname, - clientVersion, - platform, - requestBody); + clientID, clientName, deviceNickname, + clientVersion, platform, requestBody); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBody.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBody.java index c975490e..8b5ea1a4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBody.java @@ -12,7 +12,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; /** @@ -25,12 +24,15 @@ public class PostUsersSignInDataRequestBody { @SpeakeasyMetadata("form:name=login") private String login; + @SpeakeasyMetadata("form:name=password") private String password; + @SpeakeasyMetadata("form:name=rememberMe") private Optional rememberMe; + @SpeakeasyMetadata("form:name=verificationCode") private Optional verificationCode; @@ -53,7 +55,8 @@ public class PostUsersSignInDataRequestBody { public PostUsersSignInDataRequestBody( String login, String password) { - this(login, password, Optional.empty(), Optional.empty()); + this(login, password, Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -76,9 +79,10 @@ public class PostUsersSignInDataRequestBody { return verificationCode; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PostUsersSignInDataRequestBody withLogin(String login) { Utils.checkNotNull(login, "login"); @@ -98,6 +102,7 @@ public class PostUsersSignInDataRequestBody { return this; } + public PostUsersSignInDataRequestBody withRememberMe(Optional rememberMe) { Utils.checkNotNull(rememberMe, "rememberMe"); this.rememberMe = rememberMe; @@ -110,13 +115,13 @@ public class PostUsersSignInDataRequestBody { return this; } + public PostUsersSignInDataRequestBody withVerificationCode(Optional verificationCode) { Utils.checkNotNull(verificationCode, "verificationCode"); this.verificationCode = verificationCode; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -127,18 +132,16 @@ public class PostUsersSignInDataRequestBody { } PostUsersSignInDataRequestBody other = (PostUsersSignInDataRequestBody) o; return - Objects.deepEquals(this.login, other.login) && - Objects.deepEquals(this.password, other.password) && - Objects.deepEquals(this.rememberMe, other.rememberMe) && - Objects.deepEquals(this.verificationCode, other.verificationCode); + Utils.enhancedDeepEquals(this.login, other.login) && + Utils.enhancedDeepEquals(this.password, other.password) && + Utils.enhancedDeepEquals(this.rememberMe, other.rememberMe) && + Utils.enhancedDeepEquals(this.verificationCode, other.verificationCode); } @Override public int hashCode() { - return Objects.hash( - login, - password, - rememberMe, + return Utils.enhancedHash( + login, password, rememberMe, verificationCode); } @@ -150,33 +153,37 @@ public class PostUsersSignInDataRequestBody { "rememberMe", rememberMe, "verificationCode", verificationCode); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String login; - + private String password; - + private Optional rememberMe; - + private Optional verificationCode = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder login(String login) { Utils.checkNotNull(login, "login"); this.login = login; return this; } + public Builder password(String password) { Utils.checkNotNull(password, "password"); this.password = password; return this; } + public Builder rememberMe(boolean rememberMe) { Utils.checkNotNull(rememberMe, "rememberMe"); this.rememberMe = Optional.ofNullable(rememberMe); @@ -189,6 +196,7 @@ public class PostUsersSignInDataRequestBody { return this; } + public Builder verificationCode(String verificationCode) { Utils.checkNotNull(verificationCode, "verificationCode"); this.verificationCode = Optional.ofNullable(verificationCode); @@ -200,18 +208,18 @@ public class PostUsersSignInDataRequestBody { this.verificationCode = verificationCode; return this; } - + public PostUsersSignInDataRequestBody build() { if (rememberMe == null) { rememberMe = _SINGLETON_VALUE_RememberMe.value(); } + return new PostUsersSignInDataRequestBody( - login, - password, - rememberMe, + login, password, rememberMe, verificationCode); } + private static final LazySingletonValue> _SINGLETON_VALUE_RememberMe = new LazySingletonValue<>( "rememberMe", 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 171e7bb6..2ad65bb5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.PostUsersSignInData; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -12,10 +16,10 @@ public class PostUsersSignInDataRequestBuilder { private PostUsersSignInDataRequest request; private Optional serverURL = Optional.empty(); - private final SDKMethodInterfaces.MethodCallPostUsersSignInData sdk; + private final SDKConfiguration sdkConfiguration; - public PostUsersSignInDataRequestBuilder(SDKMethodInterfaces.MethodCallPostUsersSignInData sdk) { - this.sdk = sdk; + public PostUsersSignInDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public PostUsersSignInDataRequestBuilder request(PostUsersSignInDataRequest request) { @@ -37,9 +41,10 @@ public class PostUsersSignInDataRequestBuilder { } public PostUsersSignInDataResponse call() throws Exception { + + RequestOperation operation + = new PostUsersSignInData.Sync(sdkConfiguration, serverURL); - return sdk.postUsersSignInData( - request, - serverURL); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataResponse.java index e50dc55e..11ea9b5c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataResponse.java @@ -13,11 +13,10 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.net.http.HttpResponse; -import java.util.Objects; import java.util.Optional; -public class PostUsersSignInDataResponse implements Response { +public class PostUsersSignInDataResponse implements Response { /** * HTTP response content type for this operation */ @@ -58,7 +57,8 @@ public class PostUsersSignInDataResponse implements Response { String contentType, int statusCode, HttpResponse rawResponse) { - this(contentType, statusCode, rawResponse, Optional.empty()); + this(contentType, statusCode, rawResponse, + Optional.empty()); } /** @@ -94,9 +94,10 @@ public class PostUsersSignInDataResponse implements Response { return (Optional) userPlexAccount; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -134,6 +135,7 @@ public class PostUsersSignInDataResponse implements Response { return this; } + /** * Returns the user account data with a valid auth token */ @@ -143,7 +145,6 @@ public class PostUsersSignInDataResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,18 +155,16 @@ public class PostUsersSignInDataResponse implements Response { } PostUsersSignInDataResponse other = (PostUsersSignInDataResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse) && - Objects.deepEquals(this.userPlexAccount, other.userPlexAccount); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.userPlexAccount, other.userPlexAccount); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse, + return Utils.enhancedHash( + contentType, statusCode, rawResponse, userPlexAccount); } @@ -177,21 +176,23 @@ public class PostUsersSignInDataResponse implements Response { "rawResponse", rawResponse, "userPlexAccount", userPlexAccount); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Optional userPlexAccount = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -201,6 +202,7 @@ public class PostUsersSignInDataResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -210,6 +212,7 @@ public class PostUsersSignInDataResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -219,6 +222,7 @@ public class PostUsersSignInDataResponse implements Response { return this; } + /** * Returns the user account data with a valid auth token */ @@ -236,13 +240,13 @@ public class PostUsersSignInDataResponse implements Response { this.userPlexAccount = userPlexAccount; return this; } - + public PostUsersSignInDataResponse build() { + return new PostUsersSignInDataResponse( - contentType, - statusCode, - rawResponse, + contentType, statusCode, rawResponse, userPlexAccount); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataServices.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataServices.java index 31765a74..c20df565 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataServices.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataServices.java @@ -11,25 +11,29 @@ 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 PostUsersSignInDataServices { @JsonProperty("identifier") private String identifier; + @JsonProperty("endpoint") private String endpoint; + @JsonInclude(Include.ALWAYS) @JsonProperty("token") private Optional token; + @JsonInclude(Include.ALWAYS) @JsonProperty("secret") private Optional secret; + @JsonProperty("status") private PostUsersSignInDataStatus status; @@ -56,7 +60,8 @@ public class PostUsersSignInDataServices { String identifier, String endpoint, PostUsersSignInDataStatus status) { - this(identifier, endpoint, Optional.empty(), Optional.empty(), status); + this(identifier, endpoint, Optional.empty(), + Optional.empty(), status); } @JsonIgnore @@ -84,9 +89,10 @@ public class PostUsersSignInDataServices { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public PostUsersSignInDataServices withIdentifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); @@ -106,6 +112,7 @@ public class PostUsersSignInDataServices { return this; } + public PostUsersSignInDataServices withToken(Optional token) { Utils.checkNotNull(token, "token"); this.token = token; @@ -118,6 +125,7 @@ public class PostUsersSignInDataServices { return this; } + public PostUsersSignInDataServices withSecret(Optional secret) { Utils.checkNotNull(secret, "secret"); this.secret = secret; @@ -130,7 +138,6 @@ public class PostUsersSignInDataServices { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -141,21 +148,18 @@ public class PostUsersSignInDataServices { } PostUsersSignInDataServices other = (PostUsersSignInDataServices) o; return - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.endpoint, other.endpoint) && - Objects.deepEquals(this.token, other.token) && - Objects.deepEquals(this.secret, other.secret) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.endpoint, other.endpoint) && + Utils.enhancedDeepEquals(this.token, other.token) && + Utils.enhancedDeepEquals(this.secret, other.secret) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - identifier, - endpoint, - token, - secret, - status); + return Utils.enhancedHash( + identifier, endpoint, token, + secret, status); } @Override @@ -167,35 +171,39 @@ public class PostUsersSignInDataServices { "secret", secret, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String identifier; - + private String endpoint; - + private Optional token = Optional.empty(); - + private Optional secret = Optional.empty(); - + private PostUsersSignInDataStatus status; - + private Builder() { // force use of static builder() method } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; return this; } + public Builder endpoint(String endpoint) { Utils.checkNotNull(endpoint, "endpoint"); this.endpoint = endpoint; return this; } + public Builder token(String token) { Utils.checkNotNull(token, "token"); this.token = Optional.ofNullable(token); @@ -208,6 +216,7 @@ public class PostUsersSignInDataServices { return this; } + public Builder secret(String secret) { Utils.checkNotNull(secret, "secret"); this.secret = Optional.ofNullable(secret); @@ -220,19 +229,19 @@ public class PostUsersSignInDataServices { return this; } + public Builder status(PostUsersSignInDataStatus status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - + public PostUsersSignInDataServices build() { + return new PostUsersSignInDataServices( - identifier, - endpoint, - token, - secret, - status); + identifier, endpoint, token, + secret, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataSubscription.java b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataSubscription.java index dd236064..12193d35 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataSubscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataSubscription.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,7 +23,6 @@ import org.openapitools.jackson.nullable.JsonNullable; *

If the account’s Plex Pass subscription is active */ public class PostUsersSignInDataSubscription { - /** * List of features allowed on your Plex Pass subscription */ @@ -90,7 +88,8 @@ public class PostUsersSignInDataSubscription { } public PostUsersSignInDataSubscription() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); } /** @@ -143,9 +142,10 @@ public class PostUsersSignInDataSubscription { return plan; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * List of features allowed on your Plex Pass subscription @@ -156,6 +156,7 @@ public class PostUsersSignInDataSubscription { return this; } + /** * List of features allowed on your Plex Pass subscription */ @@ -174,6 +175,7 @@ public class PostUsersSignInDataSubscription { return this; } + /** * If the account's Plex Pass subscription is active */ @@ -210,6 +212,7 @@ public class PostUsersSignInDataSubscription { return this; } + /** * String representation of subscriptionActive */ @@ -255,7 +258,6 @@ public class PostUsersSignInDataSubscription { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -266,23 +268,19 @@ public class PostUsersSignInDataSubscription { } PostUsersSignInDataSubscription other = (PostUsersSignInDataSubscription) o; return - Objects.deepEquals(this.features, other.features) && - Objects.deepEquals(this.active, other.active) && - Objects.deepEquals(this.subscribedAt, other.subscribedAt) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.paymentService, other.paymentService) && - Objects.deepEquals(this.plan, other.plan); + Utils.enhancedDeepEquals(this.features, other.features) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.subscribedAt, other.subscribedAt) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.paymentService, other.paymentService) && + Utils.enhancedDeepEquals(this.plan, other.plan); } @Override public int hashCode() { - return Objects.hash( - features, - active, - subscribedAt, - status, - paymentService, - plan); + return Utils.enhancedHash( + features, active, subscribedAt, + status, paymentService, plan); } @Override @@ -295,25 +293,27 @@ public class PostUsersSignInDataSubscription { "paymentService", paymentService, "plan", plan); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> features = Optional.empty(); - + private Optional active = Optional.empty(); - + private JsonNullable subscribedAt = JsonNullable.undefined(); - + private Optional status = Optional.empty(); - + private JsonNullable paymentService = JsonNullable.undefined(); - + private JsonNullable plan = JsonNullable.undefined(); - + private Builder() { // force use of static builder() method } + /** * List of features allowed on your Plex Pass subscription */ @@ -332,6 +332,7 @@ public class PostUsersSignInDataSubscription { return this; } + /** * If the account's Plex Pass subscription is active */ @@ -350,6 +351,7 @@ public class PostUsersSignInDataSubscription { return this; } + /** * Date the account subscribed to Plex Pass */ @@ -368,6 +370,7 @@ public class PostUsersSignInDataSubscription { return this; } + /** * String representation of subscriptionActive */ @@ -386,6 +389,7 @@ public class PostUsersSignInDataSubscription { return this; } + /** * Payment service used for your Plex Pass subscription */ @@ -404,6 +408,7 @@ public class PostUsersSignInDataSubscription { return this; } + /** * Name of Plex Pass subscription plan */ @@ -421,15 +426,13 @@ public class PostUsersSignInDataSubscription { this.plan = plan; return this; } - + public PostUsersSignInDataSubscription build() { + return new PostUsersSignInDataSubscription( - features, - active, - subscribedAt, - status, - paymentService, - plan); + features, active, subscribedAt, + status, paymentService, plan); } + } } 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 c0237b35..a4e286f1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserPlexAccount.java @@ -19,7 +19,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -29,7 +28,6 @@ import org.openapitools.jackson.nullable.JsonNullable; *

Returns the user account data with a valid auth token */ public class PostUsersSignInDataUserPlexAccount { - /** * Unknown */ @@ -37,10 +35,12 @@ public class PostUsersSignInDataUserPlexAccount { @JsonProperty("adsConsent") private Optional adsConsent; + @JsonInclude(Include.ALWAYS) @JsonProperty("adsConsentReminderAt") private Optional adsConsentReminderAt; + @JsonInclude(Include.ALWAYS) @JsonProperty("adsConsentSetAt") private Optional adsConsentSetAt; @@ -192,6 +192,7 @@ public class PostUsersSignInDataUserPlexAccount { @Deprecated private Optional pin; + @JsonProperty("profile") private PostUsersSignInDataUserProfile profile; @@ -228,6 +229,7 @@ public class PostUsersSignInDataUserPlexAccount { @JsonProperty("scrobbleTypes") private String scrobbleTypes; + @JsonProperty("services") private List services; @@ -244,6 +246,7 @@ public class PostUsersSignInDataUserPlexAccount { @JsonProperty("subscriptionDescription") private Optional subscriptionDescription; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subscriptions") private Optional> subscriptions; @@ -279,13 +282,16 @@ public class PostUsersSignInDataUserPlexAccount { @JsonProperty("uuid") private String uuid; + @JsonInclude(Include.ALWAYS) @JsonProperty("attributionPartner") private Optional attributionPartner; + @JsonProperty("pastSubscriptions") private List pastSubscriptions; + @JsonProperty("trials") private List trials; @@ -444,7 +450,21 @@ public class PostUsersSignInDataUserPlexAccount { String uuid, List pastSubscriptions, List trials) { - this(Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), authToken, Optional.empty(), Optional.empty(), country, email, Optional.empty(), Optional.empty(), friendlyName, entitlements, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), homeSize, id, joinedAt, Optional.empty(), Optional.empty(), mailingListStatus, maxHomeSize, Optional.empty(), profile, Optional.empty(), rememberExpiresAt, Optional.empty(), Optional.empty(), scrobbleTypes, services, subscription, Optional.empty(), Optional.empty(), thumb, title, Optional.empty(), username, uuid, Optional.empty(), pastSubscriptions, trials); + this(Optional.empty(), Optional.empty(), Optional.empty(), + JsonNullable.undefined(), authToken, Optional.empty(), + Optional.empty(), country, email, + Optional.empty(), Optional.empty(), friendlyName, + entitlements, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), homeSize, + id, joinedAt, Optional.empty(), + Optional.empty(), mailingListStatus, maxHomeSize, + Optional.empty(), profile, Optional.empty(), + rememberExpiresAt, Optional.empty(), Optional.empty(), + scrobbleTypes, services, subscription, + Optional.empty(), Optional.empty(), thumb, + title, Optional.empty(), username, + uuid, Optional.empty(), pastSubscriptions, + trials); } /** @@ -772,9 +792,10 @@ public class PostUsersSignInDataUserPlexAccount { return trials; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unknown @@ -785,6 +806,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Unknown */ @@ -800,6 +822,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public PostUsersSignInDataUserPlexAccount withAdsConsentReminderAt(Optional adsConsentReminderAt) { Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt"); this.adsConsentReminderAt = adsConsentReminderAt; @@ -812,6 +835,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public PostUsersSignInDataUserPlexAccount withAdsConsentSetAt(Optional adsConsentSetAt) { Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt"); this.adsConsentSetAt = adsConsentSetAt; @@ -854,6 +878,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the two-factor authentication backup codes have been created */ @@ -872,6 +897,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account has been confirmed */ @@ -908,6 +934,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If login with email only is enabled */ @@ -926,6 +953,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If experimental features are enabled */ @@ -962,6 +990,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account is a Plex Home guest user */ @@ -980,6 +1009,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account has a password */ @@ -998,6 +1028,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account is a Plex Home user */ @@ -1016,6 +1047,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account is the Plex Home admin */ @@ -1061,6 +1093,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The account locale */ @@ -1079,6 +1112,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If you are subscribed to the Plex newsletter */ @@ -1118,6 +1152,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * [Might be removed] The hashed Plex Home PIN * @@ -1145,6 +1180,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account has a Plex Home PIN enabled */ @@ -1172,6 +1208,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account is a Plex Home managed user */ @@ -1190,6 +1227,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * [Might be removed] List of account roles. Plexpass membership listed here */ @@ -1232,6 +1270,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Description of the Plex Pass subscription */ @@ -1247,6 +1286,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public PostUsersSignInDataUserPlexAccount withSubscriptions(Optional> subscriptions) { Utils.checkNotNull(subscriptions, "subscriptions"); this.subscriptions = subscriptions; @@ -1280,6 +1320,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If two-factor authentication is enabled */ @@ -1313,6 +1354,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public PostUsersSignInDataUserPlexAccount withAttributionPartner(Optional attributionPartner) { Utils.checkNotNull(attributionPartner, "attributionPartner"); this.attributionPartner = attributionPartner; @@ -1331,7 +1373,6 @@ public class PostUsersSignInDataUserPlexAccount { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1342,96 +1383,68 @@ public class PostUsersSignInDataUserPlexAccount { } PostUsersSignInDataUserPlexAccount other = (PostUsersSignInDataUserPlexAccount) o; return - Objects.deepEquals(this.adsConsent, other.adsConsent) && - Objects.deepEquals(this.adsConsentReminderAt, other.adsConsentReminderAt) && - Objects.deepEquals(this.adsConsentSetAt, other.adsConsentSetAt) && - Objects.deepEquals(this.anonymous, other.anonymous) && - Objects.deepEquals(this.authToken, other.authToken) && - Objects.deepEquals(this.backupCodesCreated, other.backupCodesCreated) && - Objects.deepEquals(this.confirmed, other.confirmed) && - Objects.deepEquals(this.country, other.country) && - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.emailOnlyAuth, other.emailOnlyAuth) && - Objects.deepEquals(this.experimentalFeatures, other.experimentalFeatures) && - Objects.deepEquals(this.friendlyName, other.friendlyName) && - Objects.deepEquals(this.entitlements, other.entitlements) && - Objects.deepEquals(this.guest, other.guest) && - Objects.deepEquals(this.hasPassword, other.hasPassword) && - Objects.deepEquals(this.home, other.home) && - Objects.deepEquals(this.homeAdmin, other.homeAdmin) && - Objects.deepEquals(this.homeSize, other.homeSize) && - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.joinedAt, other.joinedAt) && - Objects.deepEquals(this.locale, other.locale) && - Objects.deepEquals(this.mailingListActive, other.mailingListActive) && - Objects.deepEquals(this.mailingListStatus, other.mailingListStatus) && - Objects.deepEquals(this.maxHomeSize, other.maxHomeSize) && - Objects.deepEquals(this.pin, other.pin) && - Objects.deepEquals(this.profile, other.profile) && - Objects.deepEquals(this.protected_, other.protected_) && - Objects.deepEquals(this.rememberExpiresAt, other.rememberExpiresAt) && - Objects.deepEquals(this.restricted, other.restricted) && - Objects.deepEquals(this.roles, other.roles) && - Objects.deepEquals(this.scrobbleTypes, other.scrobbleTypes) && - Objects.deepEquals(this.services, other.services) && - Objects.deepEquals(this.subscription, other.subscription) && - Objects.deepEquals(this.subscriptionDescription, other.subscriptionDescription) && - Objects.deepEquals(this.subscriptions, other.subscriptions) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.twoFactorEnabled, other.twoFactorEnabled) && - Objects.deepEquals(this.username, other.username) && - Objects.deepEquals(this.uuid, other.uuid) && - Objects.deepEquals(this.attributionPartner, other.attributionPartner) && - Objects.deepEquals(this.pastSubscriptions, other.pastSubscriptions) && - Objects.deepEquals(this.trials, other.trials); + Utils.enhancedDeepEquals(this.adsConsent, other.adsConsent) && + Utils.enhancedDeepEquals(this.adsConsentReminderAt, other.adsConsentReminderAt) && + Utils.enhancedDeepEquals(this.adsConsentSetAt, other.adsConsentSetAt) && + Utils.enhancedDeepEquals(this.anonymous, other.anonymous) && + Utils.enhancedDeepEquals(this.authToken, other.authToken) && + Utils.enhancedDeepEquals(this.backupCodesCreated, other.backupCodesCreated) && + Utils.enhancedDeepEquals(this.confirmed, other.confirmed) && + Utils.enhancedDeepEquals(this.country, other.country) && + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.emailOnlyAuth, other.emailOnlyAuth) && + Utils.enhancedDeepEquals(this.experimentalFeatures, other.experimentalFeatures) && + Utils.enhancedDeepEquals(this.friendlyName, other.friendlyName) && + Utils.enhancedDeepEquals(this.entitlements, other.entitlements) && + Utils.enhancedDeepEquals(this.guest, other.guest) && + Utils.enhancedDeepEquals(this.hasPassword, other.hasPassword) && + Utils.enhancedDeepEquals(this.home, other.home) && + Utils.enhancedDeepEquals(this.homeAdmin, other.homeAdmin) && + Utils.enhancedDeepEquals(this.homeSize, other.homeSize) && + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.joinedAt, other.joinedAt) && + Utils.enhancedDeepEquals(this.locale, other.locale) && + Utils.enhancedDeepEquals(this.mailingListActive, other.mailingListActive) && + Utils.enhancedDeepEquals(this.mailingListStatus, other.mailingListStatus) && + Utils.enhancedDeepEquals(this.maxHomeSize, other.maxHomeSize) && + Utils.enhancedDeepEquals(this.pin, other.pin) && + Utils.enhancedDeepEquals(this.profile, other.profile) && + Utils.enhancedDeepEquals(this.protected_, other.protected_) && + Utils.enhancedDeepEquals(this.rememberExpiresAt, other.rememberExpiresAt) && + Utils.enhancedDeepEquals(this.restricted, other.restricted) && + Utils.enhancedDeepEquals(this.roles, other.roles) && + Utils.enhancedDeepEquals(this.scrobbleTypes, other.scrobbleTypes) && + Utils.enhancedDeepEquals(this.services, other.services) && + Utils.enhancedDeepEquals(this.subscription, other.subscription) && + Utils.enhancedDeepEquals(this.subscriptionDescription, other.subscriptionDescription) && + Utils.enhancedDeepEquals(this.subscriptions, other.subscriptions) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.twoFactorEnabled, other.twoFactorEnabled) && + Utils.enhancedDeepEquals(this.username, other.username) && + Utils.enhancedDeepEquals(this.uuid, other.uuid) && + Utils.enhancedDeepEquals(this.attributionPartner, other.attributionPartner) && + Utils.enhancedDeepEquals(this.pastSubscriptions, other.pastSubscriptions) && + Utils.enhancedDeepEquals(this.trials, other.trials); } @Override public int hashCode() { - return Objects.hash( - adsConsent, - adsConsentReminderAt, - adsConsentSetAt, - anonymous, - authToken, - backupCodesCreated, - confirmed, - country, - email, - emailOnlyAuth, - experimentalFeatures, - friendlyName, - entitlements, - guest, - hasPassword, - home, - homeAdmin, - homeSize, - id, - joinedAt, - locale, - mailingListActive, - mailingListStatus, - maxHomeSize, - pin, - profile, - protected_, - rememberExpiresAt, - restricted, - roles, - scrobbleTypes, - services, - subscription, - subscriptionDescription, - subscriptions, - thumb, - title, - twoFactorEnabled, - username, - uuid, - attributionPartner, - pastSubscriptions, + return Utils.enhancedHash( + adsConsent, adsConsentReminderAt, adsConsentSetAt, + anonymous, authToken, backupCodesCreated, + confirmed, country, email, + emailOnlyAuth, experimentalFeatures, friendlyName, + entitlements, guest, hasPassword, + home, homeAdmin, homeSize, + id, joinedAt, locale, + mailingListActive, mailingListStatus, maxHomeSize, + pin, profile, protected_, + rememberExpiresAt, restricted, roles, + scrobbleTypes, services, subscription, + subscriptionDescription, subscriptions, thumb, + title, twoFactorEnabled, username, + uuid, attributionPartner, pastSubscriptions, trials); } @@ -1482,100 +1495,102 @@ public class PostUsersSignInDataUserPlexAccount { "pastSubscriptions", pastSubscriptions, "trials", trials); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional adsConsent = Optional.empty(); - + private Optional adsConsentReminderAt = Optional.empty(); - + private Optional adsConsentSetAt = Optional.empty(); - + private JsonNullable anonymous; - + private String authToken; - + private Optional backupCodesCreated; - + private Optional confirmed; - + private String country; - + private String email; - + private Optional emailOnlyAuth; - + private Optional experimentalFeatures; - + private String friendlyName; - + private List entitlements; - + private Optional guest; - + private Optional hasPassword; - + private Optional home; - + private Optional homeAdmin; - + private Integer homeSize; - + private Integer id; - + private Long joinedAt; - + private Optional locale = Optional.empty(); - + private Optional mailingListActive; - + private PostUsersSignInDataMailingListStatus mailingListStatus; - + private Integer maxHomeSize; - + @Deprecated private Optional pin = Optional.empty(); - + private PostUsersSignInDataUserProfile profile; - + private Optional protected_; - + private Long rememberExpiresAt; - + private Optional restricted; - + private Optional> roles = Optional.empty(); - + private String scrobbleTypes; - + private List services; - + private PostUsersSignInDataSubscription subscription; - + private Optional subscriptionDescription = Optional.empty(); - + private Optional> subscriptions = Optional.empty(); - + private String thumb; - + private String title; - + private Optional twoFactorEnabled; - + private String username; - + private String uuid; - + private Optional attributionPartner = Optional.empty(); - + private List pastSubscriptions; - + private List trials; - + private Builder() { // force use of static builder() method } + /** * Unknown */ @@ -1594,6 +1609,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public Builder adsConsentReminderAt(long adsConsentReminderAt) { Utils.checkNotNull(adsConsentReminderAt, "adsConsentReminderAt"); this.adsConsentReminderAt = Optional.ofNullable(adsConsentReminderAt); @@ -1606,6 +1622,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public Builder adsConsentSetAt(long adsConsentSetAt) { Utils.checkNotNull(adsConsentSetAt, "adsConsentSetAt"); this.adsConsentSetAt = Optional.ofNullable(adsConsentSetAt); @@ -1618,6 +1635,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Unknown */ @@ -1636,6 +1654,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The account token */ @@ -1645,6 +1664,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the two-factor authentication backup codes have been created */ @@ -1663,6 +1683,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account has been confirmed */ @@ -1681,6 +1702,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The account country */ @@ -1690,6 +1712,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The account email address */ @@ -1699,6 +1722,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If login with email only is enabled */ @@ -1717,6 +1741,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If experimental features are enabled */ @@ -1735,6 +1760,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Your account full name */ @@ -1744,6 +1770,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * List of devices your allowed to use with this account */ @@ -1753,6 +1780,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account is a Plex Home guest user */ @@ -1771,6 +1799,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account has a password */ @@ -1789,6 +1818,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account is a Plex Home user */ @@ -1807,6 +1837,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account is the Plex Home admin */ @@ -1825,6 +1856,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The number of accounts in the Plex Home */ @@ -1834,6 +1866,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The Plex account ID */ @@ -1843,6 +1876,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Unix epoch datetime in seconds */ @@ -1852,6 +1886,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The account locale */ @@ -1870,6 +1905,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If you are subscribed to the Plex newsletter */ @@ -1888,6 +1924,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Your current mailing list status (active or unsubscribed) */ @@ -1897,6 +1934,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The maximum number of accounts allowed in the Plex Home */ @@ -1906,6 +1944,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * [Might be removed] The hashed Plex Home PIN * @@ -1930,12 +1969,14 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public Builder profile(PostUsersSignInDataUserProfile profile) { Utils.checkNotNull(profile, "profile"); this.profile = profile; return this; } + /** * If the account has a Plex Home PIN enabled */ @@ -1954,6 +1995,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Unix epoch datetime in seconds */ @@ -1963,6 +2005,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If the account is a Plex Home managed user */ @@ -1981,6 +2024,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * [Might be removed] List of account roles. Plexpass membership listed here */ @@ -1999,6 +2043,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Unknown */ @@ -2008,12 +2053,14 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public Builder services(List services) { Utils.checkNotNull(services, "services"); this.services = services; return this; } + /** * If the account’s Plex Pass subscription is active */ @@ -2023,6 +2070,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * Description of the Plex Pass subscription */ @@ -2041,6 +2089,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public Builder subscriptions(List subscriptions) { Utils.checkNotNull(subscriptions, "subscriptions"); this.subscriptions = Optional.ofNullable(subscriptions); @@ -2053,6 +2102,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * URL of the account thumbnail */ @@ -2062,6 +2112,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The title of the account (username or friendly name) */ @@ -2071,6 +2122,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * If two-factor authentication is enabled */ @@ -2089,6 +2141,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The account username */ @@ -2098,6 +2151,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + /** * The account UUID */ @@ -2107,6 +2161,7 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public Builder attributionPartner(String attributionPartner) { Utils.checkNotNull(attributionPartner, "attributionPartner"); this.attributionPartner = Optional.ofNullable(attributionPartner); @@ -2119,18 +2174,20 @@ public class PostUsersSignInDataUserPlexAccount { return this; } + public Builder pastSubscriptions(List pastSubscriptions) { Utils.checkNotNull(pastSubscriptions, "pastSubscriptions"); this.pastSubscriptions = pastSubscriptions; return this; } + public Builder trials(List trials) { Utils.checkNotNull(trials, "trials"); this.trials = trials; return this; } - + public PostUsersSignInDataUserPlexAccount build() { if (anonymous == null) { anonymous = _SINGLETON_VALUE_Anonymous.value(); @@ -2171,52 +2228,26 @@ public class PostUsersSignInDataUserPlexAccount { if (twoFactorEnabled == null) { twoFactorEnabled = _SINGLETON_VALUE_TwoFactorEnabled.value(); } + return new PostUsersSignInDataUserPlexAccount( - adsConsent, - adsConsentReminderAt, - adsConsentSetAt, - anonymous, - authToken, - backupCodesCreated, - confirmed, - country, - email, - emailOnlyAuth, - experimentalFeatures, - friendlyName, - entitlements, - guest, - hasPassword, - home, - homeAdmin, - homeSize, - id, - joinedAt, - locale, - mailingListActive, - mailingListStatus, - maxHomeSize, - pin, - profile, - protected_, - rememberExpiresAt, - restricted, - roles, - scrobbleTypes, - services, - subscription, - subscriptionDescription, - subscriptions, - thumb, - title, - twoFactorEnabled, - username, - uuid, - attributionPartner, - pastSubscriptions, + adsConsent, adsConsentReminderAt, adsConsentSetAt, + anonymous, authToken, backupCodesCreated, + confirmed, country, email, + emailOnlyAuth, experimentalFeatures, friendlyName, + entitlements, guest, hasPassword, + home, homeAdmin, homeSize, + id, joinedAt, locale, + mailingListActive, mailingListStatus, maxHomeSize, + pin, profile, protected_, + rememberExpiresAt, restricted, roles, + scrobbleTypes, services, subscription, + subscriptionDescription, subscriptions, thumb, + title, twoFactorEnabled, username, + uuid, attributionPartner, pastSubscriptions, trials); } + private static final LazySingletonValue> _SINGLETON_VALUE_Anonymous = new LazySingletonValue<>( "anonymous", 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 0767f922..cdfd3fe9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserProfile.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataUserProfile.java @@ -15,11 +15,10 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class PostUsersSignInDataUserProfile { +public class PostUsersSignInDataUserProfile { /** * If the account has automatically select audio and subtitle tracks enabled */ @@ -41,22 +40,27 @@ public class PostUsersSignInDataUserProfile { @JsonProperty("defaultSubtitleLanguage") private Optional defaultSubtitleLanguage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("autoSelectSubtitle") private Optional autoSelectSubtitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleAccessibility") private Optional defaultSubtitleAccessibility; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleForced") private Optional defaultSubtitleForced; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("watchedIndicator") private Optional watchedIndicator; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaReviewsVisibility") private Optional mediaReviewsVisibility; @@ -90,7 +94,9 @@ public class PostUsersSignInDataUserProfile { } public PostUsersSignInDataUserProfile() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } /** @@ -147,9 +153,10 @@ public class PostUsersSignInDataUserProfile { return (Optional) mediaReviewsVisibility; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * If the account has automatically select audio and subtitle tracks enabled @@ -160,6 +167,7 @@ public class PostUsersSignInDataUserProfile { return this; } + /** * If the account has automatically select audio and subtitle tracks enabled */ @@ -178,6 +186,7 @@ public class PostUsersSignInDataUserProfile { return this; } + /** * The preferred audio language for the account */ @@ -196,6 +205,7 @@ public class PostUsersSignInDataUserProfile { return this; } + /** * The preferred subtitle language for the account */ @@ -211,6 +221,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public PostUsersSignInDataUserProfile withAutoSelectSubtitle(Optional autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = autoSelectSubtitle; @@ -223,6 +234,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public PostUsersSignInDataUserProfile withDefaultSubtitleAccessibility(Optional defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = defaultSubtitleAccessibility; @@ -235,6 +247,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public PostUsersSignInDataUserProfile withDefaultSubtitleForced(Optional defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = defaultSubtitleForced; @@ -247,6 +260,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public PostUsersSignInDataUserProfile withWatchedIndicator(Optional watchedIndicator) { Utils.checkNotNull(watchedIndicator, "watchedIndicator"); this.watchedIndicator = watchedIndicator; @@ -259,13 +273,13 @@ public class PostUsersSignInDataUserProfile { return this; } + public PostUsersSignInDataUserProfile withMediaReviewsVisibility(Optional mediaReviewsVisibility) { Utils.checkNotNull(mediaReviewsVisibility, "mediaReviewsVisibility"); this.mediaReviewsVisibility = mediaReviewsVisibility; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -276,27 +290,22 @@ public class PostUsersSignInDataUserProfile { } PostUsersSignInDataUserProfile other = (PostUsersSignInDataUserProfile) o; return - Objects.deepEquals(this.autoSelectAudio, other.autoSelectAudio) && - Objects.deepEquals(this.defaultAudioLanguage, other.defaultAudioLanguage) && - Objects.deepEquals(this.defaultSubtitleLanguage, other.defaultSubtitleLanguage) && - Objects.deepEquals(this.autoSelectSubtitle, other.autoSelectSubtitle) && - Objects.deepEquals(this.defaultSubtitleAccessibility, other.defaultSubtitleAccessibility) && - Objects.deepEquals(this.defaultSubtitleForced, other.defaultSubtitleForced) && - Objects.deepEquals(this.watchedIndicator, other.watchedIndicator) && - Objects.deepEquals(this.mediaReviewsVisibility, other.mediaReviewsVisibility); + Utils.enhancedDeepEquals(this.autoSelectAudio, other.autoSelectAudio) && + Utils.enhancedDeepEquals(this.defaultAudioLanguage, other.defaultAudioLanguage) && + Utils.enhancedDeepEquals(this.defaultSubtitleLanguage, other.defaultSubtitleLanguage) && + Utils.enhancedDeepEquals(this.autoSelectSubtitle, other.autoSelectSubtitle) && + Utils.enhancedDeepEquals(this.defaultSubtitleAccessibility, other.defaultSubtitleAccessibility) && + Utils.enhancedDeepEquals(this.defaultSubtitleForced, other.defaultSubtitleForced) && + Utils.enhancedDeepEquals(this.watchedIndicator, other.watchedIndicator) && + Utils.enhancedDeepEquals(this.mediaReviewsVisibility, other.mediaReviewsVisibility); } @Override public int hashCode() { - return Objects.hash( - autoSelectAudio, - defaultAudioLanguage, - defaultSubtitleLanguage, - autoSelectSubtitle, - defaultSubtitleAccessibility, - defaultSubtitleForced, - watchedIndicator, - mediaReviewsVisibility); + return Utils.enhancedHash( + autoSelectAudio, defaultAudioLanguage, defaultSubtitleLanguage, + autoSelectSubtitle, defaultSubtitleAccessibility, defaultSubtitleForced, + watchedIndicator, mediaReviewsVisibility); } @Override @@ -311,29 +320,31 @@ public class PostUsersSignInDataUserProfile { "watchedIndicator", watchedIndicator, "mediaReviewsVisibility", mediaReviewsVisibility); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional autoSelectAudio; - + private Optional defaultAudioLanguage = Optional.empty(); - + private Optional defaultSubtitleLanguage = Optional.empty(); - + private Optional autoSelectSubtitle; - + private Optional defaultSubtitleAccessibility; - + private Optional defaultSubtitleForced; - + private Optional watchedIndicator; - + private Optional mediaReviewsVisibility; - + private Builder() { // force use of static builder() method } + /** * If the account has automatically select audio and subtitle tracks enabled */ @@ -352,6 +363,7 @@ public class PostUsersSignInDataUserProfile { return this; } + /** * The preferred audio language for the account */ @@ -370,6 +382,7 @@ public class PostUsersSignInDataUserProfile { return this; } + /** * The preferred subtitle language for the account */ @@ -388,6 +401,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public Builder autoSelectSubtitle(PostUsersSignInDataAutoSelectSubtitle autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = Optional.ofNullable(autoSelectSubtitle); @@ -400,6 +414,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public Builder defaultSubtitleAccessibility(PostUsersSignInDataDefaultSubtitleAccessibility defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = Optional.ofNullable(defaultSubtitleAccessibility); @@ -412,6 +427,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public Builder defaultSubtitleForced(PostUsersSignInDataDefaultSubtitleForced defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = Optional.ofNullable(defaultSubtitleForced); @@ -424,6 +440,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public Builder watchedIndicator(PostUsersSignInDataWatchedIndicator watchedIndicator) { Utils.checkNotNull(watchedIndicator, "watchedIndicator"); this.watchedIndicator = Optional.ofNullable(watchedIndicator); @@ -436,6 +453,7 @@ public class PostUsersSignInDataUserProfile { return this; } + public Builder mediaReviewsVisibility(PostUsersSignInDataMediaReviewsVisibility mediaReviewsVisibility) { Utils.checkNotNull(mediaReviewsVisibility, "mediaReviewsVisibility"); this.mediaReviewsVisibility = Optional.ofNullable(mediaReviewsVisibility); @@ -447,7 +465,7 @@ public class PostUsersSignInDataUserProfile { this.mediaReviewsVisibility = mediaReviewsVisibility; return this; } - + public PostUsersSignInDataUserProfile build() { if (autoSelectAudio == null) { autoSelectAudio = _SINGLETON_VALUE_AutoSelectAudio.value(); @@ -467,17 +485,14 @@ public class PostUsersSignInDataUserProfile { if (mediaReviewsVisibility == null) { mediaReviewsVisibility = _SINGLETON_VALUE_MediaReviewsVisibility.value(); } + return new PostUsersSignInDataUserProfile( - autoSelectAudio, - defaultAudioLanguage, - defaultSubtitleLanguage, - autoSelectSubtitle, - defaultSubtitleAccessibility, - defaultSubtitleForced, - watchedIndicator, - mediaReviewsVisibility); + autoSelectAudio, defaultAudioLanguage, defaultSubtitleLanguage, + autoSelectSubtitle, defaultSubtitleAccessibility, defaultSubtitleForced, + watchedIndicator, mediaReviewsVisibility); } + private static final LazySingletonValue> _SINGLETON_VALUE_AutoSelectAudio = new LazySingletonValue<>( "autoSelectAudio", 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 c6c9fff6..a0dd4033 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/PostUsersSignInDataWatchedIndicator.java @@ -19,7 +19,7 @@ public enum PostUsersSignInDataWatchedIndicator { @JsonValue private final int value; - private PostUsersSignInDataWatchedIndicator(int value) { + PostUsersSignInDataWatchedIndicator(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Producer.java b/src/main/java/dev/plexapi/sdk/models/operations/Producer.java index 3e7554cf..94639d63 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Producer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Producer.java @@ -12,11 +12,10 @@ 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 Producer { +public class Producer { /** * Unique identifier for the producer. */ @@ -72,7 +71,8 @@ public class Producer { String filter, String tag, String tagKey) { - this(id, filter, tag, tagKey, Optional.empty()); + this(id, filter, tag, + tagKey, Optional.empty()); } /** @@ -115,9 +115,10 @@ public class Producer { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the producer. @@ -164,6 +165,7 @@ public class Producer { return this; } + /** * The absolute URL of the thumbnail image for the producer. */ @@ -173,7 +175,6 @@ public class Producer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -184,21 +185,18 @@ public class Producer { } Producer other = (Producer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag, - tagKey, - thumb); + return Utils.enhancedHash( + id, filter, tag, + tagKey, thumb); } @Override @@ -210,23 +208,25 @@ public class Producer { "tagKey", tagKey, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String filter; - + private String tag; - + private String tagKey; - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the producer. */ @@ -236,6 +236,7 @@ public class Producer { return this; } + /** * The filter string used to query this producer. */ @@ -245,6 +246,7 @@ public class Producer { return this; } + /** * The name of the producer */ @@ -254,6 +256,7 @@ public class Producer { return this; } + /** * A 24-character hexadecimal unique key associated with the producer's tag, used for internal identification. */ @@ -263,6 +266,7 @@ public class Producer { return this; } + /** * The absolute URL of the thumbnail image for the producer. */ @@ -280,14 +284,13 @@ public class Producer { this.thumb = thumb; return this; } - + public Producer build() { + return new Producer( - id, - filter, - tag, - tagKey, - thumb); + id, filter, tag, + tagKey, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Protected.java b/src/main/java/dev/plexapi/sdk/models/operations/Protected.java index a2c79ad7..fa67680e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Protected.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Protected.java @@ -19,7 +19,7 @@ public enum Protected { @JsonValue private final int value; - private Protected(int value) { + Protected(int value) { this.value = 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 index 0413ab15..ef481641 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Protocol.java @@ -20,7 +20,7 @@ public enum Protocol { @JsonValue private final String value; - private Protocol(String value) { + Protocol(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Provider.java b/src/main/java/dev/plexapi/sdk/models/operations/Provider.java index e3b4e921..6f0c5981 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Provider.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Provider.java @@ -11,19 +11,21 @@ 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 Provider { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") private Optional title; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; @@ -60,9 +62,10 @@ public class Provider { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Provider withKey(String key) { Utils.checkNotNull(key, "key"); @@ -70,6 +73,7 @@ public class Provider { return this; } + public Provider withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -82,6 +86,7 @@ public class Provider { return this; } + public Provider withTitle(Optional title) { Utils.checkNotNull(title, "title"); this.title = title; @@ -94,13 +99,13 @@ public class Provider { return this; } + public Provider withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,17 +116,15 @@ public class Provider { } Provider other = (Provider) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - key, - title, - type); + return Utils.enhancedHash( + key, title, type); } @Override @@ -131,19 +134,21 @@ public class Provider { "title", title, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private Optional title = Optional.empty(); - + private Optional type = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -156,6 +161,7 @@ public class Provider { return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = Optional.ofNullable(title); @@ -168,6 +174,7 @@ public class Provider { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -179,12 +186,12 @@ public class Provider { this.type = type; return this; } - + public Provider build() { + return new Provider( - key, - title, - type); + key, title, type); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamFilter.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamFilter.java index 273aeca2..30df8159 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamFilter.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamFilter.java @@ -7,7 +7,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * QueryParamFilter @@ -16,18 +15,15 @@ import java.util.Objects; * (Unknown if viewedAt is the only supported column) */ public class QueryParamFilter { - @JsonCreator public QueryParamFilter() { - - } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -41,7 +37,7 @@ public class QueryParamFilter { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } @@ -49,16 +45,19 @@ public class QueryParamFilter { public String toString() { return Utils.toString(QueryParamFilter.class); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Builder() { // force use of static builder() method } - + public QueryParamFilter build() { + return new QueryParamFilter( ); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java index 213632ac..7de25ba4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamForce.java @@ -22,7 +22,7 @@ public enum QueryParamForce { @JsonValue private final long value; - private QueryParamForce(long value) { + QueryParamForce(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java index 29376b99..57f9b384 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeCollections.java @@ -17,7 +17,7 @@ public enum QueryParamIncludeCollections { @JsonValue private final int value; - private QueryParamIncludeCollections(int value) { + QueryParamIncludeCollections(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java index 9a0eecd4..9d2f5daa 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeExternalMedia.java @@ -17,7 +17,7 @@ public enum QueryParamIncludeExternalMedia { @JsonValue private final int value; - private QueryParamIncludeExternalMedia(int value) { + QueryParamIncludeExternalMedia(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeGuids.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeGuids.java index a7268810..88275ee5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeGuids.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeGuids.java @@ -19,7 +19,7 @@ public enum QueryParamIncludeGuids { @JsonValue private final int value; - private QueryParamIncludeGuids(int value) { + QueryParamIncludeGuids(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java index 50b9521b..9a08a119 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamIncludeMeta.java @@ -19,7 +19,7 @@ public enum QueryParamIncludeMeta { @JsonValue private final int value; - private QueryParamIncludeMeta(int value) { + QueryParamIncludeMeta(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java index 444e483a..97839b86 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/QueryParamOnlyTransient.java @@ -19,7 +19,7 @@ public enum QueryParamOnlyTransient { @JsonValue private final long value; - private QueryParamOnlyTransient(long value) { + QueryParamOnlyTransient(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Rating.java b/src/main/java/dev/plexapi/sdk/models/operations/Rating.java index f9608a9b..a4fd263d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Rating.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Rating.java @@ -10,7 +10,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Float; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * Rating @@ -18,16 +17,17 @@ import java.util.Objects; *

The type of rating, for example 'audience' or 'critic'. */ public class Rating { - /** * The URL for the rating image, for example from IMDb. */ @JsonProperty("image") private String image; + @JsonProperty("value") private float value; + @JsonProperty("type") private String type; @@ -62,9 +62,10 @@ public class Rating { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The URL for the rating image, for example from IMDb. @@ -87,7 +88,6 @@ public class Rating { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -98,17 +98,15 @@ public class Rating { } Rating other = (Rating) o; return - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - image, - value, - type); + return Utils.enhancedHash( + image, value, type); } @Override @@ -118,19 +116,21 @@ public class Rating { "value", value, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String image; - + private Float value; - + private String type; - + private Builder() { // force use of static builder() method } + /** * The URL for the rating image, for example from IMDb. */ @@ -140,23 +140,25 @@ public class Rating { return this; } + public Builder value(float value) { Utils.checkNotNull(value, "value"); this.value = value; return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = type; return this; } - + public Rating build() { + return new Rating( - image, - value, - type); + image, value, type); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Ratings.java b/src/main/java/dev/plexapi/sdk/models/operations/Ratings.java index a8fecdd9..a05160fc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Ratings.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Ratings.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Float; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class Ratings { - /** * The image or reference for the rating. */ @@ -69,9 +68,10 @@ public class Ratings { return type; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The image or reference for the rating. @@ -100,7 +100,6 @@ public class Ratings { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,17 +110,15 @@ public class Ratings { } Ratings other = (Ratings) o; return - Objects.deepEquals(this.image, other.image) && - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.type, other.type); + Utils.enhancedDeepEquals(this.image, other.image) && + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.type, other.type); } @Override public int hashCode() { - return Objects.hash( - image, - value, - type); + return Utils.enhancedHash( + image, value, type); } @Override @@ -131,19 +128,21 @@ public class Ratings { "value", value, "type", type); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String image; - + private Float value; - + private String type; - + private Builder() { // force use of static builder() method } + /** * The image or reference for the rating. */ @@ -153,6 +152,7 @@ public class Ratings { return this; } + /** * The rating value. */ @@ -162,6 +162,7 @@ public class Ratings { return this; } + /** * The type of rating (e.g., audience, critic). */ @@ -170,12 +171,12 @@ public class Ratings { this.type = type; return this; } - + public Ratings build() { + return new Ratings( - image, - value, - type); + image, value, type); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Release.java b/src/main/java/dev/plexapi/sdk/models/operations/Release.java index 5299da17..02710fe5 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Release.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Release.java @@ -11,31 +11,36 @@ 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 Release { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("version") private Optional version; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("added") private Optional added; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("fixed") private Optional fixed; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("downloadURL") private Optional downloadURL; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("state") private Optional state; @@ -63,7 +68,8 @@ public class Release { } public Release() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -96,9 +102,10 @@ public class Release { return state; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Release withKey(String key) { Utils.checkNotNull(key, "key"); @@ -106,6 +113,7 @@ public class Release { return this; } + public Release withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -118,6 +126,7 @@ public class Release { return this; } + public Release withVersion(Optional version) { Utils.checkNotNull(version, "version"); this.version = version; @@ -130,6 +139,7 @@ public class Release { return this; } + public Release withAdded(Optional added) { Utils.checkNotNull(added, "added"); this.added = added; @@ -142,6 +152,7 @@ public class Release { return this; } + public Release withFixed(Optional fixed) { Utils.checkNotNull(fixed, "fixed"); this.fixed = fixed; @@ -154,6 +165,7 @@ public class Release { return this; } + public Release withDownloadURL(Optional downloadURL) { Utils.checkNotNull(downloadURL, "downloadURL"); this.downloadURL = downloadURL; @@ -166,13 +178,13 @@ public class Release { return this; } + public Release withState(Optional state) { Utils.checkNotNull(state, "state"); this.state = state; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -183,23 +195,19 @@ public class Release { } Release other = (Release) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.added, other.added) && - Objects.deepEquals(this.fixed, other.fixed) && - Objects.deepEquals(this.downloadURL, other.downloadURL) && - Objects.deepEquals(this.state, other.state); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.added, other.added) && + Utils.enhancedDeepEquals(this.fixed, other.fixed) && + Utils.enhancedDeepEquals(this.downloadURL, other.downloadURL) && + Utils.enhancedDeepEquals(this.state, other.state); } @Override public int hashCode() { - return Objects.hash( - key, - version, - added, - fixed, - downloadURL, - state); + return Utils.enhancedHash( + key, version, added, + fixed, downloadURL, state); } @Override @@ -212,25 +220,27 @@ public class Release { "downloadURL", downloadURL, "state", state); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private Optional version = Optional.empty(); - + private Optional added = Optional.empty(); - + private Optional fixed = Optional.empty(); - + private Optional downloadURL = Optional.empty(); - + private Optional state = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -243,6 +253,7 @@ public class Release { return this; } + public Builder version(String version) { Utils.checkNotNull(version, "version"); this.version = Optional.ofNullable(version); @@ -255,6 +266,7 @@ public class Release { return this; } + public Builder added(String added) { Utils.checkNotNull(added, "added"); this.added = Optional.ofNullable(added); @@ -267,6 +279,7 @@ public class Release { return this; } + public Builder fixed(String fixed) { Utils.checkNotNull(fixed, "fixed"); this.fixed = Optional.ofNullable(fixed); @@ -279,6 +292,7 @@ public class Release { return this; } + public Builder downloadURL(String downloadURL) { Utils.checkNotNull(downloadURL, "downloadURL"); this.downloadURL = Optional.ofNullable(downloadURL); @@ -291,6 +305,7 @@ public class Release { return this; } + public Builder state(String state) { Utils.checkNotNull(state, "state"); this.state = Optional.ofNullable(state); @@ -302,15 +317,13 @@ public class Release { this.state = state; return this; } - + public Release build() { + return new Release( - key, - version, - added, - fixed, - downloadURL, - state); + key, version, added, + fixed, downloadURL, state); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/ResponseBody.java b/src/main/java/dev/plexapi/sdk/models/operations/ResponseBody.java index 000c4e56..f1d89757 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/ResponseBody.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/ResponseBody.java @@ -9,22 +9,26 @@ 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 ResponseBody { @JsonProperty("identifier") private String identifier; + @JsonProperty("baseURL") private String baseURL; + @JsonProperty("title") private String title; + @JsonProperty("linkURL") private String linkURL; + @JsonProperty("provides") private String provides; @@ -89,9 +93,10 @@ public class ResponseBody { return token; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public ResponseBody withIdentifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); @@ -132,7 +137,6 @@ public class ResponseBody { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -143,23 +147,19 @@ public class ResponseBody { } ResponseBody other = (ResponseBody) o; return - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.baseURL, other.baseURL) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.linkURL, other.linkURL) && - Objects.deepEquals(this.provides, other.provides) && - Objects.deepEquals(this.token, other.token); + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.baseURL, other.baseURL) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.linkURL, other.linkURL) && + Utils.enhancedDeepEquals(this.provides, other.provides) && + Utils.enhancedDeepEquals(this.token, other.token); } @Override public int hashCode() { - return Objects.hash( - identifier, - baseURL, - title, - linkURL, - provides, - token); + return Utils.enhancedHash( + identifier, baseURL, title, + linkURL, provides, token); } @Override @@ -172,55 +172,62 @@ public class ResponseBody { "provides", provides, "token", token); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String identifier; - + private String baseURL; - + private String title; - + private String linkURL; - + private String provides; - + private String token; - + private Builder() { // force use of static builder() method } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; return this; } + public Builder baseURL(String baseURL) { Utils.checkNotNull(baseURL, "baseURL"); this.baseURL = baseURL; return this; } + public Builder title(String title) { Utils.checkNotNull(title, "title"); this.title = title; return this; } + public Builder linkURL(String linkURL) { Utils.checkNotNull(linkURL, "linkURL"); this.linkURL = linkURL; return this; } + public Builder provides(String provides) { Utils.checkNotNull(provides, "provides"); this.provides = provides; return this; } + /** * The plex authtoken used to identify with */ @@ -229,15 +236,13 @@ public class ResponseBody { this.token = token; return this; } - + public ResponseBody build() { + return new ResponseBody( - identifier, - baseURL, - title, - linkURL, - provides, - token); + identifier, baseURL, title, + linkURL, provides, token); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Restricted.java b/src/main/java/dev/plexapi/sdk/models/operations/Restricted.java index aec1ba42..38a741fd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Restricted.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Restricted.java @@ -19,7 +19,7 @@ public enum Restricted { @JsonValue private final int value; - private Restricted(int value) { + Restricted(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Role.java b/src/main/java/dev/plexapi/sdk/models/operations/Role.java index 09548e22..6e3fd6ad 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Role.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Role.java @@ -12,11 +12,10 @@ 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 Role { +public class Role { /** * The unique identifier for the role. * NOTE: This is different for each Plex server and is not globally unique. @@ -84,7 +83,8 @@ public class Role { String filter, String tag, String tagKey) { - this(id, filter, tag, tagKey, Optional.empty(), Optional.empty()); + this(id, filter, tag, + tagKey, Optional.empty(), Optional.empty()); } /** @@ -137,9 +137,10 @@ public class Role { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The unique identifier for the role. @@ -188,6 +189,7 @@ public class Role { return this; } + /** * The role played by the actor in the media item. */ @@ -206,6 +208,7 @@ public class Role { return this; } + /** * The absolute URL of the thumbnail image for the actor. */ @@ -215,7 +218,6 @@ public class Role { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -226,23 +228,19 @@ public class Role { } Role other = (Role) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.role, other.role) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.role, other.role) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag, - tagKey, - role, - thumb); + return Utils.enhancedHash( + id, filter, tag, + tagKey, role, thumb); } @Override @@ -255,25 +253,27 @@ public class Role { "role", role, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String filter; - + private String tag; - + private String tagKey; - + private Optional role = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The unique identifier for the role. * NOTE: This is different for each Plex server and is not globally unique. @@ -284,6 +284,7 @@ public class Role { return this; } + /** * The filter string used to query this actor. For example, it may indicate that this is an actor with a given key. */ @@ -293,6 +294,7 @@ public class Role { return this; } + /** * The display tag for the actor (typically the actor's name). */ @@ -302,6 +304,7 @@ public class Role { return this; } + /** * A 24-character hexadecimal unique key associated with the actor's tag, used for internal identification. * NOTE: This is globally unique across all Plex Servers. @@ -312,6 +315,7 @@ public class Role { return this; } + /** * The role played by the actor in the media item. */ @@ -330,6 +334,7 @@ public class Role { return this; } + /** * The absolute URL of the thumbnail image for the actor. */ @@ -347,15 +352,13 @@ public class Role { this.thumb = thumb; return this; } - + public Role build() { + return new Role( - id, - filter, - tag, - tagKey, - role, - thumb); + id, filter, tag, + tagKey, role, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java b/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java deleted file mode 100644 index 4c1590e0..00000000 --- a/src/main/java/dev/plexapi/sdk/models/operations/SDKMethodInterfaces.java +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ -package dev.plexapi.sdk.models.operations; - -import java.lang.Double; -import java.lang.Exception; -import java.lang.Long; -import java.lang.String; -import java.util.Optional; - -public class SDKMethodInterfaces { - - public interface MethodCallGetServerCapabilities { - GetServerCapabilitiesResponse getServerCapabilitiesDirect() throws Exception; - } - - public interface MethodCallGetServerPreferences { - GetServerPreferencesResponse getServerPreferencesDirect() throws Exception; - } - - public interface MethodCallGetAvailableClients { - GetAvailableClientsResponse getAvailableClientsDirect() throws Exception; - } - - public interface MethodCallGetDevices { - GetDevicesResponse getDevicesDirect() throws Exception; - } - - public interface MethodCallGetServerIdentity { - GetServerIdentityResponse getServerIdentityDirect() throws Exception; - } - - public interface MethodCallGetMyPlexAccount { - GetMyPlexAccountResponse getMyPlexAccountDirect() throws Exception; - } - - public interface MethodCallGetResizedPhoto { - GetResizedPhotoResponse getResizedPhoto( - GetResizedPhotoRequest request) throws Exception; - } - - public interface MethodCallGetMediaProviders { - GetMediaProvidersResponse getMediaProviders( - String xPlexToken) throws Exception; - } - - public interface MethodCallGetServerList { - GetServerListResponse getServerListDirect() throws Exception; - } - - public interface MethodCallMarkPlayed { - MarkPlayedResponse markPlayed( - double key) throws Exception; - } - - public interface MethodCallMarkUnplayed { - MarkUnplayedResponse markUnplayed( - double key) throws Exception; - } - - public interface MethodCallUpdatePlayProgress { - UpdatePlayProgressResponse updatePlayProgress( - String key, - double time, - String state) throws Exception; - } - - public interface MethodCallGetBannerImage { - GetBannerImageResponse getBannerImage( - GetBannerImageRequest request) throws Exception; - } - - public interface MethodCallGetThumbImage { - GetThumbImageResponse getThumbImage( - GetThumbImageRequest request) throws Exception; - } - - public interface MethodCallGetTimeline { - GetTimelineResponse getTimeline( - GetTimelineRequest request) throws Exception; - } - - public interface MethodCallStartUniversalTranscode { - StartUniversalTranscodeResponse startUniversalTranscode( - StartUniversalTranscodeRequest request) throws Exception; - } - - public interface MethodCallGetServerActivities { - GetServerActivitiesResponse getServerActivitiesDirect() throws Exception; - } - - public interface MethodCallCancelServerActivities { - CancelServerActivitiesResponse cancelServerActivities( - String activityUUID) throws Exception; - } - - public interface MethodCallGetButlerTasks { - GetButlerTasksResponse getButlerTasksDirect() throws Exception; - } - - public interface MethodCallStartAllTasks { - StartAllTasksResponse startAllTasksDirect() throws Exception; - } - - public interface MethodCallStopAllTasks { - StopAllTasksResponse stopAllTasksDirect() throws Exception; - } - - public interface MethodCallStartTask { - StartTaskResponse startTask( - TaskName taskName) throws Exception; - } - - public interface MethodCallStopTask { - StopTaskResponse stopTask( - PathParamTaskName taskName) throws Exception; - } - - public interface MethodCallGetCompanionsData { - GetCompanionsDataResponse getCompanionsData( - Optional serverURL) throws Exception; - } - - public interface MethodCallGetUserFriends { - GetUserFriendsResponse getUserFriends( - Optional serverURL) throws Exception; - } - - public interface MethodCallGetGeoData { - GetGeoDataResponse getGeoData( - Optional serverURL) throws Exception; - } - - public interface MethodCallGetHomeData { - GetHomeDataResponse getHomeDataDirect() throws Exception; - } - - public interface MethodCallGetServerResources { - GetServerResourcesResponse getServerResources( - Optional includeHttps, - Optional includeRelay, - Optional includeIPv6, - String clientID, - Optional serverURL) throws Exception; - } - - public interface MethodCallGetPin { - GetPinResponse getPin( - GetPinRequest request, - Optional serverURL) throws Exception; - } - - public interface MethodCallGetTokenByPinId { - GetTokenByPinIdResponse getTokenByPinId( - GetTokenByPinIdRequest request, - Optional serverURL) throws Exception; - } - - public interface MethodCallGetGlobalHubs { - GetGlobalHubsResponse getGlobalHubs( - Optional count, - Optional onlyTransient) throws Exception; - } - - public interface MethodCallGetRecentlyAdded { - GetRecentlyAddedResponse getRecentlyAdded( - GetRecentlyAddedRequest request) throws Exception; - } - - public interface MethodCallGetLibraryHubs { - GetLibraryHubsResponse getLibraryHubs( - double sectionId, - Optional count, - Optional onlyTransient) throws Exception; - } - - public interface MethodCallPerformSearch { - PerformSearchResponse performSearch( - String query, - Optional sectionId, - Optional limit) throws Exception; - } - - public interface MethodCallPerformVoiceSearch { - PerformVoiceSearchResponse performVoiceSearch( - String query, - Optional sectionId, - Optional limit) throws Exception; - } - - public interface MethodCallGetSearchResults { - GetSearchResultsResponse getSearchResults( - String query) throws Exception; - } - - public interface MethodCallGetFileHash { - GetFileHashResponse getFileHash( - String url, - Optional type) throws Exception; - } - - public interface MethodCallGetRecentlyAddedLibrary { - GetRecentlyAddedLibraryResponse getRecentlyAddedLibrary( - GetRecentlyAddedLibraryRequest request) throws Exception; - } - - public interface MethodCallGetAllLibraries { - GetAllLibrariesResponse getAllLibrariesDirect() throws Exception; - } - - public interface MethodCallGetLibraryDetails { - GetLibraryDetailsResponse getLibraryDetails( - Optional includeDetails, - int sectionKey) throws Exception; - } - - public interface MethodCallDeleteLibrary { - DeleteLibraryResponse deleteLibrary( - int sectionKey) throws Exception; - } - - public interface MethodCallGetLibraryItems { - GetLibraryItemsResponse getLibraryItems( - GetLibraryItemsRequest request) throws Exception; - } - - public interface MethodCallGetLibrarySectionsAll { - GetLibrarySectionsAllResponse getLibrarySectionsAll( - GetLibrarySectionsAllRequest request) throws Exception; - } - - public interface MethodCallGetRefreshLibraryMetadata { - GetRefreshLibraryMetadataResponse getRefreshLibraryMetadata( - Optional force, - int sectionKey) throws Exception; - } - - public interface MethodCallGetSearchLibrary { - GetSearchLibraryResponse getSearchLibrary( - int sectionKey, - GetSearchLibraryQueryParamType type) throws Exception; - } - - public interface MethodCallGetGenresLibrary { - GetGenresLibraryResponse getGenresLibrary( - int sectionKey, - GetGenresLibraryQueryParamType type) throws Exception; - } - - public interface MethodCallGetCountriesLibrary { - GetCountriesLibraryResponse getCountriesLibrary( - int sectionKey, - GetCountriesLibraryQueryParamType type) throws Exception; - } - - public interface MethodCallGetActorsLibrary { - GetActorsLibraryResponse getActorsLibrary( - int sectionKey, - GetActorsLibraryQueryParamType type) throws Exception; - } - - public interface MethodCallGetSearchAllLibraries { - GetSearchAllLibrariesResponse getSearchAllLibraries( - GetSearchAllLibrariesRequest request) throws Exception; - } - - public interface MethodCallGetMediaMetaData { - GetMediaMetaDataResponse getMediaMetaData( - GetMediaMetaDataRequest request) throws Exception; - } - - public interface MethodCallGetMediaArts { - GetMediaArtsResponse getMediaArts( - long ratingKey) throws Exception; - } - - public interface MethodCallPostMediaArts { - PostMediaArtsResponse postMediaArts( - long ratingKey, - Optional url, - Optional requestBody) throws Exception; - } - - public interface MethodCallGetMediaPosters { - GetMediaPostersResponse getMediaPosters( - long ratingKey) throws Exception; - } - - public interface MethodCallPostMediaPoster { - PostMediaPosterResponse postMediaPoster( - long ratingKey, - Optional url, - Optional requestBody) throws Exception; - } - - public interface MethodCallGetMetadataChildren { - GetMetadataChildrenResponse getMetadataChildren( - double ratingKey, - Optional includeElements) throws Exception; - } - - public interface MethodCallGetTopWatchedContent { - GetTopWatchedContentResponse getTopWatchedContent( - GetTopWatchedContentQueryParamType type, - Optional includeGuids) throws Exception; - } - - public interface MethodCallGetWatchList { - GetWatchListResponse getWatchList( - GetWatchListRequest request, - Optional serverURL) throws Exception; - } - - public interface MethodCallLogLine { - LogLineResponse logLine( - Level level, - String message, - String source) throws Exception; - } - - public interface MethodCallLogMultiLine { - LogMultiLineResponse logMultiLine( - String request) throws Exception; - } - - public interface MethodCallEnablePaperTrail { - EnablePaperTrailResponse enablePaperTrailDirect() throws Exception; - } - - public interface MethodCallCreatePlaylist { - CreatePlaylistResponse createPlaylist( - CreatePlaylistRequest request) throws Exception; - } - - public interface MethodCallGetPlaylists { - GetPlaylistsResponse getPlaylists( - Optional playlistType, - Optional smart) throws Exception; - } - - public interface MethodCallGetPlaylist { - GetPlaylistResponse getPlaylist( - double playlistID) throws Exception; - } - - public interface MethodCallDeletePlaylist { - DeletePlaylistResponse deletePlaylist( - double playlistID) throws Exception; - } - - public interface MethodCallUpdatePlaylist { - UpdatePlaylistResponse updatePlaylist( - double playlistID, - Optional title, - Optional summary) throws Exception; - } - - public interface MethodCallGetPlaylistContents { - GetPlaylistContentsResponse getPlaylistContents( - double playlistID, - GetPlaylistContentsQueryParamType type) throws Exception; - } - - public interface MethodCallClearPlaylistContents { - ClearPlaylistContentsResponse clearPlaylistContents( - double playlistID) throws Exception; - } - - public interface MethodCallAddPlaylistContents { - AddPlaylistContentsResponse addPlaylistContents( - double playlistID, - String uri, - Optional playQueueID) throws Exception; - } - - public interface MethodCallUploadPlaylist { - UploadPlaylistResponse uploadPlaylist( - String path, - QueryParamForce force, - long sectionID) throws Exception; - } - - public interface MethodCallGetTransientToken { - GetTransientTokenResponse getTransientToken( - GetTransientTokenQueryParamType type, - Scope scope) throws Exception; - } - - public interface MethodCallGetSourceConnectionInformation { - GetSourceConnectionInformationResponse getSourceConnectionInformation( - String source) throws Exception; - } - - public interface MethodCallGetTokenDetails { - GetTokenDetailsResponse getTokenDetails( - Optional serverURL) throws Exception; - } - - public interface MethodCallPostUsersSignInData { - PostUsersSignInDataResponse postUsersSignInData( - PostUsersSignInDataRequest request, - Optional serverURL) throws Exception; - } - - public interface MethodCallGetStatistics { - GetStatisticsResponse getStatistics( - Optional timespan) throws Exception; - } - - public interface MethodCallGetResourcesStatistics { - GetResourcesStatisticsResponse getResourcesStatistics( - Optional timespan) throws Exception; - } - - public interface MethodCallGetBandwidthStatistics { - GetBandwidthStatisticsResponse getBandwidthStatistics( - Optional timespan) throws Exception; - } - - public interface MethodCallGetSessions { - GetSessionsResponse getSessionsDirect() throws Exception; - } - - public interface MethodCallGetSessionHistory { - GetSessionHistoryResponse getSessionHistory( - Optional sort, - Optional accountId, - Optional filter, - Optional librarySectionID) throws Exception; - } - - public interface MethodCallGetTranscodeSessions { - GetTranscodeSessionsResponse getTranscodeSessionsDirect() throws Exception; - } - - public interface MethodCallStopTranscodeSession { - StopTranscodeSessionResponse stopTranscodeSession( - String sessionKey) throws Exception; - } - - public interface MethodCallGetUpdateStatus { - GetUpdateStatusResponse getUpdateStatusDirect() throws Exception; - } - - public interface MethodCallCheckForUpdates { - CheckForUpdatesResponse checkForUpdates( - Optional download) throws Exception; - } - - public interface MethodCallApplyUpdates { - ApplyUpdatesResponse applyUpdates( - Optional tonight, - Optional skip) throws Exception; - } - - public interface MethodCallGetUsers { - GetUsersResponse getUsers( - GetUsersRequest request, - Optional serverURL) throws Exception; - } -} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Scope.java b/src/main/java/dev/plexapi/sdk/models/operations/Scope.java index f3a98a49..293951aa 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Scope.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Scope.java @@ -19,7 +19,7 @@ public enum Scope { @JsonValue private final String value; - private Scope(String value) { + Scope(String value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java b/src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java index 3773d760..c38ea833 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/SearchResult.java @@ -13,21 +13,22 @@ import java.lang.Float; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class SearchResult { +public class SearchResult { /** * The score of the search result, typically a float value between 0 and 1. */ @JsonProperty("score") private float score; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Directory") private Optional directory; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("Metadata") private Optional metadata; @@ -70,9 +71,10 @@ public class SearchResult { return (Optional) metadata; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The score of the search result, typically a float value between 0 and 1. @@ -89,6 +91,7 @@ public class SearchResult { return this; } + public SearchResult withDirectory(Optional directory) { Utils.checkNotNull(directory, "directory"); this.directory = directory; @@ -101,13 +104,13 @@ public class SearchResult { return this; } + public SearchResult withMetadata(Optional metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = metadata; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -118,17 +121,15 @@ public class SearchResult { } SearchResult other = (SearchResult) o; return - Objects.deepEquals(this.score, other.score) && - Objects.deepEquals(this.directory, other.directory) && - Objects.deepEquals(this.metadata, other.metadata); + Utils.enhancedDeepEquals(this.score, other.score) && + Utils.enhancedDeepEquals(this.directory, other.directory) && + Utils.enhancedDeepEquals(this.metadata, other.metadata); } @Override public int hashCode() { - return Objects.hash( - score, - directory, - metadata); + return Utils.enhancedHash( + score, directory, metadata); } @Override @@ -138,19 +139,21 @@ public class SearchResult { "directory", directory, "metadata", metadata); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Float score; - + private Optional directory = Optional.empty(); - + private Optional metadata = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * The score of the search result, typically a float value between 0 and 1. */ @@ -160,6 +163,7 @@ public class SearchResult { return this; } + public Builder directory(GetSearchAllLibrariesDirectory directory) { Utils.checkNotNull(directory, "directory"); this.directory = Optional.ofNullable(directory); @@ -172,6 +176,7 @@ public class SearchResult { return this; } + public Builder metadata(GetSearchAllLibrariesMetadata metadata) { Utils.checkNotNull(metadata, "metadata"); this.metadata = Optional.ofNullable(metadata); @@ -183,12 +188,12 @@ public class SearchResult { this.metadata = metadata; return this; } - + public SearchResult build() { + return new SearchResult( - score, - directory, - metadata); + score, directory, metadata); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Server.java b/src/main/java/dev/plexapi/sdk/models/operations/Server.java index 87274b31..d74e9420 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Server.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Server.java @@ -12,51 +12,61 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class Server { @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") private Optional name; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("host") private Optional host; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("address") private Optional address; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("port") private Optional port; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("machineIdentifier") private Optional machineIdentifier; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("version") private Optional version; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("protocol") private Optional protocol; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("product") private Optional product; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("deviceClass") private Optional deviceClass; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("protocolVersion") private Optional protocolVersion; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("protocolCapabilities") private Optional protocolCapabilities; @@ -99,7 +109,10 @@ public class Server { } public Server() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } @JsonIgnore @@ -157,9 +170,10 @@ public class Server { return protocolCapabilities; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Server withName(String name) { Utils.checkNotNull(name, "name"); @@ -167,6 +181,7 @@ public class Server { return this; } + public Server withName(Optional name) { Utils.checkNotNull(name, "name"); this.name = name; @@ -179,6 +194,7 @@ public class Server { return this; } + public Server withHost(Optional host) { Utils.checkNotNull(host, "host"); this.host = host; @@ -191,6 +207,7 @@ public class Server { return this; } + public Server withAddress(Optional address) { Utils.checkNotNull(address, "address"); this.address = address; @@ -203,6 +220,7 @@ public class Server { return this; } + public Server withPort(Optional port) { Utils.checkNotNull(port, "port"); this.port = port; @@ -215,6 +233,7 @@ public class Server { return this; } + public Server withMachineIdentifier(Optional machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = machineIdentifier; @@ -227,6 +246,7 @@ public class Server { return this; } + public Server withVersion(Optional version) { Utils.checkNotNull(version, "version"); this.version = version; @@ -239,6 +259,7 @@ public class Server { return this; } + public Server withProtocol(Optional protocol) { Utils.checkNotNull(protocol, "protocol"); this.protocol = protocol; @@ -251,6 +272,7 @@ public class Server { return this; } + public Server withProduct(Optional product) { Utils.checkNotNull(product, "product"); this.product = product; @@ -263,6 +285,7 @@ public class Server { return this; } + public Server withDeviceClass(Optional deviceClass) { Utils.checkNotNull(deviceClass, "deviceClass"); this.deviceClass = deviceClass; @@ -275,6 +298,7 @@ public class Server { return this; } + public Server withProtocolVersion(Optional protocolVersion) { Utils.checkNotNull(protocolVersion, "protocolVersion"); this.protocolVersion = protocolVersion; @@ -287,13 +311,13 @@ public class Server { return this; } + public Server withProtocolCapabilities(Optional protocolCapabilities) { Utils.checkNotNull(protocolCapabilities, "protocolCapabilities"); this.protocolCapabilities = protocolCapabilities; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -304,33 +328,26 @@ public class Server { } Server other = (Server) o; return - Objects.deepEquals(this.name, other.name) && - Objects.deepEquals(this.host, other.host) && - Objects.deepEquals(this.address, other.address) && - Objects.deepEquals(this.port, other.port) && - Objects.deepEquals(this.machineIdentifier, other.machineIdentifier) && - Objects.deepEquals(this.version, other.version) && - Objects.deepEquals(this.protocol, other.protocol) && - Objects.deepEquals(this.product, other.product) && - Objects.deepEquals(this.deviceClass, other.deviceClass) && - Objects.deepEquals(this.protocolVersion, other.protocolVersion) && - Objects.deepEquals(this.protocolCapabilities, other.protocolCapabilities); + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.host, other.host) && + Utils.enhancedDeepEquals(this.address, other.address) && + Utils.enhancedDeepEquals(this.port, other.port) && + Utils.enhancedDeepEquals(this.machineIdentifier, other.machineIdentifier) && + Utils.enhancedDeepEquals(this.version, other.version) && + Utils.enhancedDeepEquals(this.protocol, other.protocol) && + Utils.enhancedDeepEquals(this.product, other.product) && + Utils.enhancedDeepEquals(this.deviceClass, other.deviceClass) && + Utils.enhancedDeepEquals(this.protocolVersion, other.protocolVersion) && + Utils.enhancedDeepEquals(this.protocolCapabilities, other.protocolCapabilities); } @Override public int hashCode() { - return Objects.hash( - name, - host, - address, - port, - machineIdentifier, - version, - protocol, - product, - deviceClass, - protocolVersion, - protocolCapabilities); + return Utils.enhancedHash( + name, host, address, + port, machineIdentifier, version, + protocol, product, deviceClass, + protocolVersion, protocolCapabilities); } @Override @@ -348,35 +365,37 @@ public class Server { "protocolVersion", protocolVersion, "protocolCapabilities", protocolCapabilities); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional name = Optional.empty(); - + private Optional host = Optional.empty(); - + private Optional address = Optional.empty(); - + private Optional port = Optional.empty(); - + private Optional machineIdentifier = Optional.empty(); - + private Optional version = Optional.empty(); - + private Optional protocol = Optional.empty(); - + private Optional product = Optional.empty(); - + private Optional deviceClass = Optional.empty(); - + private Optional protocolVersion = Optional.empty(); - + private Optional protocolCapabilities = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder name(String name) { Utils.checkNotNull(name, "name"); this.name = Optional.ofNullable(name); @@ -389,6 +408,7 @@ public class Server { return this; } + public Builder host(String host) { Utils.checkNotNull(host, "host"); this.host = Optional.ofNullable(host); @@ -401,6 +421,7 @@ public class Server { return this; } + public Builder address(String address) { Utils.checkNotNull(address, "address"); this.address = Optional.ofNullable(address); @@ -413,6 +434,7 @@ public class Server { return this; } + public Builder port(double port) { Utils.checkNotNull(port, "port"); this.port = Optional.ofNullable(port); @@ -425,6 +447,7 @@ public class Server { return this; } + public Builder machineIdentifier(String machineIdentifier) { Utils.checkNotNull(machineIdentifier, "machineIdentifier"); this.machineIdentifier = Optional.ofNullable(machineIdentifier); @@ -437,6 +460,7 @@ public class Server { return this; } + public Builder version(String version) { Utils.checkNotNull(version, "version"); this.version = Optional.ofNullable(version); @@ -449,6 +473,7 @@ public class Server { return this; } + public Builder protocol(String protocol) { Utils.checkNotNull(protocol, "protocol"); this.protocol = Optional.ofNullable(protocol); @@ -461,6 +486,7 @@ public class Server { return this; } + public Builder product(String product) { Utils.checkNotNull(product, "product"); this.product = Optional.ofNullable(product); @@ -473,6 +499,7 @@ public class Server { return this; } + public Builder deviceClass(String deviceClass) { Utils.checkNotNull(deviceClass, "deviceClass"); this.deviceClass = Optional.ofNullable(deviceClass); @@ -485,6 +512,7 @@ public class Server { return this; } + public Builder protocolVersion(double protocolVersion) { Utils.checkNotNull(protocolVersion, "protocolVersion"); this.protocolVersion = Optional.ofNullable(protocolVersion); @@ -497,6 +525,7 @@ public class Server { return this; } + public Builder protocolCapabilities(String protocolCapabilities) { Utils.checkNotNull(protocolCapabilities, "protocolCapabilities"); this.protocolCapabilities = Optional.ofNullable(protocolCapabilities); @@ -508,20 +537,15 @@ public class Server { this.protocolCapabilities = protocolCapabilities; return this; } - + public Server build() { + return new Server( - name, - host, - address, - port, - machineIdentifier, - version, - protocol, - product, - deviceClass, - protocolVersion, - protocolCapabilities); + name, host, address, + port, machineIdentifier, version, + protocol, product, deviceClass, + protocolVersion, protocolCapabilities); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Services.java b/src/main/java/dev/plexapi/sdk/models/operations/Services.java index 424e6129..e3d3818c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Services.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Services.java @@ -11,25 +11,29 @@ 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 Services { @JsonProperty("identifier") private String identifier; + @JsonProperty("endpoint") private String endpoint; + @JsonInclude(Include.ALWAYS) @JsonProperty("token") private Optional token; + @JsonInclude(Include.ALWAYS) @JsonProperty("secret") private Optional secret; + @JsonProperty("status") private GetTokenDetailsStatus status; @@ -56,7 +60,8 @@ public class Services { String identifier, String endpoint, GetTokenDetailsStatus status) { - this(identifier, endpoint, Optional.empty(), Optional.empty(), status); + this(identifier, endpoint, Optional.empty(), + Optional.empty(), status); } @JsonIgnore @@ -84,9 +89,10 @@ public class Services { return status; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Services withIdentifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); @@ -106,6 +112,7 @@ public class Services { return this; } + public Services withToken(Optional token) { Utils.checkNotNull(token, "token"); this.token = token; @@ -118,6 +125,7 @@ public class Services { return this; } + public Services withSecret(Optional secret) { Utils.checkNotNull(secret, "secret"); this.secret = secret; @@ -130,7 +138,6 @@ public class Services { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -141,21 +148,18 @@ public class Services { } Services other = (Services) o; return - Objects.deepEquals(this.identifier, other.identifier) && - Objects.deepEquals(this.endpoint, other.endpoint) && - Objects.deepEquals(this.token, other.token) && - Objects.deepEquals(this.secret, other.secret) && - Objects.deepEquals(this.status, other.status); + Utils.enhancedDeepEquals(this.identifier, other.identifier) && + Utils.enhancedDeepEquals(this.endpoint, other.endpoint) && + Utils.enhancedDeepEquals(this.token, other.token) && + Utils.enhancedDeepEquals(this.secret, other.secret) && + Utils.enhancedDeepEquals(this.status, other.status); } @Override public int hashCode() { - return Objects.hash( - identifier, - endpoint, - token, - secret, - status); + return Utils.enhancedHash( + identifier, endpoint, token, + secret, status); } @Override @@ -167,35 +171,39 @@ public class Services { "secret", secret, "status", status); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String identifier; - + private String endpoint; - + private Optional token = Optional.empty(); - + private Optional secret = Optional.empty(); - + private GetTokenDetailsStatus status; - + private Builder() { // force use of static builder() method } + public Builder identifier(String identifier) { Utils.checkNotNull(identifier, "identifier"); this.identifier = identifier; return this; } + public Builder endpoint(String endpoint) { Utils.checkNotNull(endpoint, "endpoint"); this.endpoint = endpoint; return this; } + public Builder token(String token) { Utils.checkNotNull(token, "token"); this.token = Optional.ofNullable(token); @@ -208,6 +216,7 @@ public class Services { return this; } + public Builder secret(String secret) { Utils.checkNotNull(secret, "secret"); this.secret = Optional.ofNullable(secret); @@ -220,19 +229,19 @@ public class Services { return this; } + public Builder status(GetTokenDetailsStatus status) { Utils.checkNotNull(status, "status"); this.status = status; return this; } - + public Services build() { + return new Services( - identifier, - endpoint, - token, - secret, - status); + identifier, endpoint, token, + secret, status); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Session.java b/src/main/java/dev/plexapi/sdk/models/operations/Session.java index 931dc37e..822f0f2c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Session.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Session.java @@ -12,19 +12,21 @@ 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 Session { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bandwidth") private Optional bandwidth; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("location") private Optional location; @@ -61,9 +63,10 @@ public class Session { return location; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Session withId(String id) { Utils.checkNotNull(id, "id"); @@ -71,6 +74,7 @@ public class Session { return this; } + public Session withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -83,6 +87,7 @@ public class Session { return this; } + public Session withBandwidth(Optional bandwidth) { Utils.checkNotNull(bandwidth, "bandwidth"); this.bandwidth = bandwidth; @@ -95,13 +100,13 @@ public class Session { return this; } + public Session withLocation(Optional location) { Utils.checkNotNull(location, "location"); this.location = location; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,17 +117,15 @@ public class Session { } Session other = (Session) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.bandwidth, other.bandwidth) && - Objects.deepEquals(this.location, other.location); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.bandwidth, other.bandwidth) && + Utils.enhancedDeepEquals(this.location, other.location); } @Override public int hashCode() { - return Objects.hash( - id, - bandwidth, - location); + return Utils.enhancedHash( + id, bandwidth, location); } @Override @@ -132,19 +135,21 @@ public class Session { "bandwidth", bandwidth, "location", location); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional bandwidth = Optional.empty(); - + private Optional location = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -157,6 +162,7 @@ public class Session { return this; } + public Builder bandwidth(int bandwidth) { Utils.checkNotNull(bandwidth, "bandwidth"); this.bandwidth = Optional.ofNullable(bandwidth); @@ -169,6 +175,7 @@ public class Session { return this; } + public Builder location(String location) { Utils.checkNotNull(location, "location"); this.location = Optional.ofNullable(location); @@ -180,12 +187,12 @@ public class Session { this.location = location; return this; } - + public Session build() { + return new Session( - id, - bandwidth, - location); + id, bandwidth, location); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Setting.java b/src/main/java/dev/plexapi/sdk/models/operations/Setting.java index 8615ab15..ab970974 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Setting.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Setting.java @@ -12,47 +12,56 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class Setting { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") private Optional id; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("label") private Optional label; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("summary") private Optional summary; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") private Optional type; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("default") private Optional default_; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") private Optional value; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hidden") private Optional hidden; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("advanced") private Optional advanced; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("group") private Optional group; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("enumValues") private Optional enumValues; @@ -92,7 +101,10 @@ public class Setting { } public Setting() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -145,9 +157,10 @@ public class Setting { return enumValues; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Setting withId(String id) { Utils.checkNotNull(id, "id"); @@ -155,6 +168,7 @@ public class Setting { return this; } + public Setting withId(Optional id) { Utils.checkNotNull(id, "id"); this.id = id; @@ -167,6 +181,7 @@ public class Setting { return this; } + public Setting withLabel(Optional label) { Utils.checkNotNull(label, "label"); this.label = label; @@ -179,6 +194,7 @@ public class Setting { return this; } + public Setting withSummary(Optional summary) { Utils.checkNotNull(summary, "summary"); this.summary = summary; @@ -191,6 +207,7 @@ public class Setting { return this; } + public Setting withType(Optional type) { Utils.checkNotNull(type, "type"); this.type = type; @@ -203,6 +220,7 @@ public class Setting { return this; } + public Setting withDefault(Optional default_) { Utils.checkNotNull(default_, "default_"); this.default_ = default_; @@ -215,6 +233,7 @@ public class Setting { return this; } + public Setting withValue(Optional value) { Utils.checkNotNull(value, "value"); this.value = value; @@ -227,6 +246,7 @@ public class Setting { return this; } + public Setting withHidden(Optional hidden) { Utils.checkNotNull(hidden, "hidden"); this.hidden = hidden; @@ -239,6 +259,7 @@ public class Setting { return this; } + public Setting withAdvanced(Optional advanced) { Utils.checkNotNull(advanced, "advanced"); this.advanced = advanced; @@ -251,6 +272,7 @@ public class Setting { return this; } + public Setting withGroup(Optional group) { Utils.checkNotNull(group, "group"); this.group = group; @@ -263,13 +285,13 @@ public class Setting { return this; } + public Setting withEnumValues(Optional enumValues) { Utils.checkNotNull(enumValues, "enumValues"); this.enumValues = enumValues; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -280,30 +302,24 @@ public class Setting { } Setting other = (Setting) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.label, other.label) && - Objects.deepEquals(this.summary, other.summary) && - Objects.deepEquals(this.type, other.type) && - Objects.deepEquals(this.default_, other.default_) && - Objects.deepEquals(this.value, other.value) && - Objects.deepEquals(this.hidden, other.hidden) && - Objects.deepEquals(this.advanced, other.advanced) && - Objects.deepEquals(this.group, other.group) && - Objects.deepEquals(this.enumValues, other.enumValues); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.label, other.label) && + Utils.enhancedDeepEquals(this.summary, other.summary) && + Utils.enhancedDeepEquals(this.type, other.type) && + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.value, other.value) && + Utils.enhancedDeepEquals(this.hidden, other.hidden) && + Utils.enhancedDeepEquals(this.advanced, other.advanced) && + Utils.enhancedDeepEquals(this.group, other.group) && + Utils.enhancedDeepEquals(this.enumValues, other.enumValues); } @Override public int hashCode() { - return Objects.hash( - id, - label, - summary, - type, - default_, - value, - hidden, - advanced, - group, + return Utils.enhancedHash( + id, label, summary, + type, default_, value, + hidden, advanced, group, enumValues); } @@ -321,33 +337,35 @@ public class Setting { "group", group, "enumValues", enumValues); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional id = Optional.empty(); - + private Optional label = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Optional type = Optional.empty(); - + private Optional default_ = Optional.empty(); - + private Optional value = Optional.empty(); - + private Optional hidden = Optional.empty(); - + private Optional advanced = Optional.empty(); - + private Optional group = Optional.empty(); - + private Optional enumValues = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder id(String id) { Utils.checkNotNull(id, "id"); this.id = Optional.ofNullable(id); @@ -360,6 +378,7 @@ public class Setting { return this; } + public Builder label(String label) { Utils.checkNotNull(label, "label"); this.label = Optional.ofNullable(label); @@ -372,6 +391,7 @@ public class Setting { return this; } + public Builder summary(String summary) { Utils.checkNotNull(summary, "summary"); this.summary = Optional.ofNullable(summary); @@ -384,6 +404,7 @@ public class Setting { return this; } + public Builder type(String type) { Utils.checkNotNull(type, "type"); this.type = Optional.ofNullable(type); @@ -396,6 +417,7 @@ public class Setting { return this; } + public Builder default_(boolean default_) { Utils.checkNotNull(default_, "default_"); this.default_ = Optional.ofNullable(default_); @@ -408,6 +430,7 @@ public class Setting { return this; } + public Builder value(boolean value) { Utils.checkNotNull(value, "value"); this.value = Optional.ofNullable(value); @@ -420,6 +443,7 @@ public class Setting { return this; } + public Builder hidden(boolean hidden) { Utils.checkNotNull(hidden, "hidden"); this.hidden = Optional.ofNullable(hidden); @@ -432,6 +456,7 @@ public class Setting { return this; } + public Builder advanced(boolean advanced) { Utils.checkNotNull(advanced, "advanced"); this.advanced = Optional.ofNullable(advanced); @@ -444,6 +469,7 @@ public class Setting { return this; } + public Builder group(String group) { Utils.checkNotNull(group, "group"); this.group = Optional.ofNullable(group); @@ -456,6 +482,7 @@ public class Setting { return this; } + public Builder enumValues(String enumValues) { Utils.checkNotNull(enumValues, "enumValues"); this.enumValues = Optional.ofNullable(enumValues); @@ -467,19 +494,15 @@ public class Setting { this.enumValues = enumValues; return this; } - + public Setting build() { + return new Setting( - id, - label, - summary, - type, - default_, - value, - hidden, - advanced, - group, + id, label, summary, + type, default_, value, + hidden, advanced, group, enumValues); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SharedServers.java b/src/main/java/dev/plexapi/sdk/models/operations/SharedServers.java index 04666462..442fd0b2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/SharedServers.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/SharedServers.java @@ -7,21 +7,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class SharedServers { - @JsonCreator public SharedServers() { - - } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -35,7 +32,7 @@ public class SharedServers { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } @@ -43,16 +40,19 @@ public class SharedServers { public String toString() { return Utils.toString(SharedServers.class); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Builder() { // force use of static builder() method } - + public SharedServers build() { + return new SharedServers( ); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/SharedSources.java b/src/main/java/dev/plexapi/sdk/models/operations/SharedSources.java index 9fcc0933..b2735add 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/SharedSources.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/SharedSources.java @@ -7,21 +7,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class SharedSources { - @JsonCreator public SharedSources() { - - } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -35,7 +32,7 @@ public class SharedSources { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } @@ -43,16 +40,19 @@ public class SharedSources { public String toString() { return Utils.toString(SharedSources.class); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Builder() { // force use of static builder() method } - + public SharedSources build() { + return new SharedSources( ); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Similar.java b/src/main/java/dev/plexapi/sdk/models/operations/Similar.java index a4844f81..7941a442 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Similar.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Similar.java @@ -10,7 +10,6 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; /** * Similar @@ -22,9 +21,11 @@ public class Similar { @JsonProperty("id") private int id; + @JsonProperty("filter") private String filter; + @JsonProperty("tag") private String tag; @@ -56,9 +57,10 @@ public class Similar { return tag; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Similar withId(int id) { Utils.checkNotNull(id, "id"); @@ -78,7 +80,6 @@ public class Similar { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,17 +90,15 @@ public class Similar { } Similar other = (Similar) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag); + return Utils.enhancedHash( + id, filter, tag); } @Override @@ -109,42 +108,46 @@ public class Similar { "filter", filter, "tag", tag); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String filter; - + private String tag; - + private Builder() { // force use of static builder() method } + public Builder id(int id) { Utils.checkNotNull(id, "id"); this.id = id; return this; } + public Builder filter(String filter) { Utils.checkNotNull(filter, "filter"); this.filter = filter; return this; } + public Builder tag(String tag) { Utils.checkNotNull(tag, "tag"); this.tag = tag; return this; } - + public Similar build() { + return new Similar( - id, - filter, - tag); + id, filter, tag); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Skip.java b/src/main/java/dev/plexapi/sdk/models/operations/Skip.java index 99ace864..9fc6abcb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Skip.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Skip.java @@ -19,7 +19,7 @@ public enum Skip { @JsonValue private final long value; - private Skip(long value) { + Skip(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Smart.java b/src/main/java/dev/plexapi/sdk/models/operations/Smart.java index 129ac1d3..5af8ca07 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Smart.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Smart.java @@ -19,7 +19,7 @@ public enum Smart { @JsonValue private final long value; - private Smart(long value) { + Smart(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Sort.java b/src/main/java/dev/plexapi/sdk/models/operations/Sort.java index bcee1a6e..8f0a184e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Sort.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Sort.java @@ -15,15 +15,16 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; + public class Sort { @JsonInclude(Include.NON_ABSENT) @JsonProperty("default") private Optional default_; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("active") private Optional active; @@ -42,17 +43,21 @@ public class Sort { @JsonProperty("defaultDirection") private Optional 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; @@ -87,7 +92,9 @@ public class Sort { public Sort( String key, String title) { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), key, title); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + key, title); } @JsonIgnore @@ -138,9 +145,10 @@ public class Sort { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Sort withDefault(String default_) { Utils.checkNotNull(default_, "default_"); @@ -148,6 +156,7 @@ public class Sort { return this; } + public Sort withDefault(Optional default_) { Utils.checkNotNull(default_, "default_"); this.default_ = default_; @@ -160,6 +169,7 @@ public class Sort { return this; } + public Sort withActive(Optional active) { Utils.checkNotNull(active, "active"); this.active = active; @@ -175,6 +185,7 @@ public class Sort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -193,6 +204,7 @@ public class Sort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -208,6 +220,7 @@ public class Sort { return this; } + public Sort withDescKey(Optional descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = descKey; @@ -220,6 +233,7 @@ public class Sort { return this; } + public Sort withFirstCharacterKey(Optional firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = firstCharacterKey; @@ -238,7 +252,6 @@ public class Sort { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -249,27 +262,22 @@ public class Sort { } Sort other = (Sort) o; return - Objects.deepEquals(this.default_, other.default_) && - Objects.deepEquals(this.active, other.active) && - Objects.deepEquals(this.activeDirection, other.activeDirection) && - 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); + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.activeDirection, other.activeDirection) && + Utils.enhancedDeepEquals(this.defaultDirection, other.defaultDirection) && + Utils.enhancedDeepEquals(this.descKey, other.descKey) && + Utils.enhancedDeepEquals(this.firstCharacterKey, other.firstCharacterKey) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - default_, - active, - activeDirection, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + return Utils.enhancedHash( + default_, active, activeDirection, + defaultDirection, descKey, firstCharacterKey, + key, title); } @Override @@ -284,29 +292,31 @@ public class Sort { "key", key, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional default_ = Optional.empty(); - + private Optional active = Optional.empty(); - + private Optional activeDirection; - + private Optional 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_); @@ -319,6 +329,7 @@ public class Sort { return this; } + public Builder active(boolean active) { Utils.checkNotNull(active, "active"); this.active = Optional.ofNullable(active); @@ -331,6 +342,7 @@ public class Sort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -349,6 +361,7 @@ public class Sort { return this; } + /** * The direction of the sort. Can be either `asc` or `desc`. */ @@ -367,6 +380,7 @@ public class Sort { return this; } + public Builder descKey(String descKey) { Utils.checkNotNull(descKey, "descKey"); this.descKey = Optional.ofNullable(descKey); @@ -379,6 +393,7 @@ public class Sort { return this; } + public Builder firstCharacterKey(String firstCharacterKey) { Utils.checkNotNull(firstCharacterKey, "firstCharacterKey"); this.firstCharacterKey = Optional.ofNullable(firstCharacterKey); @@ -391,18 +406,20 @@ public class Sort { 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 Sort build() { if (activeDirection == null) { activeDirection = _SINGLETON_VALUE_ActiveDirection.value(); @@ -410,17 +427,14 @@ public class Sort { if (defaultDirection == null) { defaultDirection = _SINGLETON_VALUE_DefaultDirection.value(); } + return new Sort( - default_, - active, - activeDirection, - defaultDirection, - descKey, - firstCharacterKey, - key, - title); + default_, active, activeDirection, + defaultDirection, descKey, firstCharacterKey, + key, title); } + private static final LazySingletonValue> _SINGLETON_VALUE_ActiveDirection = new LazySingletonValue<>( "activeDirection", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksRequestBuilder.java index 1b3dea67..d6b06b6a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.StartAllTasks; import java.lang.Exception; public class StartAllTasksRequestBuilder { - private final SDKMethodInterfaces.MethodCallStartAllTasks sdk; + private final SDKConfiguration sdkConfiguration; - public StartAllTasksRequestBuilder(SDKMethodInterfaces.MethodCallStartAllTasks sdk) { - this.sdk = sdk; + public StartAllTasksRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public StartAllTasksResponse call() throws Exception { + + RequestlessOperation operation + = new StartAllTasks.Sync(sdkConfiguration); - return sdk.startAllTasksDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksResponse.java index f7420799..b16d7792 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartAllTasksResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class StartAllTasksResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class StartAllTasksResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class StartAllTasksResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class StartAllTasksResponse implements Response { } StartAllTasksResponse other = (StartAllTasksResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class StartAllTasksResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class StartAllTasksResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class StartAllTasksResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class StartAllTasksResponse implements Response { this.rawResponse = rawResponse; return this; } - + public StartAllTasksResponse build() { + return new StartAllTasksResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequest.java index d64501a7..01e01def 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class StartTaskRequest { - /** * the name of the task to be started. */ @@ -34,9 +33,10 @@ public class StartTaskRequest { return taskName; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the name of the task to be started. @@ -47,7 +47,6 @@ public class StartTaskRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class StartTaskRequest { } StartTaskRequest other = (StartTaskRequest) o; return - Objects.deepEquals(this.taskName, other.taskName); + Utils.enhancedDeepEquals(this.taskName, other.taskName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( taskName); } @@ -72,15 +71,17 @@ public class StartTaskRequest { return Utils.toString(StartTaskRequest.class, "taskName", taskName); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private TaskName taskName; - + private Builder() { // force use of static builder() method } + /** * the name of the task to be started. */ @@ -89,10 +90,12 @@ public class StartTaskRequest { this.taskName = taskName; return this; } - + public StartTaskRequest build() { + return new StartTaskRequest( taskName); } + } } 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 47bd3be3..64aecbdd 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.StartTask; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class StartTaskRequestBuilder { private TaskName taskName; - private final SDKMethodInterfaces.MethodCallStartTask sdk; + private final SDKConfiguration sdkConfiguration; - public StartTaskRequestBuilder(SDKMethodInterfaces.MethodCallStartTask sdk) { - this.sdk = sdk; + public StartTaskRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public StartTaskRequestBuilder taskName(TaskName taskName) { @@ -21,9 +25,20 @@ public class StartTaskRequestBuilder { return this; } - public StartTaskResponse call() throws Exception { - return sdk.startTask( - taskName); + private StartTaskRequest buildRequest() { + + StartTaskRequest request = new StartTaskRequest(taskName); + + return request; + } + + public StartTaskResponse call() throws Exception { + + RequestOperation operation + = new StartTask.Sync(sdkConfiguration); + StartTaskRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskResponse.java index b37e4663..21ed07b1 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartTaskResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartTaskResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class StartTaskResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class StartTaskResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class StartTaskResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class StartTaskResponse implements Response { } StartTaskResponse other = (StartTaskResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class StartTaskResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class StartTaskResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class StartTaskResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class StartTaskResponse implements Response { this.rawResponse = rawResponse; return this; } - + public StartTaskResponse build() { + return new StartTaskResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequest.java index 4989696f..55469e31 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class StartUniversalTranscodeRequest { +public class StartUniversalTranscodeRequest { /** * Whether the media item has MDE */ @@ -169,7 +168,12 @@ public class StartUniversalTranscodeRequest { double mediaIndex, double partIndex, String protocol) { - this(hasMDE, path, mediaIndex, partIndex, protocol, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(hasMDE, path, mediaIndex, + partIndex, protocol, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } /** @@ -300,9 +304,10 @@ public class StartUniversalTranscodeRequest { return autoAdjustQuality; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Whether the media item has MDE @@ -358,6 +363,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to use fast seek or not */ @@ -376,6 +382,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to use direct play or not */ @@ -394,6 +401,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to use direct stream or not */ @@ -412,6 +420,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The size of the subtitles */ @@ -430,6 +439,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The subtitles */ @@ -448,6 +458,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The audio boost */ @@ -466,6 +477,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The location of the transcode session */ @@ -484,6 +496,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The size of the media buffer */ @@ -502,6 +515,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The session ID */ @@ -520,6 +534,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to add a debug overlay or not */ @@ -538,6 +553,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to auto adjust quality or not */ @@ -547,7 +563,6 @@ public class StartUniversalTranscodeRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -558,42 +573,32 @@ public class StartUniversalTranscodeRequest { } StartUniversalTranscodeRequest other = (StartUniversalTranscodeRequest) o; return - Objects.deepEquals(this.hasMDE, other.hasMDE) && - Objects.deepEquals(this.path, other.path) && - Objects.deepEquals(this.mediaIndex, other.mediaIndex) && - Objects.deepEquals(this.partIndex, other.partIndex) && - Objects.deepEquals(this.protocol, other.protocol) && - Objects.deepEquals(this.fastSeek, other.fastSeek) && - Objects.deepEquals(this.directPlay, other.directPlay) && - Objects.deepEquals(this.directStream, other.directStream) && - Objects.deepEquals(this.subtitleSize, other.subtitleSize) && - Objects.deepEquals(this.subtites, other.subtites) && - Objects.deepEquals(this.audioBoost, other.audioBoost) && - Objects.deepEquals(this.location, other.location) && - Objects.deepEquals(this.mediaBufferSize, other.mediaBufferSize) && - Objects.deepEquals(this.session, other.session) && - Objects.deepEquals(this.addDebugOverlay, other.addDebugOverlay) && - Objects.deepEquals(this.autoAdjustQuality, other.autoAdjustQuality); + Utils.enhancedDeepEquals(this.hasMDE, other.hasMDE) && + Utils.enhancedDeepEquals(this.path, other.path) && + Utils.enhancedDeepEquals(this.mediaIndex, other.mediaIndex) && + Utils.enhancedDeepEquals(this.partIndex, other.partIndex) && + Utils.enhancedDeepEquals(this.protocol, other.protocol) && + Utils.enhancedDeepEquals(this.fastSeek, other.fastSeek) && + Utils.enhancedDeepEquals(this.directPlay, other.directPlay) && + Utils.enhancedDeepEquals(this.directStream, other.directStream) && + Utils.enhancedDeepEquals(this.subtitleSize, other.subtitleSize) && + Utils.enhancedDeepEquals(this.subtites, other.subtites) && + Utils.enhancedDeepEquals(this.audioBoost, other.audioBoost) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.mediaBufferSize, other.mediaBufferSize) && + Utils.enhancedDeepEquals(this.session, other.session) && + Utils.enhancedDeepEquals(this.addDebugOverlay, other.addDebugOverlay) && + Utils.enhancedDeepEquals(this.autoAdjustQuality, other.autoAdjustQuality); } @Override public int hashCode() { - return Objects.hash( - hasMDE, - path, - mediaIndex, - partIndex, - protocol, - fastSeek, - directPlay, - directStream, - subtitleSize, - subtites, - audioBoost, - location, - mediaBufferSize, - session, - addDebugOverlay, + return Utils.enhancedHash( + hasMDE, path, mediaIndex, + partIndex, protocol, fastSeek, + directPlay, directStream, subtitleSize, + subtites, audioBoost, location, + mediaBufferSize, session, addDebugOverlay, autoAdjustQuality); } @@ -617,45 +622,47 @@ public class StartUniversalTranscodeRequest { "addDebugOverlay", addDebugOverlay, "autoAdjustQuality", autoAdjustQuality); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double hasMDE; - + private String path; - + private Double mediaIndex; - + private Double partIndex; - + private String protocol; - + private Optional fastSeek = Optional.empty(); - + private Optional directPlay = Optional.empty(); - + private Optional directStream = Optional.empty(); - + private Optional subtitleSize = Optional.empty(); - + private Optional subtites = Optional.empty(); - + private Optional audioBoost = Optional.empty(); - + private Optional location = Optional.empty(); - + private Optional mediaBufferSize = Optional.empty(); - + private Optional session = Optional.empty(); - + private Optional addDebugOverlay = Optional.empty(); - + private Optional autoAdjustQuality = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Whether the media item has MDE */ @@ -665,6 +672,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The path to the media item to transcode */ @@ -674,6 +682,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The index of the media item to transcode */ @@ -683,6 +692,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The index of the part to transcode */ @@ -692,6 +702,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The protocol to use for the transcode session */ @@ -701,6 +712,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to use fast seek or not */ @@ -719,6 +731,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to use direct play or not */ @@ -737,6 +750,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to use direct stream or not */ @@ -755,6 +769,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The size of the subtitles */ @@ -773,6 +788,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The subtitles */ @@ -791,6 +807,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The audio boost */ @@ -809,6 +826,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The location of the transcode session */ @@ -827,6 +845,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The size of the media buffer */ @@ -845,6 +864,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * The session ID */ @@ -863,6 +883,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to add a debug overlay or not */ @@ -881,6 +902,7 @@ public class StartUniversalTranscodeRequest { return this; } + /** * Whether to auto adjust quality or not */ @@ -898,25 +920,17 @@ public class StartUniversalTranscodeRequest { this.autoAdjustQuality = autoAdjustQuality; return this; } - + public StartUniversalTranscodeRequest build() { + return new StartUniversalTranscodeRequest( - hasMDE, - path, - mediaIndex, - partIndex, - protocol, - fastSeek, - directPlay, - directStream, - subtitleSize, - subtites, - audioBoost, - location, - mediaBufferSize, - session, - addDebugOverlay, + hasMDE, path, mediaIndex, + partIndex, protocol, fastSeek, + directPlay, directStream, subtitleSize, + subtites, audioBoost, location, + mediaBufferSize, session, addDebugOverlay, autoAdjustQuality); } + } } 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 6b045dc3..cc7484ed 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.StartUniversalTranscode; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class StartUniversalTranscodeRequestBuilder { private StartUniversalTranscodeRequest request; - private final SDKMethodInterfaces.MethodCallStartUniversalTranscode sdk; + private final SDKConfiguration sdkConfiguration; - public StartUniversalTranscodeRequestBuilder(SDKMethodInterfaces.MethodCallStartUniversalTranscode sdk) { - this.sdk = sdk; + public StartUniversalTranscodeRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public StartUniversalTranscodeRequestBuilder request(StartUniversalTranscodeRequest request) { @@ -22,8 +26,10 @@ public class StartUniversalTranscodeRequestBuilder { } public StartUniversalTranscodeResponse call() throws Exception { + + RequestOperation operation + = new StartUniversalTranscode.Sync(sdkConfiguration); - return sdk.startUniversalTranscode( - request); + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeResponse.java index 199fd9c8..210555f4 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StartUniversalTranscodeResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class StartUniversalTranscodeResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class StartUniversalTranscodeResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class StartUniversalTranscodeResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class StartUniversalTranscodeResponse implements Response { } StartUniversalTranscodeResponse other = (StartUniversalTranscodeResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class StartUniversalTranscodeResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class StartUniversalTranscodeResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class StartUniversalTranscodeResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class StartUniversalTranscodeResponse implements Response { this.rawResponse = rawResponse; return this; } - + public StartUniversalTranscodeResponse build() { + return new StartUniversalTranscodeResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StatisticsBandwidth.java b/src/main/java/dev/plexapi/sdk/models/operations/StatisticsBandwidth.java index f8292bdc..445de0b8 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StatisticsBandwidth.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StatisticsBandwidth.java @@ -14,31 +14,36 @@ import java.lang.Integer; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class StatisticsBandwidth { @JsonInclude(Include.NON_ABSENT) @JsonProperty("accountID") private Optional accountID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("deviceID") private Optional deviceID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("timespan") private Optional timespan; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("at") private Optional at; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("lan") private Optional lan; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("bytes") private Optional bytes; @@ -66,7 +71,8 @@ public class StatisticsBandwidth { } public StatisticsBandwidth() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -99,9 +105,10 @@ public class StatisticsBandwidth { return bytes; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StatisticsBandwidth withAccountID(int accountID) { Utils.checkNotNull(accountID, "accountID"); @@ -109,6 +116,7 @@ public class StatisticsBandwidth { return this; } + public StatisticsBandwidth withAccountID(Optional accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = accountID; @@ -121,6 +129,7 @@ public class StatisticsBandwidth { return this; } + public StatisticsBandwidth withDeviceID(Optional deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = deviceID; @@ -133,6 +142,7 @@ public class StatisticsBandwidth { return this; } + public StatisticsBandwidth withTimespan(Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; @@ -145,6 +155,7 @@ public class StatisticsBandwidth { return this; } + public StatisticsBandwidth withAt(Optional at) { Utils.checkNotNull(at, "at"); this.at = at; @@ -157,6 +168,7 @@ public class StatisticsBandwidth { return this; } + public StatisticsBandwidth withLan(Optional lan) { Utils.checkNotNull(lan, "lan"); this.lan = lan; @@ -169,13 +181,13 @@ public class StatisticsBandwidth { return this; } + public StatisticsBandwidth withBytes(Optional bytes) { Utils.checkNotNull(bytes, "bytes"); this.bytes = bytes; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -186,23 +198,19 @@ public class StatisticsBandwidth { } StatisticsBandwidth other = (StatisticsBandwidth) o; return - Objects.deepEquals(this.accountID, other.accountID) && - Objects.deepEquals(this.deviceID, other.deviceID) && - Objects.deepEquals(this.timespan, other.timespan) && - Objects.deepEquals(this.at, other.at) && - Objects.deepEquals(this.lan, other.lan) && - Objects.deepEquals(this.bytes, other.bytes); + Utils.enhancedDeepEquals(this.accountID, other.accountID) && + Utils.enhancedDeepEquals(this.deviceID, other.deviceID) && + Utils.enhancedDeepEquals(this.timespan, other.timespan) && + Utils.enhancedDeepEquals(this.at, other.at) && + Utils.enhancedDeepEquals(this.lan, other.lan) && + Utils.enhancedDeepEquals(this.bytes, other.bytes); } @Override public int hashCode() { - return Objects.hash( - accountID, - deviceID, - timespan, - at, - lan, - bytes); + return Utils.enhancedHash( + accountID, deviceID, timespan, + at, lan, bytes); } @Override @@ -215,25 +223,27 @@ public class StatisticsBandwidth { "lan", lan, "bytes", bytes); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional accountID = Optional.empty(); - + private Optional deviceID = Optional.empty(); - + private Optional timespan = Optional.empty(); - + private Optional at = Optional.empty(); - + private Optional lan = Optional.empty(); - + private Optional bytes = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder accountID(int accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = Optional.ofNullable(accountID); @@ -246,6 +256,7 @@ public class StatisticsBandwidth { return this; } + public Builder deviceID(int deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = Optional.ofNullable(deviceID); @@ -258,6 +269,7 @@ public class StatisticsBandwidth { return this; } + public Builder timespan(long timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = Optional.ofNullable(timespan); @@ -270,6 +282,7 @@ public class StatisticsBandwidth { return this; } + public Builder at(int at) { Utils.checkNotNull(at, "at"); this.at = Optional.ofNullable(at); @@ -282,6 +295,7 @@ public class StatisticsBandwidth { return this; } + public Builder lan(boolean lan) { Utils.checkNotNull(lan, "lan"); this.lan = Optional.ofNullable(lan); @@ -294,6 +308,7 @@ public class StatisticsBandwidth { return this; } + public Builder bytes(long bytes) { Utils.checkNotNull(bytes, "bytes"); this.bytes = Optional.ofNullable(bytes); @@ -305,15 +320,13 @@ public class StatisticsBandwidth { this.bytes = bytes; return this; } - + public StatisticsBandwidth build() { + return new StatisticsBandwidth( - accountID, - deviceID, - timespan, - at, - lan, - bytes); + accountID, deviceID, timespan, + at, lan, bytes); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StatisticsMedia.java b/src/main/java/dev/plexapi/sdk/models/operations/StatisticsMedia.java index b1c73d16..7807e891 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StatisticsMedia.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StatisticsMedia.java @@ -12,35 +12,41 @@ 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 StatisticsMedia { @JsonInclude(Include.NON_ABSENT) @JsonProperty("accountID") private Optional accountID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("deviceID") private Optional deviceID; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("timespan") private Optional timespan; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("at") private Optional at; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadataType") private Optional metadataType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("count") private Optional count; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; @@ -71,7 +77,9 @@ public class StatisticsMedia { } public StatisticsMedia() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty()); } @JsonIgnore @@ -109,9 +117,10 @@ public class StatisticsMedia { return duration; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StatisticsMedia withAccountID(int accountID) { Utils.checkNotNull(accountID, "accountID"); @@ -119,6 +128,7 @@ public class StatisticsMedia { return this; } + public StatisticsMedia withAccountID(Optional accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = accountID; @@ -131,6 +141,7 @@ public class StatisticsMedia { return this; } + public StatisticsMedia withDeviceID(Optional deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = deviceID; @@ -143,6 +154,7 @@ public class StatisticsMedia { return this; } + public StatisticsMedia withTimespan(Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; @@ -155,6 +167,7 @@ public class StatisticsMedia { return this; } + public StatisticsMedia withAt(Optional at) { Utils.checkNotNull(at, "at"); this.at = at; @@ -167,6 +180,7 @@ public class StatisticsMedia { return this; } + public StatisticsMedia withMetadataType(Optional metadataType) { Utils.checkNotNull(metadataType, "metadataType"); this.metadataType = metadataType; @@ -179,6 +193,7 @@ public class StatisticsMedia { return this; } + public StatisticsMedia withCount(Optional count) { Utils.checkNotNull(count, "count"); this.count = count; @@ -191,13 +206,13 @@ public class StatisticsMedia { return this; } + public StatisticsMedia withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -208,24 +223,20 @@ public class StatisticsMedia { } StatisticsMedia other = (StatisticsMedia) o; return - Objects.deepEquals(this.accountID, other.accountID) && - Objects.deepEquals(this.deviceID, other.deviceID) && - Objects.deepEquals(this.timespan, other.timespan) && - Objects.deepEquals(this.at, other.at) && - Objects.deepEquals(this.metadataType, other.metadataType) && - Objects.deepEquals(this.count, other.count) && - Objects.deepEquals(this.duration, other.duration); + Utils.enhancedDeepEquals(this.accountID, other.accountID) && + Utils.enhancedDeepEquals(this.deviceID, other.deviceID) && + Utils.enhancedDeepEquals(this.timespan, other.timespan) && + Utils.enhancedDeepEquals(this.at, other.at) && + Utils.enhancedDeepEquals(this.metadataType, other.metadataType) && + Utils.enhancedDeepEquals(this.count, other.count) && + Utils.enhancedDeepEquals(this.duration, other.duration); } @Override public int hashCode() { - return Objects.hash( - accountID, - deviceID, - timespan, - at, - metadataType, - count, + return Utils.enhancedHash( + accountID, deviceID, timespan, + at, metadataType, count, duration); } @@ -240,27 +251,29 @@ public class StatisticsMedia { "count", count, "duration", duration); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional accountID = Optional.empty(); - + private Optional deviceID = Optional.empty(); - + private Optional timespan = Optional.empty(); - + private Optional at = Optional.empty(); - + private Optional metadataType = Optional.empty(); - + private Optional count = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder accountID(int accountID) { Utils.checkNotNull(accountID, "accountID"); this.accountID = Optional.ofNullable(accountID); @@ -273,6 +286,7 @@ public class StatisticsMedia { return this; } + public Builder deviceID(int deviceID) { Utils.checkNotNull(deviceID, "deviceID"); this.deviceID = Optional.ofNullable(deviceID); @@ -285,6 +299,7 @@ public class StatisticsMedia { return this; } + public Builder timespan(int timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = Optional.ofNullable(timespan); @@ -297,6 +312,7 @@ public class StatisticsMedia { return this; } + public Builder at(int at) { Utils.checkNotNull(at, "at"); this.at = Optional.ofNullable(at); @@ -309,6 +325,7 @@ public class StatisticsMedia { return this; } + public Builder metadataType(int metadataType) { Utils.checkNotNull(metadataType, "metadataType"); this.metadataType = Optional.ofNullable(metadataType); @@ -321,6 +338,7 @@ public class StatisticsMedia { return this; } + public Builder count(int count) { Utils.checkNotNull(count, "count"); this.count = Optional.ofNullable(count); @@ -333,6 +351,7 @@ public class StatisticsMedia { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -344,16 +363,14 @@ public class StatisticsMedia { this.duration = duration; return this; } - + public StatisticsMedia build() { + return new StatisticsMedia( - accountID, - deviceID, - timespan, - at, - metadataType, - count, + accountID, deviceID, timespan, + at, metadataType, count, duration); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StatisticsResources.java b/src/main/java/dev/plexapi/sdk/models/operations/StatisticsResources.java index 71a9a178..48205619 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StatisticsResources.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StatisticsResources.java @@ -13,31 +13,36 @@ import java.lang.Float; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class StatisticsResources { @JsonInclude(Include.NON_ABSENT) @JsonProperty("timespan") private Optional timespan; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("at") private Optional at; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hostCpuUtilization") private Optional hostCpuUtilization; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("processCpuUtilization") private Optional processCpuUtilization; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hostMemoryUtilization") private Optional hostMemoryUtilization; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("processMemoryUtilization") private Optional processMemoryUtilization; @@ -65,7 +70,8 @@ public class StatisticsResources { } public StatisticsResources() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty()); } @JsonIgnore @@ -98,9 +104,10 @@ public class StatisticsResources { return processMemoryUtilization; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public StatisticsResources withTimespan(long timespan) { Utils.checkNotNull(timespan, "timespan"); @@ -108,6 +115,7 @@ public class StatisticsResources { return this; } + public StatisticsResources withTimespan(Optional timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = timespan; @@ -120,6 +128,7 @@ public class StatisticsResources { return this; } + public StatisticsResources withAt(Optional at) { Utils.checkNotNull(at, "at"); this.at = at; @@ -132,6 +141,7 @@ public class StatisticsResources { return this; } + public StatisticsResources withHostCpuUtilization(Optional hostCpuUtilization) { Utils.checkNotNull(hostCpuUtilization, "hostCpuUtilization"); this.hostCpuUtilization = hostCpuUtilization; @@ -144,6 +154,7 @@ public class StatisticsResources { return this; } + public StatisticsResources withProcessCpuUtilization(Optional processCpuUtilization) { Utils.checkNotNull(processCpuUtilization, "processCpuUtilization"); this.processCpuUtilization = processCpuUtilization; @@ -156,6 +167,7 @@ public class StatisticsResources { return this; } + public StatisticsResources withHostMemoryUtilization(Optional hostMemoryUtilization) { Utils.checkNotNull(hostMemoryUtilization, "hostMemoryUtilization"); this.hostMemoryUtilization = hostMemoryUtilization; @@ -168,13 +180,13 @@ public class StatisticsResources { return this; } + public StatisticsResources withProcessMemoryUtilization(Optional processMemoryUtilization) { Utils.checkNotNull(processMemoryUtilization, "processMemoryUtilization"); this.processMemoryUtilization = processMemoryUtilization; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -185,23 +197,19 @@ public class StatisticsResources { } StatisticsResources other = (StatisticsResources) o; return - Objects.deepEquals(this.timespan, other.timespan) && - Objects.deepEquals(this.at, other.at) && - Objects.deepEquals(this.hostCpuUtilization, other.hostCpuUtilization) && - Objects.deepEquals(this.processCpuUtilization, other.processCpuUtilization) && - Objects.deepEquals(this.hostMemoryUtilization, other.hostMemoryUtilization) && - Objects.deepEquals(this.processMemoryUtilization, other.processMemoryUtilization); + Utils.enhancedDeepEquals(this.timespan, other.timespan) && + Utils.enhancedDeepEquals(this.at, other.at) && + Utils.enhancedDeepEquals(this.hostCpuUtilization, other.hostCpuUtilization) && + Utils.enhancedDeepEquals(this.processCpuUtilization, other.processCpuUtilization) && + Utils.enhancedDeepEquals(this.hostMemoryUtilization, other.hostMemoryUtilization) && + Utils.enhancedDeepEquals(this.processMemoryUtilization, other.processMemoryUtilization); } @Override public int hashCode() { - return Objects.hash( - timespan, - at, - hostCpuUtilization, - processCpuUtilization, - hostMemoryUtilization, - processMemoryUtilization); + return Utils.enhancedHash( + timespan, at, hostCpuUtilization, + processCpuUtilization, hostMemoryUtilization, processMemoryUtilization); } @Override @@ -214,25 +222,27 @@ public class StatisticsResources { "hostMemoryUtilization", hostMemoryUtilization, "processMemoryUtilization", processMemoryUtilization); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional timespan = Optional.empty(); - + private Optional at = Optional.empty(); - + private Optional hostCpuUtilization = Optional.empty(); - + private Optional processCpuUtilization = Optional.empty(); - + private Optional hostMemoryUtilization = Optional.empty(); - + private Optional processMemoryUtilization = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder timespan(long timespan) { Utils.checkNotNull(timespan, "timespan"); this.timespan = Optional.ofNullable(timespan); @@ -245,6 +255,7 @@ public class StatisticsResources { return this; } + public Builder at(long at) { Utils.checkNotNull(at, "at"); this.at = Optional.ofNullable(at); @@ -257,6 +268,7 @@ public class StatisticsResources { return this; } + public Builder hostCpuUtilization(float hostCpuUtilization) { Utils.checkNotNull(hostCpuUtilization, "hostCpuUtilization"); this.hostCpuUtilization = Optional.ofNullable(hostCpuUtilization); @@ -269,6 +281,7 @@ public class StatisticsResources { return this; } + public Builder processCpuUtilization(float processCpuUtilization) { Utils.checkNotNull(processCpuUtilization, "processCpuUtilization"); this.processCpuUtilization = Optional.ofNullable(processCpuUtilization); @@ -281,6 +294,7 @@ public class StatisticsResources { return this; } + public Builder hostMemoryUtilization(float hostMemoryUtilization) { Utils.checkNotNull(hostMemoryUtilization, "hostMemoryUtilization"); this.hostMemoryUtilization = Optional.ofNullable(hostMemoryUtilization); @@ -293,6 +307,7 @@ public class StatisticsResources { return this; } + public Builder processMemoryUtilization(float processMemoryUtilization) { Utils.checkNotNull(processMemoryUtilization, "processMemoryUtilization"); this.processMemoryUtilization = Optional.ofNullable(processMemoryUtilization); @@ -304,15 +319,13 @@ public class StatisticsResources { this.processMemoryUtilization = processMemoryUtilization; return this; } - + public StatisticsResources build() { + return new StatisticsResources( - timespan, - at, - hostCpuUtilization, - processCpuUtilization, - hostMemoryUtilization, - processMemoryUtilization); + timespan, at, hostCpuUtilization, + processCpuUtilization, hostMemoryUtilization, processMemoryUtilization); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksRequestBuilder.java index 5252d245..8c5dce40 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksRequestBuilder.java @@ -3,18 +3,25 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.StopAllTasks; import java.lang.Exception; public class StopAllTasksRequestBuilder { - private final SDKMethodInterfaces.MethodCallStopAllTasks sdk; + private final SDKConfiguration sdkConfiguration; - public StopAllTasksRequestBuilder(SDKMethodInterfaces.MethodCallStopAllTasks sdk) { - this.sdk = sdk; + public StopAllTasksRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public StopAllTasksResponse call() throws Exception { + + RequestlessOperation operation + = new StopAllTasks.Sync(sdkConfiguration); - return sdk.stopAllTasksDirect(); + return operation.handleResponse(operation.doRequest()); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksResponse.java index 01221406..ca057fdc 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopAllTasksResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class StopAllTasksResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class StopAllTasksResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class StopAllTasksResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class StopAllTasksResponse implements Response { } StopAllTasksResponse other = (StopAllTasksResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class StopAllTasksResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class StopAllTasksResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class StopAllTasksResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class StopAllTasksResponse implements Response { this.rawResponse = rawResponse; return this; } - + public StopAllTasksResponse build() { + return new StopAllTasksResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequest.java index 83f21a8b..696fe9fb 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class StopTaskRequest { - /** * The name of the task to be started. */ @@ -34,9 +33,10 @@ public class StopTaskRequest { return taskName; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * The name of the task to be started. @@ -47,7 +47,6 @@ public class StopTaskRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class StopTaskRequest { } StopTaskRequest other = (StopTaskRequest) o; return - Objects.deepEquals(this.taskName, other.taskName); + Utils.enhancedDeepEquals(this.taskName, other.taskName); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( taskName); } @@ -72,15 +71,17 @@ public class StopTaskRequest { return Utils.toString(StopTaskRequest.class, "taskName", taskName); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private PathParamTaskName taskName; - + private Builder() { // force use of static builder() method } + /** * The name of the task to be started. */ @@ -89,10 +90,12 @@ public class StopTaskRequest { this.taskName = taskName; return this; } - + public StopTaskRequest build() { + return new StopTaskRequest( taskName); } + } } 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 2474c1d7..5114e0d6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskRequestBuilder.java @@ -3,16 +3,20 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.StopTask; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; public class StopTaskRequestBuilder { private PathParamTaskName taskName; - private final SDKMethodInterfaces.MethodCallStopTask sdk; + private final SDKConfiguration sdkConfiguration; - public StopTaskRequestBuilder(SDKMethodInterfaces.MethodCallStopTask sdk) { - this.sdk = sdk; + public StopTaskRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public StopTaskRequestBuilder taskName(PathParamTaskName taskName) { @@ -21,9 +25,20 @@ public class StopTaskRequestBuilder { return this; } - public StopTaskResponse call() throws Exception { - return sdk.stopTask( - taskName); + private StopTaskRequest buildRequest() { + + StopTaskRequest request = new StopTaskRequest(taskName); + + return request; + } + + public StopTaskResponse call() throws Exception { + + RequestOperation operation + = new StopTask.Sync(sdkConfiguration); + StopTaskRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskResponse.java index 7c6d4ee2..16b07e14 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTaskResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTaskResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class StopTaskResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class StopTaskResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class StopTaskResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class StopTaskResponse implements Response { } StopTaskResponse other = (StopTaskResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class StopTaskResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class StopTaskResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class StopTaskResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class StopTaskResponse implements Response { this.rawResponse = rawResponse; return this; } - + public StopTaskResponse build() { + return new StopTaskResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequest.java index 3b29be6d..7174ce92 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequest.java @@ -9,10 +9,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class StopTranscodeSessionRequest { - /** * the Key of the transcode session to stop */ @@ -34,9 +33,10 @@ public class StopTranscodeSessionRequest { return sessionKey; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the Key of the transcode session to stop @@ -47,7 +47,6 @@ public class StopTranscodeSessionRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,12 +57,12 @@ public class StopTranscodeSessionRequest { } StopTranscodeSessionRequest other = (StopTranscodeSessionRequest) o; return - Objects.deepEquals(this.sessionKey, other.sessionKey); + Utils.enhancedDeepEquals(this.sessionKey, other.sessionKey); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( sessionKey); } @@ -72,15 +71,17 @@ public class StopTranscodeSessionRequest { return Utils.toString(StopTranscodeSessionRequest.class, "sessionKey", sessionKey); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String sessionKey; - + private Builder() { // force use of static builder() method } + /** * the Key of the transcode session to stop */ @@ -89,10 +90,12 @@ public class StopTranscodeSessionRequest { this.sessionKey = sessionKey; return this; } - + public StopTranscodeSessionRequest build() { + return new StopTranscodeSessionRequest( sessionKey); } + } } 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 f25271fb..9c2a80f2 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.StopTranscodeSession; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; import java.lang.String; @@ -10,10 +14,10 @@ import java.lang.String; public class StopTranscodeSessionRequestBuilder { private String sessionKey; - private final SDKMethodInterfaces.MethodCallStopTranscodeSession sdk; + private final SDKConfiguration sdkConfiguration; - public StopTranscodeSessionRequestBuilder(SDKMethodInterfaces.MethodCallStopTranscodeSession sdk) { - this.sdk = sdk; + public StopTranscodeSessionRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public StopTranscodeSessionRequestBuilder sessionKey(String sessionKey) { @@ -22,9 +26,20 @@ public class StopTranscodeSessionRequestBuilder { return this; } - public StopTranscodeSessionResponse call() throws Exception { - return sdk.stopTranscodeSession( - sessionKey); + private StopTranscodeSessionRequest buildRequest() { + + StopTranscodeSessionRequest request = new StopTranscodeSessionRequest(sessionKey); + + return request; + } + + public StopTranscodeSessionResponse call() throws Exception { + + RequestOperation operation + = new StopTranscodeSession.Sync(sdkConfiguration); + StopTranscodeSessionRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionResponse.java index c41f8900..3fcc6cab 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/StopTranscodeSessionResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class StopTranscodeSessionResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class StopTranscodeSessionResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class StopTranscodeSessionResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class StopTranscodeSessionResponse implements Response { } StopTranscodeSessionResponse other = (StopTranscodeSessionResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class StopTranscodeSessionResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class StopTranscodeSessionResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class StopTranscodeSessionResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class StopTranscodeSessionResponse implements Response { this.rawResponse = rawResponse; return this; } - + public StopTranscodeSessionResponse build() { + return new StopTranscodeSessionResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Stream.java b/src/main/java/dev/plexapi/sdk/models/operations/Stream.java index 56a5cc2f..a5bc45a9 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Stream.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Stream.java @@ -17,11 +17,10 @@ import java.lang.Integer; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class Stream { +public class Stream { /** * Unique stream identifier. */ @@ -190,6 +189,7 @@ public class Stream { @JsonProperty("codedWidth") private Optional codedWidth; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("closedCaptions") private Optional closedCaptions; @@ -257,6 +257,7 @@ public class Stream { @JsonProperty("original") private Optional original; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("hasScalingMatrix") private Optional hasScalingMatrix; @@ -268,10 +269,12 @@ public class Stream { @JsonProperty("profile") private Optional profile; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("scanType") private Optional scanType; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("embeddedInVideo") private Optional embeddedInVideo; @@ -309,6 +312,7 @@ public class Stream { @JsonProperty("selected") private Optional selected; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("forced") private Optional forced; @@ -522,7 +526,23 @@ public class Stream { String codec, String displayTitle, String extendedDisplayTitle) { - this(id, Optional.empty(), Optional.empty(), codec, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), displayTitle, extendedDisplayTitle, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(id, Optional.empty(), Optional.empty(), + codec, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + displayTitle, extendedDisplayTitle, Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } /** @@ -921,9 +941,10 @@ public class Stream { return title; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique stream identifier. @@ -943,6 +964,7 @@ public class Stream { return this; } + /** * Format of the stream (e.g., srt). */ @@ -961,6 +983,7 @@ public class Stream { return this; } + /** * Indicates if this stream is default. */ @@ -988,6 +1011,7 @@ public class Stream { return this; } + /** * Index of the stream. */ @@ -1006,6 +1030,7 @@ public class Stream { return this; } + /** * Bitrate of the stream. */ @@ -1024,6 +1049,7 @@ public class Stream { return this; } + /** * Language of the stream. */ @@ -1042,6 +1068,7 @@ public class Stream { return this; } + /** * Language tag (e.g., en). */ @@ -1060,6 +1087,7 @@ public class Stream { return this; } + /** * ISO language code. */ @@ -1078,6 +1106,7 @@ public class Stream { return this; } + /** * Indicates whether header compression is enabled. */ @@ -1096,6 +1125,7 @@ public class Stream { return this; } + /** * Dolby Vision BL compatibility ID. */ @@ -1114,6 +1144,7 @@ public class Stream { return this; } + /** * Indicates if Dolby Vision BL is present. */ @@ -1132,6 +1163,7 @@ public class Stream { return this; } + /** * Indicates if Dolby Vision EL is present. */ @@ -1150,6 +1182,7 @@ public class Stream { return this; } + /** * Dolby Vision level. */ @@ -1168,6 +1201,7 @@ public class Stream { return this; } + /** * Indicates if Dolby Vision is present. */ @@ -1186,6 +1220,7 @@ public class Stream { return this; } + /** * Dolby Vision profile. */ @@ -1204,6 +1239,7 @@ public class Stream { return this; } + /** * Indicates if Dolby Vision RPU is present. */ @@ -1222,6 +1258,7 @@ public class Stream { return this; } + /** * Dolby Vision version. */ @@ -1240,6 +1277,7 @@ public class Stream { return this; } + /** * Bit depth of the video stream. */ @@ -1258,6 +1296,7 @@ public class Stream { return this; } + /** * Chroma sample location. */ @@ -1276,6 +1315,7 @@ public class Stream { return this; } + /** * Chroma subsampling format. */ @@ -1294,6 +1334,7 @@ public class Stream { return this; } + /** * Coded video height. */ @@ -1312,6 +1353,7 @@ public class Stream { return this; } + /** * Coded video width. */ @@ -1327,6 +1369,7 @@ public class Stream { return this; } + public Stream withClosedCaptions(Optional closedCaptions) { Utils.checkNotNull(closedCaptions, "closedCaptions"); this.closedCaptions = closedCaptions; @@ -1342,6 +1385,7 @@ public class Stream { return this; } + /** * Color primaries used. */ @@ -1360,6 +1404,7 @@ public class Stream { return this; } + /** * Color range (e.g., tv). */ @@ -1378,6 +1423,7 @@ public class Stream { return this; } + /** * Color space. */ @@ -1396,6 +1442,7 @@ public class Stream { return this; } + /** * Color transfer characteristics. */ @@ -1414,6 +1461,7 @@ public class Stream { return this; } + /** * Frame rate of the stream. */ @@ -1432,6 +1480,7 @@ public class Stream { return this; } + /** * Key to access this stream part. */ @@ -1450,6 +1499,7 @@ public class Stream { return this; } + /** * Height of the video stream. */ @@ -1468,6 +1518,7 @@ public class Stream { return this; } + /** * Video level. */ @@ -1486,6 +1537,7 @@ public class Stream { return this; } + /** * Indicates if this is the original stream. */ @@ -1501,6 +1553,7 @@ public class Stream { return this; } + public Stream withHasScalingMatrix(Optional hasScalingMatrix) { Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); this.hasScalingMatrix = hasScalingMatrix; @@ -1516,6 +1569,7 @@ public class Stream { return this; } + /** * Video profile. */ @@ -1531,6 +1585,7 @@ public class Stream { return this; } + public Stream withScanType(Optional scanType) { Utils.checkNotNull(scanType, "scanType"); this.scanType = scanType; @@ -1543,6 +1598,7 @@ public class Stream { return this; } + public Stream withEmbeddedInVideo(Optional embeddedInVideo) { Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); this.embeddedInVideo = embeddedInVideo; @@ -1558,6 +1614,7 @@ public class Stream { return this; } + /** * Number of reference frames. */ @@ -1576,6 +1633,7 @@ public class Stream { return this; } + /** * Width of the video stream. */ @@ -1612,6 +1670,7 @@ public class Stream { return this; } + /** * Indicates if this stream is selected (applicable for audio streams). */ @@ -1627,6 +1686,7 @@ public class Stream { return this; } + public Stream withForced(Optional forced) { Utils.checkNotNull(forced, "forced"); this.forced = forced; @@ -1642,6 +1702,7 @@ public class Stream { return this; } + /** * Number of audio channels (for audio streams). */ @@ -1660,6 +1721,7 @@ public class Stream { return this; } + /** * Audio channel layout. */ @@ -1678,6 +1740,7 @@ public class Stream { return this; } + /** * Sampling rate for the audio stream. */ @@ -1696,6 +1759,7 @@ public class Stream { return this; } + /** * Indicates if the stream can auto-sync. */ @@ -1714,6 +1778,7 @@ public class Stream { return this; } + /** * Indicates if the stream is for the hearing impaired. */ @@ -1732,6 +1797,7 @@ public class Stream { return this; } + /** * Indicates if the stream is a dub. */ @@ -1750,6 +1816,7 @@ public class Stream { return this; } + /** * Optional title for the stream (e.g., language variant). */ @@ -1759,7 +1826,6 @@ public class Stream { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1770,113 +1836,79 @@ public class Stream { } Stream other = (Stream) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.streamType, other.streamType) && - Objects.deepEquals(this.format, other.format) && - Objects.deepEquals(this.default_, other.default_) && - Objects.deepEquals(this.codec, other.codec) && - Objects.deepEquals(this.index, other.index) && - Objects.deepEquals(this.bitrate, other.bitrate) && - Objects.deepEquals(this.language, other.language) && - Objects.deepEquals(this.languageTag, other.languageTag) && - Objects.deepEquals(this.languageCode, other.languageCode) && - Objects.deepEquals(this.headerCompression, other.headerCompression) && - Objects.deepEquals(this.doviblCompatID, other.doviblCompatID) && - Objects.deepEquals(this.doviblPresent, other.doviblPresent) && - Objects.deepEquals(this.dovielPresent, other.dovielPresent) && - Objects.deepEquals(this.doviLevel, other.doviLevel) && - Objects.deepEquals(this.doviPresent, other.doviPresent) && - Objects.deepEquals(this.doviProfile, other.doviProfile) && - Objects.deepEquals(this.dovirpuPresent, other.dovirpuPresent) && - Objects.deepEquals(this.doviVersion, other.doviVersion) && - Objects.deepEquals(this.bitDepth, other.bitDepth) && - Objects.deepEquals(this.chromaLocation, other.chromaLocation) && - Objects.deepEquals(this.chromaSubsampling, other.chromaSubsampling) && - Objects.deepEquals(this.codedHeight, other.codedHeight) && - Objects.deepEquals(this.codedWidth, other.codedWidth) && - Objects.deepEquals(this.closedCaptions, other.closedCaptions) && - Objects.deepEquals(this.colorPrimaries, other.colorPrimaries) && - Objects.deepEquals(this.colorRange, other.colorRange) && - Objects.deepEquals(this.colorSpace, other.colorSpace) && - Objects.deepEquals(this.colorTrc, other.colorTrc) && - Objects.deepEquals(this.frameRate, other.frameRate) && - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.height, other.height) && - Objects.deepEquals(this.level, other.level) && - Objects.deepEquals(this.original, other.original) && - Objects.deepEquals(this.hasScalingMatrix, other.hasScalingMatrix) && - Objects.deepEquals(this.profile, other.profile) && - Objects.deepEquals(this.scanType, other.scanType) && - Objects.deepEquals(this.embeddedInVideo, other.embeddedInVideo) && - Objects.deepEquals(this.refFrames, other.refFrames) && - Objects.deepEquals(this.width, other.width) && - Objects.deepEquals(this.displayTitle, other.displayTitle) && - Objects.deepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && - Objects.deepEquals(this.selected, other.selected) && - Objects.deepEquals(this.forced, other.forced) && - Objects.deepEquals(this.channels, other.channels) && - Objects.deepEquals(this.audioChannelLayout, other.audioChannelLayout) && - Objects.deepEquals(this.samplingRate, other.samplingRate) && - Objects.deepEquals(this.canAutoSync, other.canAutoSync) && - Objects.deepEquals(this.hearingImpaired, other.hearingImpaired) && - Objects.deepEquals(this.dub, other.dub) && - Objects.deepEquals(this.title, other.title); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.streamType, other.streamType) && + Utils.enhancedDeepEquals(this.format, other.format) && + Utils.enhancedDeepEquals(this.default_, other.default_) && + Utils.enhancedDeepEquals(this.codec, other.codec) && + Utils.enhancedDeepEquals(this.index, other.index) && + Utils.enhancedDeepEquals(this.bitrate, other.bitrate) && + Utils.enhancedDeepEquals(this.language, other.language) && + Utils.enhancedDeepEquals(this.languageTag, other.languageTag) && + Utils.enhancedDeepEquals(this.languageCode, other.languageCode) && + Utils.enhancedDeepEquals(this.headerCompression, other.headerCompression) && + Utils.enhancedDeepEquals(this.doviblCompatID, other.doviblCompatID) && + Utils.enhancedDeepEquals(this.doviblPresent, other.doviblPresent) && + Utils.enhancedDeepEquals(this.dovielPresent, other.dovielPresent) && + Utils.enhancedDeepEquals(this.doviLevel, other.doviLevel) && + Utils.enhancedDeepEquals(this.doviPresent, other.doviPresent) && + Utils.enhancedDeepEquals(this.doviProfile, other.doviProfile) && + Utils.enhancedDeepEquals(this.dovirpuPresent, other.dovirpuPresent) && + Utils.enhancedDeepEquals(this.doviVersion, other.doviVersion) && + Utils.enhancedDeepEquals(this.bitDepth, other.bitDepth) && + Utils.enhancedDeepEquals(this.chromaLocation, other.chromaLocation) && + Utils.enhancedDeepEquals(this.chromaSubsampling, other.chromaSubsampling) && + Utils.enhancedDeepEquals(this.codedHeight, other.codedHeight) && + Utils.enhancedDeepEquals(this.codedWidth, other.codedWidth) && + Utils.enhancedDeepEquals(this.closedCaptions, other.closedCaptions) && + Utils.enhancedDeepEquals(this.colorPrimaries, other.colorPrimaries) && + Utils.enhancedDeepEquals(this.colorRange, other.colorRange) && + Utils.enhancedDeepEquals(this.colorSpace, other.colorSpace) && + Utils.enhancedDeepEquals(this.colorTrc, other.colorTrc) && + Utils.enhancedDeepEquals(this.frameRate, other.frameRate) && + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.height, other.height) && + Utils.enhancedDeepEquals(this.level, other.level) && + Utils.enhancedDeepEquals(this.original, other.original) && + Utils.enhancedDeepEquals(this.hasScalingMatrix, other.hasScalingMatrix) && + Utils.enhancedDeepEquals(this.profile, other.profile) && + Utils.enhancedDeepEquals(this.scanType, other.scanType) && + Utils.enhancedDeepEquals(this.embeddedInVideo, other.embeddedInVideo) && + Utils.enhancedDeepEquals(this.refFrames, other.refFrames) && + Utils.enhancedDeepEquals(this.width, other.width) && + Utils.enhancedDeepEquals(this.displayTitle, other.displayTitle) && + Utils.enhancedDeepEquals(this.extendedDisplayTitle, other.extendedDisplayTitle) && + Utils.enhancedDeepEquals(this.selected, other.selected) && + Utils.enhancedDeepEquals(this.forced, other.forced) && + Utils.enhancedDeepEquals(this.channels, other.channels) && + Utils.enhancedDeepEquals(this.audioChannelLayout, other.audioChannelLayout) && + Utils.enhancedDeepEquals(this.samplingRate, other.samplingRate) && + Utils.enhancedDeepEquals(this.canAutoSync, other.canAutoSync) && + Utils.enhancedDeepEquals(this.hearingImpaired, other.hearingImpaired) && + Utils.enhancedDeepEquals(this.dub, other.dub) && + Utils.enhancedDeepEquals(this.title, other.title); } @Override public int hashCode() { - return Objects.hash( - id, - streamType, - format, - default_, - codec, - index, - bitrate, - language, - languageTag, - languageCode, - headerCompression, - doviblCompatID, - doviblPresent, - dovielPresent, - doviLevel, - doviPresent, - doviProfile, - dovirpuPresent, - doviVersion, - bitDepth, - chromaLocation, - chromaSubsampling, - codedHeight, - codedWidth, - closedCaptions, - colorPrimaries, - colorRange, - colorSpace, - colorTrc, - frameRate, - key, - height, - level, - original, - hasScalingMatrix, - profile, - scanType, - embeddedInVideo, - refFrames, - width, - displayTitle, - extendedDisplayTitle, - selected, - forced, - channels, - audioChannelLayout, - samplingRate, - canAutoSync, - hearingImpaired, - dub, - title); + return Utils.enhancedHash( + id, streamType, format, + default_, codec, index, + bitrate, language, languageTag, + languageCode, headerCompression, doviblCompatID, + doviblPresent, dovielPresent, doviLevel, + doviPresent, doviProfile, dovirpuPresent, + doviVersion, bitDepth, chromaLocation, + chromaSubsampling, codedHeight, codedWidth, + closedCaptions, colorPrimaries, colorRange, + colorSpace, colorTrc, frameRate, + key, height, level, + original, hasScalingMatrix, profile, + scanType, embeddedInVideo, refFrames, + width, displayTitle, extendedDisplayTitle, + selected, forced, channels, + audioChannelLayout, samplingRate, canAutoSync, + hearingImpaired, dub, title); } @Override @@ -1934,113 +1966,115 @@ public class Stream { "dub", dub, "title", title); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private Optional format = Optional.empty(); - + private Optional default_ = Optional.empty(); - + private String codec; - + private Optional index = Optional.empty(); - + private Optional bitrate = Optional.empty(); - + private Optional language = Optional.empty(); - + private Optional languageTag = Optional.empty(); - + private Optional languageCode = Optional.empty(); - + private Optional headerCompression = Optional.empty(); - + private Optional doviblCompatID = Optional.empty(); - + private Optional doviblPresent = Optional.empty(); - + private Optional dovielPresent = Optional.empty(); - + private Optional doviLevel = Optional.empty(); - + private Optional doviPresent = Optional.empty(); - + private Optional doviProfile = Optional.empty(); - + private Optional dovirpuPresent = Optional.empty(); - + private Optional doviVersion = Optional.empty(); - + private Optional bitDepth = Optional.empty(); - + private Optional chromaLocation = Optional.empty(); - + private Optional chromaSubsampling = Optional.empty(); - + private Optional codedHeight = Optional.empty(); - + private Optional codedWidth = Optional.empty(); - + private Optional closedCaptions = Optional.empty(); - + private Optional colorPrimaries = Optional.empty(); - + private Optional colorRange = Optional.empty(); - + private Optional colorSpace = Optional.empty(); - + private Optional colorTrc = Optional.empty(); - + private Optional frameRate = Optional.empty(); - + private Optional key = Optional.empty(); - + private Optional height = Optional.empty(); - + private Optional level = Optional.empty(); - + private Optional original = Optional.empty(); - + private Optional hasScalingMatrix = Optional.empty(); - + private Optional profile = Optional.empty(); - + private Optional scanType = Optional.empty(); - + private Optional embeddedInVideo = Optional.empty(); - + private Optional refFrames = Optional.empty(); - + private Optional width = Optional.empty(); - + private String displayTitle; - + private String extendedDisplayTitle; - + private Optional selected = Optional.empty(); - + private Optional forced = Optional.empty(); - + private Optional channels = Optional.empty(); - + private Optional audioChannelLayout = Optional.empty(); - + private Optional samplingRate = Optional.empty(); - + private Optional canAutoSync = Optional.empty(); - + private Optional hearingImpaired = Optional.empty(); - + private Optional dub = Optional.empty(); - + private Optional title = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique stream identifier. */ @@ -2050,6 +2084,7 @@ public class Stream { return this; } + /** * Format of the stream (e.g., srt). */ @@ -2068,6 +2103,7 @@ public class Stream { return this; } + /** * Indicates if this stream is default. */ @@ -2086,6 +2122,7 @@ public class Stream { return this; } + /** * Codec used by the stream. */ @@ -2095,6 +2132,7 @@ public class Stream { return this; } + /** * Index of the stream. */ @@ -2113,6 +2151,7 @@ public class Stream { return this; } + /** * Bitrate of the stream. */ @@ -2131,6 +2170,7 @@ public class Stream { return this; } + /** * Language of the stream. */ @@ -2149,6 +2189,7 @@ public class Stream { return this; } + /** * Language tag (e.g., en). */ @@ -2167,6 +2208,7 @@ public class Stream { return this; } + /** * ISO language code. */ @@ -2185,6 +2227,7 @@ public class Stream { return this; } + /** * Indicates whether header compression is enabled. */ @@ -2203,6 +2246,7 @@ public class Stream { return this; } + /** * Dolby Vision BL compatibility ID. */ @@ -2221,6 +2265,7 @@ public class Stream { return this; } + /** * Indicates if Dolby Vision BL is present. */ @@ -2239,6 +2284,7 @@ public class Stream { return this; } + /** * Indicates if Dolby Vision EL is present. */ @@ -2257,6 +2303,7 @@ public class Stream { return this; } + /** * Dolby Vision level. */ @@ -2275,6 +2322,7 @@ public class Stream { return this; } + /** * Indicates if Dolby Vision is present. */ @@ -2293,6 +2341,7 @@ public class Stream { return this; } + /** * Dolby Vision profile. */ @@ -2311,6 +2360,7 @@ public class Stream { return this; } + /** * Indicates if Dolby Vision RPU is present. */ @@ -2329,6 +2379,7 @@ public class Stream { return this; } + /** * Dolby Vision version. */ @@ -2347,6 +2398,7 @@ public class Stream { return this; } + /** * Bit depth of the video stream. */ @@ -2365,6 +2417,7 @@ public class Stream { return this; } + /** * Chroma sample location. */ @@ -2383,6 +2436,7 @@ public class Stream { return this; } + /** * Chroma subsampling format. */ @@ -2401,6 +2455,7 @@ public class Stream { return this; } + /** * Coded video height. */ @@ -2419,6 +2474,7 @@ public class Stream { return this; } + /** * Coded video width. */ @@ -2437,6 +2493,7 @@ public class Stream { return this; } + public Builder closedCaptions(boolean closedCaptions) { Utils.checkNotNull(closedCaptions, "closedCaptions"); this.closedCaptions = Optional.ofNullable(closedCaptions); @@ -2449,6 +2506,7 @@ public class Stream { return this; } + /** * Color primaries used. */ @@ -2467,6 +2525,7 @@ public class Stream { return this; } + /** * Color range (e.g., tv). */ @@ -2485,6 +2544,7 @@ public class Stream { return this; } + /** * Color space. */ @@ -2503,6 +2563,7 @@ public class Stream { return this; } + /** * Color transfer characteristics. */ @@ -2521,6 +2582,7 @@ public class Stream { return this; } + /** * Frame rate of the stream. */ @@ -2539,6 +2601,7 @@ public class Stream { return this; } + /** * Key to access this stream part. */ @@ -2557,6 +2620,7 @@ public class Stream { return this; } + /** * Height of the video stream. */ @@ -2575,6 +2639,7 @@ public class Stream { return this; } + /** * Video level. */ @@ -2593,6 +2658,7 @@ public class Stream { return this; } + /** * Indicates if this is the original stream. */ @@ -2611,6 +2677,7 @@ public class Stream { return this; } + public Builder hasScalingMatrix(boolean hasScalingMatrix) { Utils.checkNotNull(hasScalingMatrix, "hasScalingMatrix"); this.hasScalingMatrix = Optional.ofNullable(hasScalingMatrix); @@ -2623,6 +2690,7 @@ public class Stream { return this; } + /** * Video profile. */ @@ -2641,6 +2709,7 @@ public class Stream { return this; } + public Builder scanType(String scanType) { Utils.checkNotNull(scanType, "scanType"); this.scanType = Optional.ofNullable(scanType); @@ -2653,6 +2722,7 @@ public class Stream { return this; } + public Builder embeddedInVideo(String embeddedInVideo) { Utils.checkNotNull(embeddedInVideo, "embeddedInVideo"); this.embeddedInVideo = Optional.ofNullable(embeddedInVideo); @@ -2665,6 +2735,7 @@ public class Stream { return this; } + /** * Number of reference frames. */ @@ -2683,6 +2754,7 @@ public class Stream { return this; } + /** * Width of the video stream. */ @@ -2701,6 +2773,7 @@ public class Stream { return this; } + /** * Display title for the stream. */ @@ -2710,6 +2783,7 @@ public class Stream { return this; } + /** * Extended display title for the stream. */ @@ -2719,6 +2793,7 @@ public class Stream { return this; } + /** * Indicates if this stream is selected (applicable for audio streams). */ @@ -2737,6 +2812,7 @@ public class Stream { return this; } + public Builder forced(boolean forced) { Utils.checkNotNull(forced, "forced"); this.forced = Optional.ofNullable(forced); @@ -2749,6 +2825,7 @@ public class Stream { return this; } + /** * Number of audio channels (for audio streams). */ @@ -2767,6 +2844,7 @@ public class Stream { return this; } + /** * Audio channel layout. */ @@ -2785,6 +2863,7 @@ public class Stream { return this; } + /** * Sampling rate for the audio stream. */ @@ -2803,6 +2882,7 @@ public class Stream { return this; } + /** * Indicates if the stream can auto-sync. */ @@ -2821,6 +2901,7 @@ public class Stream { return this; } + /** * Indicates if the stream is for the hearing impaired. */ @@ -2839,6 +2920,7 @@ public class Stream { return this; } + /** * Indicates if the stream is a dub. */ @@ -2857,6 +2939,7 @@ public class Stream { return this; } + /** * Optional title for the stream (e.g., language variant). */ @@ -2874,61 +2957,30 @@ public class Stream { this.title = title; return this; } - + public Stream build() { + return new Stream( - id, - format, - default_, - codec, - index, - bitrate, - language, - languageTag, - languageCode, - headerCompression, - doviblCompatID, - doviblPresent, - dovielPresent, - doviLevel, - doviPresent, - doviProfile, - dovirpuPresent, - doviVersion, - bitDepth, - chromaLocation, - chromaSubsampling, - codedHeight, - codedWidth, - closedCaptions, - colorPrimaries, - colorRange, - colorSpace, - colorTrc, - frameRate, - key, - height, - level, - original, - hasScalingMatrix, - profile, - scanType, - embeddedInVideo, - refFrames, - width, - displayTitle, - extendedDisplayTitle, - selected, - forced, - channels, - audioChannelLayout, - samplingRate, - canAutoSync, - hearingImpaired, - dub, - title); + id, format, default_, + codec, index, bitrate, + language, languageTag, languageCode, + headerCompression, doviblCompatID, doviblPresent, + dovielPresent, doviLevel, doviPresent, + doviProfile, dovirpuPresent, doviVersion, + bitDepth, chromaLocation, chromaSubsampling, + codedHeight, codedWidth, closedCaptions, + colorPrimaries, colorRange, colorSpace, + colorTrc, frameRate, key, + height, level, original, + hasScalingMatrix, profile, scanType, + embeddedInVideo, refFrames, width, + displayTitle, extendedDisplayTitle, selected, + forced, channels, audioChannelLayout, + samplingRate, canAutoSync, hearingImpaired, + dub, title); } + private static final LazySingletonValue _SINGLETON_VALUE_StreamType = new LazySingletonValue<>( "streamType", diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Subscription.java b/src/main/java/dev/plexapi/sdk/models/operations/Subscription.java index fc4441e0..559d9c36 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Subscription.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Subscription.java @@ -14,7 +14,6 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,7 +23,6 @@ import org.openapitools.jackson.nullable.JsonNullable; *

If the account’s Plex Pass subscription is active */ public class Subscription { - /** * List of features allowed on your Plex Pass subscription */ @@ -90,7 +88,8 @@ public class Subscription { } public Subscription() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); } /** @@ -143,9 +142,10 @@ public class Subscription { return plan; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * List of features allowed on your Plex Pass subscription @@ -156,6 +156,7 @@ public class Subscription { return this; } + /** * List of features allowed on your Plex Pass subscription */ @@ -174,6 +175,7 @@ public class Subscription { return this; } + /** * If the account's Plex Pass subscription is active */ @@ -210,6 +212,7 @@ public class Subscription { return this; } + /** * String representation of subscriptionActive */ @@ -255,7 +258,6 @@ public class Subscription { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -266,23 +268,19 @@ public class Subscription { } Subscription other = (Subscription) o; return - Objects.deepEquals(this.features, other.features) && - Objects.deepEquals(this.active, other.active) && - Objects.deepEquals(this.subscribedAt, other.subscribedAt) && - Objects.deepEquals(this.status, other.status) && - Objects.deepEquals(this.paymentService, other.paymentService) && - Objects.deepEquals(this.plan, other.plan); + Utils.enhancedDeepEquals(this.features, other.features) && + Utils.enhancedDeepEquals(this.active, other.active) && + Utils.enhancedDeepEquals(this.subscribedAt, other.subscribedAt) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.paymentService, other.paymentService) && + Utils.enhancedDeepEquals(this.plan, other.plan); } @Override public int hashCode() { - return Objects.hash( - features, - active, - subscribedAt, - status, - paymentService, - plan); + return Utils.enhancedHash( + features, active, subscribedAt, + status, paymentService, plan); } @Override @@ -295,25 +293,27 @@ public class Subscription { "paymentService", paymentService, "plan", plan); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional> features = Optional.empty(); - + private Optional active = Optional.empty(); - + private JsonNullable subscribedAt = JsonNullable.undefined(); - + private Optional status = Optional.empty(); - + private JsonNullable paymentService = JsonNullable.undefined(); - + private JsonNullable plan = JsonNullable.undefined(); - + private Builder() { // force use of static builder() method } + /** * List of features allowed on your Plex Pass subscription */ @@ -332,6 +332,7 @@ public class Subscription { return this; } + /** * If the account's Plex Pass subscription is active */ @@ -350,6 +351,7 @@ public class Subscription { return this; } + /** * Date the account subscribed to Plex Pass */ @@ -368,6 +370,7 @@ public class Subscription { return this; } + /** * String representation of subscriptionActive */ @@ -386,6 +389,7 @@ public class Subscription { return this; } + /** * Payment service used for your Plex Pass subscription */ @@ -404,6 +408,7 @@ public class Subscription { return this; } + /** * Name of Plex Pass subscription plan */ @@ -421,15 +426,13 @@ public class Subscription { this.plan = plan; return this; } - + public Subscription build() { + return new Subscription( - features, - active, - subscribedAt, - status, - paymentService, - plan); + features, active, subscribedAt, + status, paymentService, plan); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Tonight.java b/src/main/java/dev/plexapi/sdk/models/operations/Tonight.java index 4d96d662..988dbbf6 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Tonight.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Tonight.java @@ -19,7 +19,7 @@ public enum Tonight { @JsonValue private final long value; - private Tonight(long value) { + Tonight(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/TranscodeSession.java b/src/main/java/dev/plexapi/sdk/models/operations/TranscodeSession.java index ef4d1698..ce4eb770 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/TranscodeSession.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/TranscodeSession.java @@ -14,103 +14,126 @@ import java.lang.Double; import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class TranscodeSession { @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") private Optional key; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("throttled") private Optional throttled; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("complete") private Optional complete; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("progress") private Optional progress; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("size") private Optional size; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("speed") private Optional speed; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("error") private Optional error; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("duration") private Optional duration; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("remaining") private Optional remaining; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("context") private Optional context; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("sourceVideoCodec") private Optional sourceVideoCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("sourceAudioCodec") private Optional sourceAudioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoDecision") private Optional videoDecision; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioDecision") private Optional audioDecision; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("subtitleDecision") private Optional subtitleDecision; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("protocol") private Optional protocol; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("container") private Optional container; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("videoCodec") private Optional videoCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioCodec") private Optional audioCodec; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("audioChannels") private Optional audioChannels; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("transcodeHwRequested") private Optional transcodeHwRequested; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("timeStamp") private Optional timeStamp; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("maxOffsetAvailable") private Optional maxOffsetAvailable; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("minOffsetAvailable") private Optional minOffsetAvailable; @@ -192,7 +215,14 @@ public class TranscodeSession { } public TranscodeSession() { - 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()); + 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()); } @JsonIgnore @@ -315,9 +345,10 @@ public class TranscodeSession { return minOffsetAvailable; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public TranscodeSession withKey(String key) { Utils.checkNotNull(key, "key"); @@ -325,6 +356,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withKey(Optional key) { Utils.checkNotNull(key, "key"); this.key = key; @@ -337,6 +369,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withThrottled(Optional throttled) { Utils.checkNotNull(throttled, "throttled"); this.throttled = throttled; @@ -349,6 +382,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withComplete(Optional complete) { Utils.checkNotNull(complete, "complete"); this.complete = complete; @@ -361,6 +395,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withProgress(Optional progress) { Utils.checkNotNull(progress, "progress"); this.progress = progress; @@ -373,6 +408,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withSize(Optional size) { Utils.checkNotNull(size, "size"); this.size = size; @@ -385,6 +421,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withSpeed(Optional speed) { Utils.checkNotNull(speed, "speed"); this.speed = speed; @@ -397,6 +434,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withError(Optional error) { Utils.checkNotNull(error, "error"); this.error = error; @@ -409,6 +447,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withDuration(Optional duration) { Utils.checkNotNull(duration, "duration"); this.duration = duration; @@ -421,6 +460,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withRemaining(Optional remaining) { Utils.checkNotNull(remaining, "remaining"); this.remaining = remaining; @@ -433,6 +473,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withContext(Optional context) { Utils.checkNotNull(context, "context"); this.context = context; @@ -445,6 +486,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withSourceVideoCodec(Optional sourceVideoCodec) { Utils.checkNotNull(sourceVideoCodec, "sourceVideoCodec"); this.sourceVideoCodec = sourceVideoCodec; @@ -457,6 +499,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withSourceAudioCodec(Optional sourceAudioCodec) { Utils.checkNotNull(sourceAudioCodec, "sourceAudioCodec"); this.sourceAudioCodec = sourceAudioCodec; @@ -469,6 +512,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withVideoDecision(Optional videoDecision) { Utils.checkNotNull(videoDecision, "videoDecision"); this.videoDecision = videoDecision; @@ -481,6 +525,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withAudioDecision(Optional audioDecision) { Utils.checkNotNull(audioDecision, "audioDecision"); this.audioDecision = audioDecision; @@ -493,6 +538,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withSubtitleDecision(Optional subtitleDecision) { Utils.checkNotNull(subtitleDecision, "subtitleDecision"); this.subtitleDecision = subtitleDecision; @@ -505,6 +551,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withProtocol(Optional protocol) { Utils.checkNotNull(protocol, "protocol"); this.protocol = protocol; @@ -517,6 +564,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withContainer(Optional container) { Utils.checkNotNull(container, "container"); this.container = container; @@ -529,6 +577,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withVideoCodec(Optional videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = videoCodec; @@ -541,6 +590,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withAudioCodec(Optional audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = audioCodec; @@ -553,6 +603,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withAudioChannels(Optional audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = audioChannels; @@ -565,6 +616,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withTranscodeHwRequested(Optional transcodeHwRequested) { Utils.checkNotNull(transcodeHwRequested, "transcodeHwRequested"); this.transcodeHwRequested = transcodeHwRequested; @@ -577,6 +629,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withTimeStamp(Optional timeStamp) { Utils.checkNotNull(timeStamp, "timeStamp"); this.timeStamp = timeStamp; @@ -589,6 +642,7 @@ public class TranscodeSession { return this; } + public TranscodeSession withMaxOffsetAvailable(Optional maxOffsetAvailable) { Utils.checkNotNull(maxOffsetAvailable, "maxOffsetAvailable"); this.maxOffsetAvailable = maxOffsetAvailable; @@ -601,13 +655,13 @@ public class TranscodeSession { return this; } + public TranscodeSession withMinOffsetAvailable(Optional minOffsetAvailable) { Utils.checkNotNull(minOffsetAvailable, "minOffsetAvailable"); this.minOffsetAvailable = minOffsetAvailable; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -618,59 +672,43 @@ public class TranscodeSession { } TranscodeSession other = (TranscodeSession) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.throttled, other.throttled) && - Objects.deepEquals(this.complete, other.complete) && - Objects.deepEquals(this.progress, other.progress) && - Objects.deepEquals(this.size, other.size) && - Objects.deepEquals(this.speed, other.speed) && - Objects.deepEquals(this.error, other.error) && - Objects.deepEquals(this.duration, other.duration) && - Objects.deepEquals(this.remaining, other.remaining) && - Objects.deepEquals(this.context, other.context) && - Objects.deepEquals(this.sourceVideoCodec, other.sourceVideoCodec) && - Objects.deepEquals(this.sourceAudioCodec, other.sourceAudioCodec) && - Objects.deepEquals(this.videoDecision, other.videoDecision) && - Objects.deepEquals(this.audioDecision, other.audioDecision) && - Objects.deepEquals(this.subtitleDecision, other.subtitleDecision) && - Objects.deepEquals(this.protocol, other.protocol) && - Objects.deepEquals(this.container, other.container) && - Objects.deepEquals(this.videoCodec, other.videoCodec) && - Objects.deepEquals(this.audioCodec, other.audioCodec) && - Objects.deepEquals(this.audioChannels, other.audioChannels) && - Objects.deepEquals(this.transcodeHwRequested, other.transcodeHwRequested) && - Objects.deepEquals(this.timeStamp, other.timeStamp) && - Objects.deepEquals(this.maxOffsetAvailable, other.maxOffsetAvailable) && - Objects.deepEquals(this.minOffsetAvailable, other.minOffsetAvailable); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.throttled, other.throttled) && + Utils.enhancedDeepEquals(this.complete, other.complete) && + Utils.enhancedDeepEquals(this.progress, other.progress) && + Utils.enhancedDeepEquals(this.size, other.size) && + Utils.enhancedDeepEquals(this.speed, other.speed) && + Utils.enhancedDeepEquals(this.error, other.error) && + Utils.enhancedDeepEquals(this.duration, other.duration) && + Utils.enhancedDeepEquals(this.remaining, other.remaining) && + Utils.enhancedDeepEquals(this.context, other.context) && + Utils.enhancedDeepEquals(this.sourceVideoCodec, other.sourceVideoCodec) && + Utils.enhancedDeepEquals(this.sourceAudioCodec, other.sourceAudioCodec) && + Utils.enhancedDeepEquals(this.videoDecision, other.videoDecision) && + Utils.enhancedDeepEquals(this.audioDecision, other.audioDecision) && + Utils.enhancedDeepEquals(this.subtitleDecision, other.subtitleDecision) && + Utils.enhancedDeepEquals(this.protocol, other.protocol) && + Utils.enhancedDeepEquals(this.container, other.container) && + Utils.enhancedDeepEquals(this.videoCodec, other.videoCodec) && + Utils.enhancedDeepEquals(this.audioCodec, other.audioCodec) && + Utils.enhancedDeepEquals(this.audioChannels, other.audioChannels) && + Utils.enhancedDeepEquals(this.transcodeHwRequested, other.transcodeHwRequested) && + Utils.enhancedDeepEquals(this.timeStamp, other.timeStamp) && + Utils.enhancedDeepEquals(this.maxOffsetAvailable, other.maxOffsetAvailable) && + Utils.enhancedDeepEquals(this.minOffsetAvailable, other.minOffsetAvailable); } @Override public int hashCode() { - return Objects.hash( - key, - throttled, - complete, - progress, - size, - speed, - error, - duration, - remaining, - context, - sourceVideoCodec, - sourceAudioCodec, - videoDecision, - audioDecision, - subtitleDecision, - protocol, - container, - videoCodec, - audioCodec, - audioChannels, - transcodeHwRequested, - timeStamp, - maxOffsetAvailable, - minOffsetAvailable); + return Utils.enhancedHash( + key, throttled, complete, + progress, size, speed, + error, duration, remaining, + context, sourceVideoCodec, sourceAudioCodec, + videoDecision, audioDecision, subtitleDecision, + protocol, container, videoCodec, + audioCodec, audioChannels, transcodeHwRequested, + timeStamp, maxOffsetAvailable, minOffsetAvailable); } @Override @@ -701,61 +739,63 @@ public class TranscodeSession { "maxOffsetAvailable", maxOffsetAvailable, "minOffsetAvailable", minOffsetAvailable); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional key = Optional.empty(); - + private Optional throttled = Optional.empty(); - + private Optional complete = Optional.empty(); - + private Optional progress = Optional.empty(); - + private Optional size = Optional.empty(); - + private Optional speed = Optional.empty(); - + private Optional error = Optional.empty(); - + private Optional duration = Optional.empty(); - + private Optional remaining = Optional.empty(); - + private Optional context = Optional.empty(); - + private Optional sourceVideoCodec = Optional.empty(); - + private Optional sourceAudioCodec = Optional.empty(); - + private Optional videoDecision = Optional.empty(); - + private Optional audioDecision = Optional.empty(); - + private Optional subtitleDecision = Optional.empty(); - + private Optional protocol = Optional.empty(); - + private Optional container = Optional.empty(); - + private Optional videoCodec = Optional.empty(); - + private Optional audioCodec = Optional.empty(); - + private Optional audioChannels = Optional.empty(); - + private Optional transcodeHwRequested = Optional.empty(); - + private Optional timeStamp = Optional.empty(); - + private Optional maxOffsetAvailable = Optional.empty(); - + private Optional minOffsetAvailable = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder key(String key) { Utils.checkNotNull(key, "key"); this.key = Optional.ofNullable(key); @@ -768,6 +808,7 @@ public class TranscodeSession { return this; } + public Builder throttled(boolean throttled) { Utils.checkNotNull(throttled, "throttled"); this.throttled = Optional.ofNullable(throttled); @@ -780,6 +821,7 @@ public class TranscodeSession { return this; } + public Builder complete(boolean complete) { Utils.checkNotNull(complete, "complete"); this.complete = Optional.ofNullable(complete); @@ -792,6 +834,7 @@ public class TranscodeSession { return this; } + public Builder progress(double progress) { Utils.checkNotNull(progress, "progress"); this.progress = Optional.ofNullable(progress); @@ -804,6 +847,7 @@ public class TranscodeSession { return this; } + public Builder size(int size) { Utils.checkNotNull(size, "size"); this.size = Optional.ofNullable(size); @@ -816,6 +860,7 @@ public class TranscodeSession { return this; } + public Builder speed(double speed) { Utils.checkNotNull(speed, "speed"); this.speed = Optional.ofNullable(speed); @@ -828,6 +873,7 @@ public class TranscodeSession { return this; } + public Builder error(boolean error) { Utils.checkNotNull(error, "error"); this.error = Optional.ofNullable(error); @@ -840,6 +886,7 @@ public class TranscodeSession { return this; } + public Builder duration(int duration) { Utils.checkNotNull(duration, "duration"); this.duration = Optional.ofNullable(duration); @@ -852,6 +899,7 @@ public class TranscodeSession { return this; } + public Builder remaining(int remaining) { Utils.checkNotNull(remaining, "remaining"); this.remaining = Optional.ofNullable(remaining); @@ -864,6 +912,7 @@ public class TranscodeSession { return this; } + public Builder context(String context) { Utils.checkNotNull(context, "context"); this.context = Optional.ofNullable(context); @@ -876,6 +925,7 @@ public class TranscodeSession { return this; } + public Builder sourceVideoCodec(String sourceVideoCodec) { Utils.checkNotNull(sourceVideoCodec, "sourceVideoCodec"); this.sourceVideoCodec = Optional.ofNullable(sourceVideoCodec); @@ -888,6 +938,7 @@ public class TranscodeSession { return this; } + public Builder sourceAudioCodec(String sourceAudioCodec) { Utils.checkNotNull(sourceAudioCodec, "sourceAudioCodec"); this.sourceAudioCodec = Optional.ofNullable(sourceAudioCodec); @@ -900,6 +951,7 @@ public class TranscodeSession { return this; } + public Builder videoDecision(String videoDecision) { Utils.checkNotNull(videoDecision, "videoDecision"); this.videoDecision = Optional.ofNullable(videoDecision); @@ -912,6 +964,7 @@ public class TranscodeSession { return this; } + public Builder audioDecision(String audioDecision) { Utils.checkNotNull(audioDecision, "audioDecision"); this.audioDecision = Optional.ofNullable(audioDecision); @@ -924,6 +977,7 @@ public class TranscodeSession { return this; } + public Builder subtitleDecision(String subtitleDecision) { Utils.checkNotNull(subtitleDecision, "subtitleDecision"); this.subtitleDecision = Optional.ofNullable(subtitleDecision); @@ -936,6 +990,7 @@ public class TranscodeSession { return this; } + public Builder protocol(String protocol) { Utils.checkNotNull(protocol, "protocol"); this.protocol = Optional.ofNullable(protocol); @@ -948,6 +1003,7 @@ public class TranscodeSession { return this; } + public Builder container(String container) { Utils.checkNotNull(container, "container"); this.container = Optional.ofNullable(container); @@ -960,6 +1016,7 @@ public class TranscodeSession { return this; } + public Builder videoCodec(String videoCodec) { Utils.checkNotNull(videoCodec, "videoCodec"); this.videoCodec = Optional.ofNullable(videoCodec); @@ -972,6 +1029,7 @@ public class TranscodeSession { return this; } + public Builder audioCodec(String audioCodec) { Utils.checkNotNull(audioCodec, "audioCodec"); this.audioCodec = Optional.ofNullable(audioCodec); @@ -984,6 +1042,7 @@ public class TranscodeSession { return this; } + public Builder audioChannels(int audioChannels) { Utils.checkNotNull(audioChannels, "audioChannels"); this.audioChannels = Optional.ofNullable(audioChannels); @@ -996,6 +1055,7 @@ public class TranscodeSession { return this; } + public Builder transcodeHwRequested(boolean transcodeHwRequested) { Utils.checkNotNull(transcodeHwRequested, "transcodeHwRequested"); this.transcodeHwRequested = Optional.ofNullable(transcodeHwRequested); @@ -1008,6 +1068,7 @@ public class TranscodeSession { return this; } + public Builder timeStamp(double timeStamp) { Utils.checkNotNull(timeStamp, "timeStamp"); this.timeStamp = Optional.ofNullable(timeStamp); @@ -1020,6 +1081,7 @@ public class TranscodeSession { return this; } + public Builder maxOffsetAvailable(double maxOffsetAvailable) { Utils.checkNotNull(maxOffsetAvailable, "maxOffsetAvailable"); this.maxOffsetAvailable = Optional.ofNullable(maxOffsetAvailable); @@ -1032,6 +1094,7 @@ public class TranscodeSession { return this; } + public Builder minOffsetAvailable(double minOffsetAvailable) { Utils.checkNotNull(minOffsetAvailable, "minOffsetAvailable"); this.minOffsetAvailable = Optional.ofNullable(minOffsetAvailable); @@ -1043,33 +1106,19 @@ public class TranscodeSession { this.minOffsetAvailable = minOffsetAvailable; return this; } - + public TranscodeSession build() { + return new TranscodeSession( - key, - throttled, - complete, - progress, - size, - speed, - error, - duration, - remaining, - context, - sourceVideoCodec, - sourceAudioCodec, - videoDecision, - audioDecision, - subtitleDecision, - protocol, - container, - videoCodec, - audioCodec, - audioChannels, - transcodeHwRequested, - timeStamp, - maxOffsetAvailable, - minOffsetAvailable); + key, throttled, complete, + progress, size, speed, + error, duration, remaining, + context, sourceVideoCodec, sourceAudioCodec, + videoDecision, audioDecision, subtitleDecision, + protocol, container, videoCodec, + audioCodec, audioChannels, transcodeHwRequested, + timeStamp, maxOffsetAvailable, minOffsetAvailable); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Trials.java b/src/main/java/dev/plexapi/sdk/models/operations/Trials.java index cf662abc..5a188425 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Trials.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Trials.java @@ -7,21 +7,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class Trials { - @JsonCreator public Trials() { - - } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -35,7 +32,7 @@ public class Trials { @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( ); } @@ -43,16 +40,19 @@ public class Trials { public String toString() { return Utils.toString(Trials.class); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Builder() { // force use of static builder() method } - + public Trials build() { + return new Trials( ); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UltraBlurColors.java b/src/main/java/dev/plexapi/sdk/models/operations/UltraBlurColors.java index 8724550f..d6419822 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UltraBlurColors.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UltraBlurColors.java @@ -9,19 +9,22 @@ 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 UltraBlurColors { @JsonProperty("topLeft") private String topLeft; + @JsonProperty("topRight") private String topRight; + @JsonProperty("bottomRight") private String bottomRight; + @JsonProperty("bottomLeft") private String bottomLeft; @@ -61,9 +64,10 @@ public class UltraBlurColors { return bottomLeft; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public UltraBlurColors withTopLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); @@ -89,7 +93,6 @@ public class UltraBlurColors { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -100,18 +103,16 @@ public class UltraBlurColors { } UltraBlurColors other = (UltraBlurColors) o; return - Objects.deepEquals(this.topLeft, other.topLeft) && - Objects.deepEquals(this.topRight, other.topRight) && - Objects.deepEquals(this.bottomRight, other.bottomRight) && - Objects.deepEquals(this.bottomLeft, other.bottomLeft); + Utils.enhancedDeepEquals(this.topLeft, other.topLeft) && + Utils.enhancedDeepEquals(this.topRight, other.topRight) && + Utils.enhancedDeepEquals(this.bottomRight, other.bottomRight) && + Utils.enhancedDeepEquals(this.bottomLeft, other.bottomLeft); } @Override public int hashCode() { - return Objects.hash( - topLeft, - topRight, - bottomRight, + return Utils.enhancedHash( + topLeft, topRight, bottomRight, bottomLeft); } @@ -123,51 +124,56 @@ public class UltraBlurColors { "bottomRight", bottomRight, "bottomLeft", bottomLeft); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String topLeft; - + private String topRight; - + private String bottomRight; - + private String bottomLeft; - + private Builder() { // force use of static builder() method } + public Builder topLeft(String topLeft) { Utils.checkNotNull(topLeft, "topLeft"); this.topLeft = topLeft; return this; } + public Builder topRight(String topRight) { Utils.checkNotNull(topRight, "topRight"); this.topRight = topRight; return this; } + public Builder bottomRight(String bottomRight) { Utils.checkNotNull(bottomRight, "bottomRight"); this.bottomRight = bottomRight; return this; } + public Builder bottomLeft(String bottomLeft) { Utils.checkNotNull(bottomLeft, "bottomLeft"); this.bottomLeft = bottomLeft; return this; } - + public UltraBlurColors build() { + return new UltraBlurColors( - topLeft, - topRight, - bottomRight, + topLeft, topRight, bottomRight, bottomLeft); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequest.java index 22280a0e..1e71e23b 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequest.java @@ -10,10 +10,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class UpdatePlayProgressRequest { - /** * the media key */ @@ -69,9 +68,10 @@ public class UpdatePlayProgressRequest { return state; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the media key @@ -100,7 +100,6 @@ public class UpdatePlayProgressRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,17 +110,15 @@ public class UpdatePlayProgressRequest { } UpdatePlayProgressRequest other = (UpdatePlayProgressRequest) o; return - Objects.deepEquals(this.key, other.key) && - Objects.deepEquals(this.time, other.time) && - Objects.deepEquals(this.state, other.state); + Utils.enhancedDeepEquals(this.key, other.key) && + Utils.enhancedDeepEquals(this.time, other.time) && + Utils.enhancedDeepEquals(this.state, other.state); } @Override public int hashCode() { - return Objects.hash( - key, - time, - state); + return Utils.enhancedHash( + key, time, state); } @Override @@ -131,19 +128,21 @@ public class UpdatePlayProgressRequest { "time", time, "state", state); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String key; - + private Double time; - + private String state; - + private Builder() { // force use of static builder() method } + /** * the media key */ @@ -153,6 +152,7 @@ public class UpdatePlayProgressRequest { return this; } + /** * The time, in milliseconds, used to set the media playback progress. */ @@ -162,6 +162,7 @@ public class UpdatePlayProgressRequest { return this; } + /** * The playback state of the media item. */ @@ -170,12 +171,12 @@ public class UpdatePlayProgressRequest { this.state = state; return this; } - + public UpdatePlayProgressRequest build() { + return new UpdatePlayProgressRequest( - key, - time, - state); + key, time, state); } + } } 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 0ead85ea..826d0149 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.UpdatePlayProgress; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -13,10 +17,10 @@ public class UpdatePlayProgressRequestBuilder { private String key; private Double time; private String state; - private final SDKMethodInterfaces.MethodCallUpdatePlayProgress sdk; + private final SDKConfiguration sdkConfiguration; - public UpdatePlayProgressRequestBuilder(SDKMethodInterfaces.MethodCallUpdatePlayProgress sdk) { - this.sdk = sdk; + public UpdatePlayProgressRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public UpdatePlayProgressRequestBuilder key(String key) { @@ -37,11 +41,22 @@ public class UpdatePlayProgressRequestBuilder { return this; } - public UpdatePlayProgressResponse call() throws Exception { - return sdk.updatePlayProgress( - key, + private UpdatePlayProgressRequest buildRequest() { + + UpdatePlayProgressRequest request = new UpdatePlayProgressRequest(key, time, state); + + return request; + } + + public UpdatePlayProgressResponse call() throws Exception { + + RequestOperation operation + = new UpdatePlayProgress.Sync(sdkConfiguration); + UpdatePlayProgressRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressResponse.java index ed3cce99..1ec3a66d 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlayProgressResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class UpdatePlayProgressResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class UpdatePlayProgressResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class UpdatePlayProgressResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class UpdatePlayProgressResponse implements Response { } UpdatePlayProgressResponse other = (UpdatePlayProgressResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class UpdatePlayProgressResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class UpdatePlayProgressResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class UpdatePlayProgressResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class UpdatePlayProgressResponse implements Response { this.rawResponse = rawResponse; return this; } - + public UpdatePlayProgressResponse build() { + return new UpdatePlayProgressResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequest.java b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequest.java index 904c3f1e..6de29d54 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequest.java @@ -10,11 +10,10 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; -public class UpdatePlaylistRequest { +public class UpdatePlaylistRequest { /** * the ID of the playlist */ @@ -75,9 +74,10 @@ public class UpdatePlaylistRequest { return summary; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * the ID of the playlist @@ -97,6 +97,7 @@ public class UpdatePlaylistRequest { return this; } + /** * name of the playlist */ @@ -115,6 +116,7 @@ public class UpdatePlaylistRequest { return this; } + /** * summary description of the playlist */ @@ -124,7 +126,6 @@ public class UpdatePlaylistRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -135,17 +136,15 @@ public class UpdatePlaylistRequest { } UpdatePlaylistRequest other = (UpdatePlaylistRequest) o; return - Objects.deepEquals(this.playlistID, other.playlistID) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.summary, other.summary); + Utils.enhancedDeepEquals(this.playlistID, other.playlistID) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.summary, other.summary); } @Override public int hashCode() { - return Objects.hash( - playlistID, - title, - summary); + return Utils.enhancedHash( + playlistID, title, summary); } @Override @@ -155,19 +154,21 @@ public class UpdatePlaylistRequest { "title", title, "summary", summary); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Double playlistID; - + private Optional title = Optional.empty(); - + private Optional summary = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * the ID of the playlist */ @@ -177,6 +178,7 @@ public class UpdatePlaylistRequest { return this; } + /** * name of the playlist */ @@ -195,6 +197,7 @@ public class UpdatePlaylistRequest { return this; } + /** * summary description of the playlist */ @@ -212,12 +215,12 @@ public class UpdatePlaylistRequest { this.summary = summary; return this; } - + public UpdatePlaylistRequest build() { + return new UpdatePlaylistRequest( - playlistID, - title, - summary); + playlistID, title, summary); } + } } 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 acc29e52..00501386 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistRequestBuilder.java @@ -3,6 +3,10 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.UpdatePlaylist; import dev.plexapi.sdk.utils.Utils; import java.lang.Double; import java.lang.Exception; @@ -14,10 +18,10 @@ public class UpdatePlaylistRequestBuilder { private Double playlistID; private Optional title = Optional.empty(); private Optional summary = Optional.empty(); - private final SDKMethodInterfaces.MethodCallUpdatePlaylist sdk; + private final SDKConfiguration sdkConfiguration; - public UpdatePlaylistRequestBuilder(SDKMethodInterfaces.MethodCallUpdatePlaylist sdk) { - this.sdk = sdk; + public UpdatePlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public UpdatePlaylistRequestBuilder playlistID(double playlistID) { @@ -50,11 +54,22 @@ public class UpdatePlaylistRequestBuilder { return this; } - public UpdatePlaylistResponse call() throws Exception { - return sdk.updatePlaylist( - playlistID, + private UpdatePlaylistRequest buildRequest() { + + UpdatePlaylistRequest request = new UpdatePlaylistRequest(playlistID, title, summary); + + return request; + } + + public UpdatePlaylistResponse call() throws Exception { + + RequestOperation operation + = new UpdatePlaylist.Sync(sdkConfiguration); + UpdatePlaylistRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistResponse.java index 3cb5d33b..deac9b94 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UpdatePlaylistResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class UpdatePlaylistResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class UpdatePlaylistResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class UpdatePlaylistResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class UpdatePlaylistResponse implements Response { } UpdatePlaylistResponse other = (UpdatePlaylistResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class UpdatePlaylistResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class UpdatePlaylistResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class UpdatePlaylistResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class UpdatePlaylistResponse implements Response { this.rawResponse = rawResponse; return this; } - + public UpdatePlaylistResponse build() { + return new UpdatePlaylistResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } 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 a28ab119..85e80e7e 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequest.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequest.java @@ -12,10 +12,9 @@ import dev.plexapi.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.util.Objects; + public class UploadPlaylistRequest { - /** * 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. @@ -87,9 +86,10 @@ public class UploadPlaylistRequest { return sectionID; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. @@ -126,7 +126,6 @@ public class UploadPlaylistRequest { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,17 +136,15 @@ public class UploadPlaylistRequest { } UploadPlaylistRequest other = (UploadPlaylistRequest) o; return - Objects.deepEquals(this.path, other.path) && - Objects.deepEquals(this.force, other.force) && - Objects.deepEquals(this.sectionID, other.sectionID); + Utils.enhancedDeepEquals(this.path, other.path) && + Utils.enhancedDeepEquals(this.force, other.force) && + Utils.enhancedDeepEquals(this.sectionID, other.sectionID); } @Override public int hashCode() { - return Objects.hash( - path, - force, - sectionID); + return Utils.enhancedHash( + path, force, sectionID); } @Override @@ -157,19 +154,21 @@ public class UploadPlaylistRequest { "force", force, "sectionID", sectionID); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String path; - + private QueryParamForce force; - + private Long sectionID; - + private Builder() { // force use of static builder() method } + /** * 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. @@ -184,6 +183,7 @@ public class UploadPlaylistRequest { return this; } + /** * Force overwriting of duplicate playlists. * By default, a playlist file uploaded with the same path will overwrite the existing playlist. @@ -196,6 +196,7 @@ public class UploadPlaylistRequest { return this; } + /** * Possibly the section ID to upload the playlist to, we are not certain. */ @@ -204,17 +205,17 @@ public class UploadPlaylistRequest { this.sectionID = sectionID; return this; } - + public UploadPlaylistRequest build() { if (sectionID == null) { sectionID = _SINGLETON_VALUE_SectionID.value(); } + return new UploadPlaylistRequest( - path, - force, - sectionID); + path, force, sectionID); } + private static final LazySingletonValue _SINGLETON_VALUE_SectionID = new LazySingletonValue<>( "sectionID", 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 06d2e241..77e2b43a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistRequestBuilder.java @@ -3,7 +3,11 @@ */ package dev.plexapi.sdk.models.operations; +import static dev.plexapi.sdk.operations.Operations.RequestOperation; + import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.UploadPlaylist; import dev.plexapi.sdk.utils.LazySingletonValue; import dev.plexapi.sdk.utils.Utils; import java.lang.Exception; @@ -15,10 +19,10 @@ public class UploadPlaylistRequestBuilder { private String path; private QueryParamForce force; private Long sectionID; - private final SDKMethodInterfaces.MethodCallUploadPlaylist sdk; + private final SDKConfiguration sdkConfiguration; - public UploadPlaylistRequestBuilder(SDKMethodInterfaces.MethodCallUploadPlaylist sdk) { - this.sdk = sdk; + public UploadPlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; } public UploadPlaylistRequestBuilder path(String path) { @@ -39,14 +43,26 @@ public class UploadPlaylistRequestBuilder { return this; } - public UploadPlaylistResponse call() throws Exception { + + private UploadPlaylistRequest buildRequest() { if (sectionID == null) { sectionID = _SINGLETON_VALUE_SectionID.value(); } - return sdk.uploadPlaylist( - path, + + UploadPlaylistRequest request = new UploadPlaylistRequest(path, force, sectionID); + + return request; + } + + public UploadPlaylistResponse call() throws Exception { + + RequestOperation operation + = new UploadPlaylist.Sync(sdkConfiguration); + UploadPlaylistRequest request = buildRequest(); + + return operation.handleResponse(operation.doRequest(request)); } private static final LazySingletonValue _SINGLETON_VALUE_SectionID = diff --git a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistResponse.java index 3f151b54..9b501921 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistResponse.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UploadPlaylistResponse.java @@ -12,10 +12,9 @@ import java.lang.Integer; import java.lang.Override; import java.lang.String; import java.net.http.HttpResponse; -import java.util.Objects; + public class UploadPlaylistResponse implements Response { - /** * HTTP response content type for this operation */ @@ -68,9 +67,10 @@ public class UploadPlaylistResponse implements Response { return rawResponse; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * HTTP response content type for this operation @@ -99,7 +99,6 @@ public class UploadPlaylistResponse implements Response { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,17 +109,15 @@ public class UploadPlaylistResponse implements Response { } UploadPlaylistResponse other = (UploadPlaylistResponse) o; return - Objects.deepEquals(this.contentType, other.contentType) && - Objects.deepEquals(this.statusCode, other.statusCode) && - Objects.deepEquals(this.rawResponse, other.rawResponse); + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); } @Override public int hashCode() { - return Objects.hash( - contentType, - statusCode, - rawResponse); + return Utils.enhancedHash( + contentType, statusCode, rawResponse); } @Override @@ -130,19 +127,21 @@ public class UploadPlaylistResponse implements Response { "statusCode", statusCode, "rawResponse", rawResponse); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private String contentType; - + private Integer statusCode; - + private HttpResponse rawResponse; - + private Builder() { // force use of static builder() method } + /** * HTTP response content type for this operation */ @@ -152,6 +151,7 @@ public class UploadPlaylistResponse implements Response { return this; } + /** * HTTP response status code for this operation */ @@ -161,6 +161,7 @@ public class UploadPlaylistResponse implements Response { return this; } + /** * Raw HTTP response; suitable for custom response parsing */ @@ -169,12 +170,12 @@ public class UploadPlaylistResponse implements Response { this.rawResponse = rawResponse; return this; } - + public UploadPlaylistResponse build() { + return new UploadPlaylistResponse( - contentType, - statusCode, - rawResponse); + contentType, statusCode, rawResponse); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Upscale.java b/src/main/java/dev/plexapi/sdk/models/operations/Upscale.java index e4a4a586..b958bc5f 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Upscale.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Upscale.java @@ -19,7 +19,7 @@ public enum Upscale { @JsonValue private final long value; - private Upscale(long value) { + Upscale(long value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/User.java b/src/main/java/dev/plexapi/sdk/models/operations/User.java index 32bd57b3..09aa693c 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/User.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/User.java @@ -13,12 +13,11 @@ import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.List; -import java.util.Objects; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; -public class User { +public class User { /** * User's unique ID. */ @@ -49,18 +48,25 @@ public class User { */ private String thumb; + private Optional protected_; + private Optional home; + private Optional allowTuners; + private Optional allowSync; + private Optional allowCameraUpload; + private Optional allowChannels; + private Optional allowSubtitleAdmin; /** @@ -88,6 +94,7 @@ public class User { */ private Optional filterTelevision; + private Optional restricted; /** @@ -166,7 +173,13 @@ public class User { String email, String thumb, List server) { - this(id, title, username, email, JsonNullable.undefined(), thumb, Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), Optional.empty(), server); + this(id, title, username, + email, JsonNullable.undefined(), thumb, + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), + Optional.empty(), server); } /** @@ -313,9 +326,10 @@ public class User { return server; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * User's unique ID. @@ -386,6 +400,7 @@ public class User { return this; } + public User withProtected(Optional protected_) { Utils.checkNotNull(protected_, "protected_"); this.protected_ = protected_; @@ -398,6 +413,7 @@ public class User { return this; } + public User withHome(Optional home) { Utils.checkNotNull(home, "home"); this.home = home; @@ -410,6 +426,7 @@ public class User { return this; } + public User withAllowTuners(Optional allowTuners) { Utils.checkNotNull(allowTuners, "allowTuners"); this.allowTuners = allowTuners; @@ -422,6 +439,7 @@ public class User { return this; } + public User withAllowSync(Optional allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = allowSync; @@ -434,6 +452,7 @@ public class User { return this; } + public User withAllowCameraUpload(Optional allowCameraUpload) { Utils.checkNotNull(allowCameraUpload, "allowCameraUpload"); this.allowCameraUpload = allowCameraUpload; @@ -446,6 +465,7 @@ public class User { return this; } + public User withAllowChannels(Optional allowChannels) { Utils.checkNotNull(allowChannels, "allowChannels"); this.allowChannels = allowChannels; @@ -458,6 +478,7 @@ public class User { return this; } + public User withAllowSubtitleAdmin(Optional allowSubtitleAdmin) { Utils.checkNotNull(allowSubtitleAdmin, "allowSubtitleAdmin"); this.allowSubtitleAdmin = allowSubtitleAdmin; @@ -545,6 +566,7 @@ public class User { return this; } + /** * Filters applied for television. */ @@ -560,6 +582,7 @@ public class User { return this; } + public User withRestricted(Optional restricted) { Utils.checkNotNull(restricted, "restricted"); this.restricted = restricted; @@ -575,7 +598,6 @@ public class User { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -586,51 +608,38 @@ public class User { } User other = (User) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.title, other.title) && - Objects.deepEquals(this.username, other.username) && - Objects.deepEquals(this.email, other.email) && - Objects.deepEquals(this.recommendationsPlaylistId, other.recommendationsPlaylistId) && - Objects.deepEquals(this.thumb, other.thumb) && - Objects.deepEquals(this.protected_, other.protected_) && - Objects.deepEquals(this.home, other.home) && - Objects.deepEquals(this.allowTuners, other.allowTuners) && - Objects.deepEquals(this.allowSync, other.allowSync) && - Objects.deepEquals(this.allowCameraUpload, other.allowCameraUpload) && - Objects.deepEquals(this.allowChannels, other.allowChannels) && - Objects.deepEquals(this.allowSubtitleAdmin, other.allowSubtitleAdmin) && - Objects.deepEquals(this.filterAll, other.filterAll) && - Objects.deepEquals(this.filterMovies, other.filterMovies) && - Objects.deepEquals(this.filterMusic, other.filterMusic) && - Objects.deepEquals(this.filterPhotos, other.filterPhotos) && - Objects.deepEquals(this.filterTelevision, other.filterTelevision) && - Objects.deepEquals(this.restricted, other.restricted) && - Objects.deepEquals(this.server, other.server); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.username, other.username) && + Utils.enhancedDeepEquals(this.email, other.email) && + Utils.enhancedDeepEquals(this.recommendationsPlaylistId, other.recommendationsPlaylistId) && + Utils.enhancedDeepEquals(this.thumb, other.thumb) && + Utils.enhancedDeepEquals(this.protected_, other.protected_) && + Utils.enhancedDeepEquals(this.home, other.home) && + Utils.enhancedDeepEquals(this.allowTuners, other.allowTuners) && + Utils.enhancedDeepEquals(this.allowSync, other.allowSync) && + Utils.enhancedDeepEquals(this.allowCameraUpload, other.allowCameraUpload) && + Utils.enhancedDeepEquals(this.allowChannels, other.allowChannels) && + Utils.enhancedDeepEquals(this.allowSubtitleAdmin, other.allowSubtitleAdmin) && + Utils.enhancedDeepEquals(this.filterAll, other.filterAll) && + Utils.enhancedDeepEquals(this.filterMovies, other.filterMovies) && + Utils.enhancedDeepEquals(this.filterMusic, other.filterMusic) && + Utils.enhancedDeepEquals(this.filterPhotos, other.filterPhotos) && + Utils.enhancedDeepEquals(this.filterTelevision, other.filterTelevision) && + Utils.enhancedDeepEquals(this.restricted, other.restricted) && + Utils.enhancedDeepEquals(this.server, other.server); } @Override public int hashCode() { - return Objects.hash( - id, - title, - username, - email, - recommendationsPlaylistId, - thumb, - protected_, - home, - allowTuners, - allowSync, - allowCameraUpload, - allowChannels, - allowSubtitleAdmin, - filterAll, - filterMovies, - filterMusic, - filterPhotos, - filterTelevision, - restricted, - server); + return Utils.enhancedHash( + id, title, username, + email, recommendationsPlaylistId, thumb, + protected_, home, allowTuners, + allowSync, allowCameraUpload, allowChannels, + allowSubtitleAdmin, filterAll, filterMovies, + filterMusic, filterPhotos, filterTelevision, + restricted, server); } @Override @@ -657,53 +666,55 @@ public class User { "restricted", restricted, "server", server); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Long id; - + private String title; - + private String username; - + private String email; - + private JsonNullable recommendationsPlaylistId = JsonNullable.undefined(); - + private String thumb; - + private Optional protected_; - + private Optional home; - + private Optional allowTuners; - + private Optional allowSync; - + private Optional allowCameraUpload; - + private Optional allowChannels; - + private Optional allowSubtitleAdmin; - + private JsonNullable filterAll = JsonNullable.undefined(); - + private JsonNullable filterMovies = JsonNullable.undefined(); - + private JsonNullable filterMusic = JsonNullable.undefined(); - + private JsonNullable filterPhotos = JsonNullable.undefined(); - + private Optional filterTelevision = Optional.empty(); - + private Optional restricted; - + private List server; - + private Builder() { // force use of static builder() method } + /** * User's unique ID. */ @@ -713,6 +724,7 @@ public class User { return this; } + /** * User's display name. */ @@ -722,6 +734,7 @@ public class User { return this; } + /** * User's username. */ @@ -731,6 +744,7 @@ public class User { return this; } + /** * User's email address. */ @@ -740,6 +754,7 @@ public class User { return this; } + /** * ID of the user's recommendation playlist. */ @@ -758,6 +773,7 @@ public class User { return this; } + /** * URL to the user's avatar image. */ @@ -767,6 +783,7 @@ public class User { return this; } + public Builder protected_(Protected protected_) { Utils.checkNotNull(protected_, "protected_"); this.protected_ = Optional.ofNullable(protected_); @@ -779,6 +796,7 @@ public class User { return this; } + public Builder home(Home home) { Utils.checkNotNull(home, "home"); this.home = Optional.ofNullable(home); @@ -791,6 +809,7 @@ public class User { return this; } + public Builder allowTuners(AllowTuners allowTuners) { Utils.checkNotNull(allowTuners, "allowTuners"); this.allowTuners = Optional.ofNullable(allowTuners); @@ -803,6 +822,7 @@ public class User { return this; } + public Builder allowSync(AllowSync allowSync) { Utils.checkNotNull(allowSync, "allowSync"); this.allowSync = Optional.ofNullable(allowSync); @@ -815,6 +835,7 @@ public class User { return this; } + public Builder allowCameraUpload(AllowCameraUpload allowCameraUpload) { Utils.checkNotNull(allowCameraUpload, "allowCameraUpload"); this.allowCameraUpload = Optional.ofNullable(allowCameraUpload); @@ -827,6 +848,7 @@ public class User { return this; } + public Builder allowChannels(AllowChannels allowChannels) { Utils.checkNotNull(allowChannels, "allowChannels"); this.allowChannels = Optional.ofNullable(allowChannels); @@ -839,6 +861,7 @@ public class User { return this; } + public Builder allowSubtitleAdmin(AllowSubtitleAdmin allowSubtitleAdmin) { Utils.checkNotNull(allowSubtitleAdmin, "allowSubtitleAdmin"); this.allowSubtitleAdmin = Optional.ofNullable(allowSubtitleAdmin); @@ -851,6 +874,7 @@ public class User { return this; } + /** * Filters applied for all content. */ @@ -869,6 +893,7 @@ public class User { return this; } + /** * Filters applied for movies. */ @@ -887,6 +912,7 @@ public class User { return this; } + /** * Filters applied for music. */ @@ -905,6 +931,7 @@ public class User { return this; } + /** * Filters applied for photos. */ @@ -923,6 +950,7 @@ public class User { return this; } + /** * Filters applied for television. */ @@ -941,6 +969,7 @@ public class User { return this; } + public Builder restricted(Restricted restricted) { Utils.checkNotNull(restricted, "restricted"); this.restricted = Optional.ofNullable(restricted); @@ -953,6 +982,7 @@ public class User { return this; } + /** * List of servers owned by the user. */ @@ -961,7 +991,7 @@ public class User { this.server = server; return this; } - + public User build() { if (protected_ == null) { protected_ = _SINGLETON_VALUE_Protected.value(); @@ -987,29 +1017,18 @@ public class User { if (restricted == null) { restricted = _SINGLETON_VALUE_Restricted.value(); } + return new User( - id, - title, - username, - email, - recommendationsPlaylistId, - thumb, - protected_, - home, - allowTuners, - allowSync, - allowCameraUpload, - allowChannels, - allowSubtitleAdmin, - filterAll, - filterMovies, - filterMusic, - filterPhotos, - filterTelevision, - restricted, - server); + id, title, username, + email, recommendationsPlaylistId, thumb, + protected_, home, allowTuners, + allowSync, allowCameraUpload, allowChannels, + allowSubtitleAdmin, filterAll, filterMovies, + filterMusic, filterPhotos, filterTelevision, + restricted, server); } + private static final LazySingletonValue> _SINGLETON_VALUE_Protected = new LazySingletonValue<>( "protected", 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 a426abe8..ca91d45a 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/UserProfile.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/UserProfile.java @@ -15,11 +15,10 @@ import java.lang.Boolean; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; -import java.util.Objects; import java.util.Optional; -public class UserProfile { +public class UserProfile { /** * If the account has automatically select audio and subtitle tracks enabled */ @@ -41,22 +40,27 @@ public class UserProfile { @JsonProperty("defaultSubtitleLanguage") private Optional defaultSubtitleLanguage; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("autoSelectSubtitle") private Optional autoSelectSubtitle; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleAccessibility") private Optional defaultSubtitleAccessibility; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaultSubtitleForced") private Optional defaultSubtitleForced; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("watchedIndicator") private Optional watchedIndicator; + @JsonInclude(Include.NON_ABSENT) @JsonProperty("mediaReviewsVisibility") private Optional mediaReviewsVisibility; @@ -90,7 +94,9 @@ public class UserProfile { } public UserProfile() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); } /** @@ -147,9 +153,10 @@ public class UserProfile { return (Optional) mediaReviewsVisibility; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * If the account has automatically select audio and subtitle tracks enabled @@ -160,6 +167,7 @@ public class UserProfile { return this; } + /** * If the account has automatically select audio and subtitle tracks enabled */ @@ -178,6 +186,7 @@ public class UserProfile { return this; } + /** * The preferred audio language for the account */ @@ -196,6 +205,7 @@ public class UserProfile { return this; } + /** * The preferred subtitle language for the account */ @@ -211,6 +221,7 @@ public class UserProfile { return this; } + public UserProfile withAutoSelectSubtitle(Optional autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = autoSelectSubtitle; @@ -223,6 +234,7 @@ public class UserProfile { return this; } + public UserProfile withDefaultSubtitleAccessibility(Optional defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = defaultSubtitleAccessibility; @@ -235,6 +247,7 @@ public class UserProfile { return this; } + public UserProfile withDefaultSubtitleForced(Optional defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = defaultSubtitleForced; @@ -247,6 +260,7 @@ public class UserProfile { return this; } + public UserProfile withWatchedIndicator(Optional watchedIndicator) { Utils.checkNotNull(watchedIndicator, "watchedIndicator"); this.watchedIndicator = watchedIndicator; @@ -259,13 +273,13 @@ public class UserProfile { return this; } + public UserProfile withMediaReviewsVisibility(Optional mediaReviewsVisibility) { Utils.checkNotNull(mediaReviewsVisibility, "mediaReviewsVisibility"); this.mediaReviewsVisibility = mediaReviewsVisibility; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -276,27 +290,22 @@ public class UserProfile { } UserProfile other = (UserProfile) o; return - Objects.deepEquals(this.autoSelectAudio, other.autoSelectAudio) && - Objects.deepEquals(this.defaultAudioLanguage, other.defaultAudioLanguage) && - Objects.deepEquals(this.defaultSubtitleLanguage, other.defaultSubtitleLanguage) && - Objects.deepEquals(this.autoSelectSubtitle, other.autoSelectSubtitle) && - Objects.deepEquals(this.defaultSubtitleAccessibility, other.defaultSubtitleAccessibility) && - Objects.deepEquals(this.defaultSubtitleForced, other.defaultSubtitleForced) && - Objects.deepEquals(this.watchedIndicator, other.watchedIndicator) && - Objects.deepEquals(this.mediaReviewsVisibility, other.mediaReviewsVisibility); + Utils.enhancedDeepEquals(this.autoSelectAudio, other.autoSelectAudio) && + Utils.enhancedDeepEquals(this.defaultAudioLanguage, other.defaultAudioLanguage) && + Utils.enhancedDeepEquals(this.defaultSubtitleLanguage, other.defaultSubtitleLanguage) && + Utils.enhancedDeepEquals(this.autoSelectSubtitle, other.autoSelectSubtitle) && + Utils.enhancedDeepEquals(this.defaultSubtitleAccessibility, other.defaultSubtitleAccessibility) && + Utils.enhancedDeepEquals(this.defaultSubtitleForced, other.defaultSubtitleForced) && + Utils.enhancedDeepEquals(this.watchedIndicator, other.watchedIndicator) && + Utils.enhancedDeepEquals(this.mediaReviewsVisibility, other.mediaReviewsVisibility); } @Override public int hashCode() { - return Objects.hash( - autoSelectAudio, - defaultAudioLanguage, - defaultSubtitleLanguage, - autoSelectSubtitle, - defaultSubtitleAccessibility, - defaultSubtitleForced, - watchedIndicator, - mediaReviewsVisibility); + return Utils.enhancedHash( + autoSelectAudio, defaultAudioLanguage, defaultSubtitleLanguage, + autoSelectSubtitle, defaultSubtitleAccessibility, defaultSubtitleForced, + watchedIndicator, mediaReviewsVisibility); } @Override @@ -311,29 +320,31 @@ public class UserProfile { "watchedIndicator", watchedIndicator, "mediaReviewsVisibility", mediaReviewsVisibility); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional autoSelectAudio; - + private Optional defaultAudioLanguage = Optional.empty(); - + private Optional defaultSubtitleLanguage = Optional.empty(); - + private Optional autoSelectSubtitle; - + private Optional defaultSubtitleAccessibility; - + private Optional defaultSubtitleForced; - + private Optional watchedIndicator; - + private Optional mediaReviewsVisibility; - + private Builder() { // force use of static builder() method } + /** * If the account has automatically select audio and subtitle tracks enabled */ @@ -352,6 +363,7 @@ public class UserProfile { return this; } + /** * The preferred audio language for the account */ @@ -370,6 +382,7 @@ public class UserProfile { return this; } + /** * The preferred subtitle language for the account */ @@ -388,6 +401,7 @@ public class UserProfile { return this; } + public Builder autoSelectSubtitle(AutoSelectSubtitle autoSelectSubtitle) { Utils.checkNotNull(autoSelectSubtitle, "autoSelectSubtitle"); this.autoSelectSubtitle = Optional.ofNullable(autoSelectSubtitle); @@ -400,6 +414,7 @@ public class UserProfile { return this; } + public Builder defaultSubtitleAccessibility(DefaultSubtitleAccessibility defaultSubtitleAccessibility) { Utils.checkNotNull(defaultSubtitleAccessibility, "defaultSubtitleAccessibility"); this.defaultSubtitleAccessibility = Optional.ofNullable(defaultSubtitleAccessibility); @@ -412,6 +427,7 @@ public class UserProfile { return this; } + public Builder defaultSubtitleForced(DefaultSubtitleForced defaultSubtitleForced) { Utils.checkNotNull(defaultSubtitleForced, "defaultSubtitleForced"); this.defaultSubtitleForced = Optional.ofNullable(defaultSubtitleForced); @@ -424,6 +440,7 @@ public class UserProfile { return this; } + public Builder watchedIndicator(WatchedIndicator watchedIndicator) { Utils.checkNotNull(watchedIndicator, "watchedIndicator"); this.watchedIndicator = Optional.ofNullable(watchedIndicator); @@ -436,6 +453,7 @@ public class UserProfile { return this; } + public Builder mediaReviewsVisibility(MediaReviewsVisibility mediaReviewsVisibility) { Utils.checkNotNull(mediaReviewsVisibility, "mediaReviewsVisibility"); this.mediaReviewsVisibility = Optional.ofNullable(mediaReviewsVisibility); @@ -447,7 +465,7 @@ public class UserProfile { this.mediaReviewsVisibility = mediaReviewsVisibility; return this; } - + public UserProfile build() { if (autoSelectAudio == null) { autoSelectAudio = _SINGLETON_VALUE_AutoSelectAudio.value(); @@ -467,17 +485,14 @@ public class UserProfile { if (mediaReviewsVisibility == null) { mediaReviewsVisibility = _SINGLETON_VALUE_MediaReviewsVisibility.value(); } + return new UserProfile( - autoSelectAudio, - defaultAudioLanguage, - defaultSubtitleLanguage, - autoSelectSubtitle, - defaultSubtitleAccessibility, - defaultSubtitleForced, - watchedIndicator, - mediaReviewsVisibility); + autoSelectAudio, defaultAudioLanguage, defaultSubtitleLanguage, + autoSelectSubtitle, defaultSubtitleAccessibility, defaultSubtitleForced, + watchedIndicator, mediaReviewsVisibility); } + private static final LazySingletonValue> _SINGLETON_VALUE_AutoSelectAudio = new LazySingletonValue<>( "autoSelectAudio", 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 f88aa20d..f0262893 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/WatchedIndicator.java @@ -19,7 +19,7 @@ public enum WatchedIndicator { @JsonValue private final int value; - private WatchedIndicator(int value) { + WatchedIndicator(int value) { this.value = value; } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/Writer.java b/src/main/java/dev/plexapi/sdk/models/operations/Writer.java index b715d0dc..d729d168 100644 --- a/src/main/java/dev/plexapi/sdk/models/operations/Writer.java +++ b/src/main/java/dev/plexapi/sdk/models/operations/Writer.java @@ -12,11 +12,10 @@ 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 Writer { +public class Writer { /** * Unique identifier for the writer. */ @@ -72,7 +71,8 @@ public class Writer { int id, String filter, String tag) { - this(id, filter, tag, Optional.empty(), Optional.empty()); + this(id, filter, tag, + Optional.empty(), Optional.empty()); } /** @@ -115,9 +115,10 @@ public class Writer { return thumb; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + /** * Unique identifier for the writer. @@ -155,6 +156,7 @@ public class Writer { return this; } + /** * A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification. */ @@ -173,6 +175,7 @@ public class Writer { return this; } + /** * The absolute URL of the thumbnail image for the writer. */ @@ -182,7 +185,6 @@ public class Writer { return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -193,21 +195,18 @@ public class Writer { } Writer other = (Writer) o; return - Objects.deepEquals(this.id, other.id) && - Objects.deepEquals(this.filter, other.filter) && - Objects.deepEquals(this.tag, other.tag) && - Objects.deepEquals(this.tagKey, other.tagKey) && - Objects.deepEquals(this.thumb, other.thumb); + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.filter, other.filter) && + Utils.enhancedDeepEquals(this.tag, other.tag) && + Utils.enhancedDeepEquals(this.tagKey, other.tagKey) && + Utils.enhancedDeepEquals(this.thumb, other.thumb); } @Override public int hashCode() { - return Objects.hash( - id, - filter, - tag, - tagKey, - thumb); + return Utils.enhancedHash( + id, filter, tag, + tagKey, thumb); } @Override @@ -219,23 +218,25 @@ public class Writer { "tagKey", tagKey, "thumb", thumb); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Integer id; - + private String filter; - + private String tag; - + private Optional tagKey = Optional.empty(); - + private Optional thumb = Optional.empty(); - + private Builder() { // force use of static builder() method } + /** * Unique identifier for the writer. */ @@ -245,6 +246,7 @@ public class Writer { return this; } + /** * The filter string used to query this writer. */ @@ -254,6 +256,7 @@ public class Writer { return this; } + /** * The role of Writer */ @@ -263,6 +266,7 @@ public class Writer { return this; } + /** * A 24-character hexadecimal unique key associated with the writer’s tag, used for internal identification. */ @@ -281,6 +285,7 @@ public class Writer { return this; } + /** * The absolute URL of the thumbnail image for the writer. */ @@ -298,14 +303,13 @@ public class Writer { this.thumb = thumb; return this; } - + public Writer build() { + return new Writer( - id, - filter, - tag, - tagKey, - thumb); + id, filter, tag, + tagKey, thumb); } + } } diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsRequestBuilder.java new file mode 100644 index 00000000..7d1fd64b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsRequestBuilder.java @@ -0,0 +1,72 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.AddPlaylistContentsRequest; +import dev.plexapi.sdk.operations.AddPlaylistContents; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AddPlaylistContentsRequestBuilder { + + private Double playlistID; + private String uri; + private Optional playQueueID = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public AddPlaylistContentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AddPlaylistContentsRequestBuilder playlistID(double playlistID) { + Utils.checkNotNull(playlistID, "playlistID"); + this.playlistID = playlistID; + return this; + } + + public AddPlaylistContentsRequestBuilder uri(String uri) { + Utils.checkNotNull(uri, "uri"); + this.uri = uri; + return this; + } + + public AddPlaylistContentsRequestBuilder playQueueID(double playQueueID) { + Utils.checkNotNull(playQueueID, "playQueueID"); + this.playQueueID = Optional.of(playQueueID); + return this; + } + + public AddPlaylistContentsRequestBuilder playQueueID(Optional playQueueID) { + Utils.checkNotNull(playQueueID, "playQueueID"); + this.playQueueID = playQueueID; + return this; + } + + + private AddPlaylistContentsRequest buildRequest() { + + AddPlaylistContentsRequest request = new AddPlaylistContentsRequest(playlistID, + uri, + playQueueID); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new AddPlaylistContents.Async(sdkConfiguration); + AddPlaylistContentsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsResponse.java new file mode 100644 index 00000000..a6b36863 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/AddPlaylistContentsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.AddPlaylistContentsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class AddPlaylistContentsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Playlist Updated + */ + private Optional object; + + @JsonCreator + public AddPlaylistContentsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public AddPlaylistContentsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Playlist Updated + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AddPlaylistContentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AddPlaylistContentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AddPlaylistContentsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Playlist Updated + */ + public AddPlaylistContentsResponse withObject(AddPlaylistContentsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Playlist Updated + */ + public AddPlaylistContentsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPlaylistContentsResponse other = (AddPlaylistContentsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(AddPlaylistContentsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Playlist Updated + */ + public Builder object(AddPlaylistContentsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Playlist Updated + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public AddPlaylistContentsResponse build() { + + return new AddPlaylistContentsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesRequestBuilder.java new file mode 100644 index 00000000..e7043cf7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesRequestBuilder.java @@ -0,0 +1,70 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.ApplyUpdatesRequest; +import dev.plexapi.sdk.models.operations.Skip; +import dev.plexapi.sdk.models.operations.Tonight; +import dev.plexapi.sdk.operations.ApplyUpdates; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class ApplyUpdatesRequestBuilder { + + private Optional tonight = Optional.empty(); + private Optional skip = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public ApplyUpdatesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public ApplyUpdatesRequestBuilder tonight(Tonight tonight) { + Utils.checkNotNull(tonight, "tonight"); + this.tonight = Optional.of(tonight); + return this; + } + + public ApplyUpdatesRequestBuilder tonight(Optional tonight) { + Utils.checkNotNull(tonight, "tonight"); + this.tonight = tonight; + return this; + } + + public ApplyUpdatesRequestBuilder skip(Skip skip) { + Utils.checkNotNull(skip, "skip"); + this.skip = Optional.of(skip); + return this; + } + + public ApplyUpdatesRequestBuilder skip(Optional skip) { + Utils.checkNotNull(skip, "skip"); + this.skip = skip; + return this; + } + + + private ApplyUpdatesRequest buildRequest() { + + ApplyUpdatesRequest request = new ApplyUpdatesRequest(tonight, + skip); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new ApplyUpdates.Async(sdkConfiguration); + ApplyUpdatesRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesResponse.java new file mode 100644 index 00000000..e168e492 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/ApplyUpdatesResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class ApplyUpdatesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public ApplyUpdatesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public ApplyUpdatesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ApplyUpdatesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ApplyUpdatesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApplyUpdatesResponse other = (ApplyUpdatesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ApplyUpdatesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public ApplyUpdatesResponse build() { + + return new ApplyUpdatesResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesRequestBuilder.java new file mode 100644 index 00000000..10c89d4d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.CancelServerActivitiesRequest; +import dev.plexapi.sdk.operations.CancelServerActivities; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class CancelServerActivitiesRequestBuilder { + + private String activityUUID; + private final SDKConfiguration sdkConfiguration; + + public CancelServerActivitiesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CancelServerActivitiesRequestBuilder activityUUID(String activityUUID) { + Utils.checkNotNull(activityUUID, "activityUUID"); + this.activityUUID = activityUUID; + return this; + } + + + private CancelServerActivitiesRequest buildRequest() { + + CancelServerActivitiesRequest request = new CancelServerActivitiesRequest(activityUUID); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new CancelServerActivities.Async(sdkConfiguration); + CancelServerActivitiesRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesResponse.java new file mode 100644 index 00000000..55a7a1ae --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/CancelServerActivitiesResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class CancelServerActivitiesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public CancelServerActivitiesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public CancelServerActivitiesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CancelServerActivitiesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CancelServerActivitiesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CancelServerActivitiesResponse other = (CancelServerActivitiesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CancelServerActivitiesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CancelServerActivitiesResponse build() { + + return new CancelServerActivitiesResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesRequestBuilder.java new file mode 100644 index 00000000..c59a4461 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.CheckForUpdatesRequest; +import dev.plexapi.sdk.models.operations.Download; +import dev.plexapi.sdk.operations.CheckForUpdates; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class CheckForUpdatesRequestBuilder { + + private Optional download = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public CheckForUpdatesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CheckForUpdatesRequestBuilder download(Download download) { + Utils.checkNotNull(download, "download"); + this.download = Optional.of(download); + return this; + } + + public CheckForUpdatesRequestBuilder download(Optional download) { + Utils.checkNotNull(download, "download"); + this.download = download; + return this; + } + + + private CheckForUpdatesRequest buildRequest() { + + CheckForUpdatesRequest request = new CheckForUpdatesRequest(download); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new CheckForUpdates.Async(sdkConfiguration); + CheckForUpdatesRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesResponse.java new file mode 100644 index 00000000..a488a55b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/CheckForUpdatesResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class CheckForUpdatesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public CheckForUpdatesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public CheckForUpdatesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CheckForUpdatesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CheckForUpdatesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckForUpdatesResponse other = (CheckForUpdatesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(CheckForUpdatesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public CheckForUpdatesResponse build() { + + return new CheckForUpdatesResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsRequestBuilder.java new file mode 100644 index 00000000..d6aaa925 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.ClearPlaylistContentsRequest; +import dev.plexapi.sdk.operations.ClearPlaylistContents; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class ClearPlaylistContentsRequestBuilder { + + private Double playlistID; + private final SDKConfiguration sdkConfiguration; + + public ClearPlaylistContentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public ClearPlaylistContentsRequestBuilder playlistID(double playlistID) { + Utils.checkNotNull(playlistID, "playlistID"); + this.playlistID = playlistID; + return this; + } + + + private ClearPlaylistContentsRequest buildRequest() { + + ClearPlaylistContentsRequest request = new ClearPlaylistContentsRequest(playlistID); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new ClearPlaylistContents.Async(sdkConfiguration); + ClearPlaylistContentsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsResponse.java new file mode 100644 index 00000000..4e0cad8d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/ClearPlaylistContentsResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class ClearPlaylistContentsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public ClearPlaylistContentsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public ClearPlaylistContentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public ClearPlaylistContentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public ClearPlaylistContentsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClearPlaylistContentsResponse other = (ClearPlaylistContentsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(ClearPlaylistContentsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public ClearPlaylistContentsResponse build() { + + return new ClearPlaylistContentsResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistRequestBuilder.java new file mode 100644 index 00000000..fb7c8b7a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.CreatePlaylistRequest; +import dev.plexapi.sdk.operations.CreatePlaylist; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class CreatePlaylistRequestBuilder { + + private CreatePlaylistRequest request; + private final SDKConfiguration sdkConfiguration; + + public CreatePlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CreatePlaylistRequestBuilder request(CreatePlaylistRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new CreatePlaylist.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistResponse.java new file mode 100644 index 00000000..3c61112d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/CreatePlaylistResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.CreatePlaylistResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class CreatePlaylistResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * returns all playlists + */ + private Optional object; + + @JsonCreator + public CreatePlaylistResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public CreatePlaylistResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * returns all playlists + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public CreatePlaylistResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public CreatePlaylistResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public CreatePlaylistResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * returns all playlists + */ + public CreatePlaylistResponse withObject(CreatePlaylistResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * returns all playlists + */ + public CreatePlaylistResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePlaylistResponse other = (CreatePlaylistResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(CreatePlaylistResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * returns all playlists + */ + public Builder object(CreatePlaylistResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * returns all playlists + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public CreatePlaylistResponse build() { + + return new CreatePlaylistResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryRequestBuilder.java new file mode 100644 index 00000000..6c17a75f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.DeleteLibraryRequest; +import dev.plexapi.sdk.operations.DeleteLibrary; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Integer; +import java.util.concurrent.CompletableFuture; + +public class DeleteLibraryRequestBuilder { + + private Integer sectionKey; + private final SDKConfiguration sdkConfiguration; + + public DeleteLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public DeleteLibraryRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + + private DeleteLibraryRequest buildRequest() { + + DeleteLibraryRequest request = new DeleteLibraryRequest(sectionKey); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new DeleteLibrary.Async(sdkConfiguration); + DeleteLibraryRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryResponse.java new file mode 100644 index 00000000..d1150189 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/DeleteLibraryResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class DeleteLibraryResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public DeleteLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public DeleteLibraryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeleteLibraryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeleteLibraryResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteLibraryResponse other = (DeleteLibraryResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeleteLibraryResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeleteLibraryResponse build() { + + return new DeleteLibraryResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistRequestBuilder.java new file mode 100644 index 00000000..426dbcca --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.DeletePlaylistRequest; +import dev.plexapi.sdk.operations.DeletePlaylist; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class DeletePlaylistRequestBuilder { + + private Double playlistID; + private final SDKConfiguration sdkConfiguration; + + public DeletePlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public DeletePlaylistRequestBuilder playlistID(double playlistID) { + Utils.checkNotNull(playlistID, "playlistID"); + this.playlistID = playlistID; + return this; + } + + + private DeletePlaylistRequest buildRequest() { + + DeletePlaylistRequest request = new DeletePlaylistRequest(playlistID); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new DeletePlaylist.Async(sdkConfiguration); + DeletePlaylistRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistResponse.java new file mode 100644 index 00000000..9f6a4ae1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/DeletePlaylistResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class DeletePlaylistResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public DeletePlaylistResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public DeletePlaylistResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public DeletePlaylistResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public DeletePlaylistResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletePlaylistResponse other = (DeletePlaylistResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(DeletePlaylistResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public DeletePlaylistResponse build() { + + return new DeletePlaylistResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailRequestBuilder.java new file mode 100644 index 00000000..2dc0516b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.EnablePaperTrail; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class EnablePaperTrailRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public EnablePaperTrailRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new EnablePaperTrail.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailResponse.java new file mode 100644 index 00000000..b2115a6f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/EnablePaperTrailResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class EnablePaperTrailResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public EnablePaperTrailResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public EnablePaperTrailResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public EnablePaperTrailResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public EnablePaperTrailResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnablePaperTrailResponse other = (EnablePaperTrailResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(EnablePaperTrailResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public EnablePaperTrailResponse build() { + + return new EnablePaperTrailResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryRequestBuilder.java new file mode 100644 index 00000000..b282df53 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryRequestBuilder.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetActorsLibraryQueryParamType; +import dev.plexapi.sdk.models.operations.GetActorsLibraryRequest; +import dev.plexapi.sdk.operations.GetActorsLibrary; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Integer; +import java.util.concurrent.CompletableFuture; + +public class GetActorsLibraryRequestBuilder { + + private Integer sectionKey; + private GetActorsLibraryQueryParamType type; + private final SDKConfiguration sdkConfiguration; + + public GetActorsLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetActorsLibraryRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + public GetActorsLibraryRequestBuilder type(GetActorsLibraryQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + + private GetActorsLibraryRequest buildRequest() { + + GetActorsLibraryRequest request = new GetActorsLibraryRequest(sectionKey, + type); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetActorsLibrary.Async(sdkConfiguration); + GetActorsLibraryRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryResponse.java new file mode 100644 index 00000000..4d97222f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetActorsLibraryResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetActorsLibraryResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetActorsLibraryResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response containing media container data. + */ + private Optional object; + + @JsonCreator + public GetActorsLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetActorsLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response containing media container data. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetActorsLibraryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetActorsLibraryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetActorsLibraryResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response containing media container data. + */ + public GetActorsLibraryResponse withObject(GetActorsLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Successful response containing media container data. + */ + public GetActorsLibraryResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetActorsLibraryResponse other = (GetActorsLibraryResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetActorsLibraryResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response containing media container data. + */ + public Builder object(GetActorsLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Successful response containing media container data. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetActorsLibraryResponse build() { + + return new GetActorsLibraryResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesRequestBuilder.java new file mode 100644 index 00000000..838957f8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetAllLibraries; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetAllLibrariesRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetAllLibrariesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetAllLibraries.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesResponse.java new file mode 100644 index 00000000..94aa931f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetAllLibrariesResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetAllLibrariesResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAllLibrariesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The libraries available on the Server + */ + private Optional object; + + @JsonCreator + public GetAllLibrariesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetAllLibrariesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The libraries available on the Server + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetAllLibrariesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAllLibrariesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAllLibrariesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The libraries available on the Server + */ + public GetAllLibrariesResponse withObject(GetAllLibrariesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The libraries available on the Server + */ + public GetAllLibrariesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllLibrariesResponse other = (GetAllLibrariesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetAllLibrariesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The libraries available on the Server + */ + public Builder object(GetAllLibrariesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The libraries available on the Server + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetAllLibrariesResponse build() { + + return new GetAllLibrariesResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsRequestBuilder.java new file mode 100644 index 00000000..16bd4e47 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetAvailableClients; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetAvailableClientsRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetAvailableClientsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetAvailableClients.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsResponse.java new file mode 100644 index 00000000..e76edee3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetAvailableClientsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetAvailableClientsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetAvailableClientsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Available Clients + */ + private Optional object; + + @JsonCreator + public GetAvailableClientsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetAvailableClientsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Available Clients + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetAvailableClientsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetAvailableClientsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetAvailableClientsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Available Clients + */ + public GetAvailableClientsResponse withObject(GetAvailableClientsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Available Clients + */ + public GetAvailableClientsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAvailableClientsResponse other = (GetAvailableClientsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetAvailableClientsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Available Clients + */ + public Builder object(GetAvailableClientsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Available Clients + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetAvailableClientsResponse build() { + + return new GetAvailableClientsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsRequestBuilder.java new file mode 100644 index 00000000..13284e65 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsRequest; +import dev.plexapi.sdk.operations.GetBandwidthStatistics; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetBandwidthStatisticsRequestBuilder { + + private Optional timespan = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetBandwidthStatisticsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetBandwidthStatisticsRequestBuilder timespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.of(timespan); + return this; + } + + public GetBandwidthStatisticsRequestBuilder timespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + + private GetBandwidthStatisticsRequest buildRequest() { + + GetBandwidthStatisticsRequest request = new GetBandwidthStatisticsRequest(timespan); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetBandwidthStatistics.Async(sdkConfiguration); + GetBandwidthStatisticsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsResponse.java new file mode 100644 index 00000000..8c52f311 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetBandwidthStatisticsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetBandwidthStatisticsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Bandwidth Statistics + */ + private Optional object; + + @JsonCreator + public GetBandwidthStatisticsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetBandwidthStatisticsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Bandwidth Statistics + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetBandwidthStatisticsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetBandwidthStatisticsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBandwidthStatisticsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Bandwidth Statistics + */ + public GetBandwidthStatisticsResponse withObject(GetBandwidthStatisticsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Bandwidth Statistics + */ + public GetBandwidthStatisticsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBandwidthStatisticsResponse other = (GetBandwidthStatisticsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetBandwidthStatisticsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Bandwidth Statistics + */ + public Builder object(GetBandwidthStatisticsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Bandwidth Statistics + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetBandwidthStatisticsResponse build() { + + return new GetBandwidthStatisticsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageRequestBuilder.java new file mode 100644 index 00000000..1b1e099f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetBannerImageRequest; +import dev.plexapi.sdk.operations.GetBannerImage; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetBannerImageRequestBuilder { + + private GetBannerImageRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetBannerImageRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetBannerImageRequestBuilder request(GetBannerImageRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetBannerImage.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageResponse.java new file mode 100644 index 00000000..30a258c8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetBannerImageResponse.java @@ -0,0 +1,284 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Map; +import java.util.Optional; + + +public class GetBannerImageResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response returning an image + */ + private Optional responseStream; + + + private Map> headers; + + @JsonCreator + public GetBannerImageResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional responseStream, + Map> headers) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(responseStream, "responseStream"); + headers = Utils.emptyMapIfNull(headers); + Utils.checkNotNull(headers, "headers"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.responseStream = responseStream; + this.headers = headers; + } + + public GetBannerImageResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Map> headers) { + this(contentType, statusCode, rawResponse, + Optional.empty(), headers); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response returning an image + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional responseStream() { + return (Optional) responseStream; + } + + @JsonIgnore + public Map> headers() { + return headers; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetBannerImageResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetBannerImageResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetBannerImageResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response returning an image + */ + public GetBannerImageResponse withResponseStream(Blob responseStream) { + Utils.checkNotNull(responseStream, "responseStream"); + this.responseStream = Optional.ofNullable(responseStream); + return this; + } + + + /** + * Successful response returning an image + */ + public GetBannerImageResponse withResponseStream(Optional responseStream) { + Utils.checkNotNull(responseStream, "responseStream"); + this.responseStream = responseStream; + return this; + } + + public GetBannerImageResponse withHeaders(Map> headers) { + Utils.checkNotNull(headers, "headers"); + this.headers = headers; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetBannerImageResponse other = (GetBannerImageResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.responseStream, other.responseStream) && + Utils.enhancedDeepEquals(this.headers, other.headers); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + responseStream, headers); + } + + @Override + public String toString() { + return Utils.toString(GetBannerImageResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "responseStream", responseStream, + "headers", headers); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional responseStream = Optional.empty(); + + private Map> headers; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response returning an image + */ + public Builder responseStream(Blob responseStream) { + Utils.checkNotNull(responseStream, "responseStream"); + this.responseStream = Optional.ofNullable(responseStream); + return this; + } + + /** + * Successful response returning an image + */ + public Builder responseStream(Optional responseStream) { + Utils.checkNotNull(responseStream, "responseStream"); + this.responseStream = responseStream; + return this; + } + + + public Builder headers(Map> headers) { + Utils.checkNotNull(headers, "headers"); + this.headers = headers; + return this; + } + + public GetBannerImageResponse build() { + + return new GetBannerImageResponse( + contentType, statusCode, rawResponse, + responseStream, headers); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksRequestBuilder.java new file mode 100644 index 00000000..620e2698 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetButlerTasks; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetButlerTasksRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetButlerTasksRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetButlerTasks.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksResponse.java new file mode 100644 index 00000000..4be9b109 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetButlerTasksResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetButlerTasksResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetButlerTasksResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * All butler tasks + */ + private Optional object; + + @JsonCreator + public GetButlerTasksResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetButlerTasksResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * All butler tasks + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetButlerTasksResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetButlerTasksResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetButlerTasksResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * All butler tasks + */ + public GetButlerTasksResponse withObject(GetButlerTasksResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * All butler tasks + */ + public GetButlerTasksResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetButlerTasksResponse other = (GetButlerTasksResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetButlerTasksResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * All butler tasks + */ + public Builder object(GetButlerTasksResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * All butler tasks + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetButlerTasksResponse build() { + + return new GetButlerTasksResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataRequestBuilder.java new file mode 100644 index 00000000..df44755e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataRequestBuilder.java @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetCompanionsData; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetCompanionsDataRequestBuilder { + + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetCompanionsDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetCompanionsDataRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetCompanionsDataRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetCompanionsData.Async(sdkConfiguration, serverURL); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataResponse.java new file mode 100644 index 00000000..6d561a87 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetCompanionsDataResponse.java @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.ResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + + +public class GetCompanionsDataResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Companions Data + */ + private Optional> responseBodies; + + @JsonCreator + public GetCompanionsDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> responseBodies) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(responseBodies, "responseBodies"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.responseBodies = responseBodies; + } + + public GetCompanionsDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Companions Data + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> responseBodies() { + return (Optional>) responseBodies; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetCompanionsDataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCompanionsDataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCompanionsDataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Companions Data + */ + public GetCompanionsDataResponse withResponseBodies(List responseBodies) { + Utils.checkNotNull(responseBodies, "responseBodies"); + this.responseBodies = Optional.ofNullable(responseBodies); + return this; + } + + + /** + * Companions Data + */ + public GetCompanionsDataResponse withResponseBodies(Optional> responseBodies) { + Utils.checkNotNull(responseBodies, "responseBodies"); + this.responseBodies = responseBodies; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCompanionsDataResponse other = (GetCompanionsDataResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.responseBodies, other.responseBodies); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + responseBodies); + } + + @Override + public String toString() { + return Utils.toString(GetCompanionsDataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "responseBodies", responseBodies); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> responseBodies = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Companions Data + */ + public Builder responseBodies(List responseBodies) { + Utils.checkNotNull(responseBodies, "responseBodies"); + this.responseBodies = Optional.ofNullable(responseBodies); + return this; + } + + /** + * Companions Data + */ + public Builder responseBodies(Optional> responseBodies) { + Utils.checkNotNull(responseBodies, "responseBodies"); + this.responseBodies = responseBodies; + return this; + } + + public GetCompanionsDataResponse build() { + + return new GetCompanionsDataResponse( + contentType, statusCode, rawResponse, + responseBodies); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryRequestBuilder.java new file mode 100644 index 00000000..144a0968 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryRequestBuilder.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetCountriesLibraryQueryParamType; +import dev.plexapi.sdk.models.operations.GetCountriesLibraryRequest; +import dev.plexapi.sdk.operations.GetCountriesLibrary; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Integer; +import java.util.concurrent.CompletableFuture; + +public class GetCountriesLibraryRequestBuilder { + + private Integer sectionKey; + private GetCountriesLibraryQueryParamType type; + private final SDKConfiguration sdkConfiguration; + + public GetCountriesLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetCountriesLibraryRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + public GetCountriesLibraryRequestBuilder type(GetCountriesLibraryQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + + private GetCountriesLibraryRequest buildRequest() { + + GetCountriesLibraryRequest request = new GetCountriesLibraryRequest(sectionKey, + type); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetCountriesLibrary.Async(sdkConfiguration); + GetCountriesLibraryRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryResponse.java new file mode 100644 index 00000000..de8e099d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetCountriesLibraryResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetCountriesLibraryResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetCountriesLibraryResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response containing media container data. + */ + private Optional object; + + @JsonCreator + public GetCountriesLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetCountriesLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response containing media container data. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetCountriesLibraryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetCountriesLibraryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetCountriesLibraryResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response containing media container data. + */ + public GetCountriesLibraryResponse withObject(GetCountriesLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Successful response containing media container data. + */ + public GetCountriesLibraryResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCountriesLibraryResponse other = (GetCountriesLibraryResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetCountriesLibraryResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response containing media container data. + */ + public Builder object(GetCountriesLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Successful response containing media container data. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetCountriesLibraryResponse build() { + + return new GetCountriesLibraryResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesRequestBuilder.java new file mode 100644 index 00000000..d1bded44 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetDevices; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetDevicesRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetDevicesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetDevices.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesResponse.java new file mode 100644 index 00000000..eb3b38b5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetDevicesResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetDevicesResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetDevicesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Devices + */ + private Optional object; + + @JsonCreator + public GetDevicesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetDevicesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Devices + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetDevicesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetDevicesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetDevicesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Devices + */ + public GetDevicesResponse withObject(GetDevicesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Devices + */ + public GetDevicesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetDevicesResponse other = (GetDevicesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetDevicesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Devices + */ + public Builder object(GetDevicesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Devices + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetDevicesResponse build() { + + return new GetDevicesResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashRequestBuilder.java new file mode 100644 index 00000000..e0c50cd9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashRequestBuilder.java @@ -0,0 +1,64 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetFileHashRequest; +import dev.plexapi.sdk.operations.GetFileHash; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetFileHashRequestBuilder { + + private String url; + private Optional type = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetFileHashRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetFileHashRequestBuilder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + public GetFileHashRequestBuilder type(double type) { + Utils.checkNotNull(type, "type"); + this.type = Optional.of(type); + return this; + } + + public GetFileHashRequestBuilder type(Optional type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + + private GetFileHashRequest buildRequest() { + + GetFileHashRequest request = new GetFileHashRequest(url, + type); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetFileHash.Async(sdkConfiguration); + GetFileHashRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashResponse.java new file mode 100644 index 00000000..20c493a9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetFileHashResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class GetFileHashResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetFileHashResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetFileHashResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetFileHashResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetFileHashResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetFileHashResponse other = (GetFileHashResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetFileHashResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetFileHashResponse build() { + + return new GetFileHashResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryRequestBuilder.java new file mode 100644 index 00000000..ded1c3bd --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryRequestBuilder.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetGenresLibraryQueryParamType; +import dev.plexapi.sdk.models.operations.GetGenresLibraryRequest; +import dev.plexapi.sdk.operations.GetGenresLibrary; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Integer; +import java.util.concurrent.CompletableFuture; + +public class GetGenresLibraryRequestBuilder { + + private Integer sectionKey; + private GetGenresLibraryQueryParamType type; + private final SDKConfiguration sdkConfiguration; + + public GetGenresLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetGenresLibraryRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + public GetGenresLibraryRequestBuilder type(GetGenresLibraryQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + + private GetGenresLibraryRequest buildRequest() { + + GetGenresLibraryRequest request = new GetGenresLibraryRequest(sectionKey, + type); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetGenresLibrary.Async(sdkConfiguration); + GetGenresLibraryRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryResponse.java new file mode 100644 index 00000000..f7c38fd6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGenresLibraryResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetGenresLibraryResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetGenresLibraryResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response containing media container data. + */ + private Optional object; + + @JsonCreator + public GetGenresLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetGenresLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response containing media container data. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetGenresLibraryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetGenresLibraryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGenresLibraryResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response containing media container data. + */ + public GetGenresLibraryResponse withObject(GetGenresLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Successful response containing media container data. + */ + public GetGenresLibraryResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGenresLibraryResponse other = (GetGenresLibraryResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetGenresLibraryResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response containing media container data. + */ + public Builder object(GetGenresLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Successful response containing media container data. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetGenresLibraryResponse build() { + + return new GetGenresLibraryResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataRequestBuilder.java new file mode 100644 index 00000000..b13719d4 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataRequestBuilder.java @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetGeoData; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetGeoDataRequestBuilder { + + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetGeoDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetGeoDataRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetGeoDataRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetGeoData.Async(sdkConfiguration, serverURL); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataResponse.java new file mode 100644 index 00000000..66c40c43 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGeoDataResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetGeoDataGeoData; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetGeoDataResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Gets the geo location data of the user + */ + private Optional geoData; + + @JsonCreator + public GetGeoDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional geoData) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(geoData, "geoData"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.geoData = geoData; + } + + public GetGeoDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Gets the geo location data of the user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional geoData() { + return (Optional) geoData; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetGeoDataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetGeoDataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGeoDataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Gets the geo location data of the user + */ + public GetGeoDataResponse withGeoData(GetGeoDataGeoData geoData) { + Utils.checkNotNull(geoData, "geoData"); + this.geoData = Optional.ofNullable(geoData); + return this; + } + + + /** + * Gets the geo location data of the user + */ + public GetGeoDataResponse withGeoData(Optional geoData) { + Utils.checkNotNull(geoData, "geoData"); + this.geoData = geoData; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGeoDataResponse other = (GetGeoDataResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.geoData, other.geoData); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + geoData); + } + + @Override + public String toString() { + return Utils.toString(GetGeoDataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "geoData", geoData); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional geoData = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Gets the geo location data of the user + */ + public Builder geoData(GetGeoDataGeoData geoData) { + Utils.checkNotNull(geoData, "geoData"); + this.geoData = Optional.ofNullable(geoData); + return this; + } + + /** + * Gets the geo location data of the user + */ + public Builder geoData(Optional geoData) { + Utils.checkNotNull(geoData, "geoData"); + this.geoData = geoData; + return this; + } + + public GetGeoDataResponse build() { + + return new GetGeoDataResponse( + contentType, statusCode, rawResponse, + geoData); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsRequestBuilder.java new file mode 100644 index 00000000..e4da8052 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsRequestBuilder.java @@ -0,0 +1,70 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetGlobalHubsRequest; +import dev.plexapi.sdk.models.operations.OnlyTransient; +import dev.plexapi.sdk.operations.GetGlobalHubs; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetGlobalHubsRequestBuilder { + + private Optional count = Optional.empty(); + private Optional onlyTransient = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetGlobalHubsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetGlobalHubsRequestBuilder count(double count) { + Utils.checkNotNull(count, "count"); + this.count = Optional.of(count); + return this; + } + + public GetGlobalHubsRequestBuilder count(Optional count) { + Utils.checkNotNull(count, "count"); + this.count = count; + return this; + } + + public GetGlobalHubsRequestBuilder onlyTransient(OnlyTransient onlyTransient) { + Utils.checkNotNull(onlyTransient, "onlyTransient"); + this.onlyTransient = Optional.of(onlyTransient); + return this; + } + + public GetGlobalHubsRequestBuilder onlyTransient(Optional onlyTransient) { + Utils.checkNotNull(onlyTransient, "onlyTransient"); + this.onlyTransient = onlyTransient; + return this; + } + + + private GetGlobalHubsRequest buildRequest() { + + GetGlobalHubsRequest request = new GetGlobalHubsRequest(count, + onlyTransient); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetGlobalHubs.Async(sdkConfiguration); + GetGlobalHubsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsResponse.java new file mode 100644 index 00000000..bc71f70a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetGlobalHubsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetGlobalHubsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetGlobalHubsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * returns global hubs + */ + private Optional object; + + @JsonCreator + public GetGlobalHubsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetGlobalHubsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * returns global hubs + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetGlobalHubsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetGlobalHubsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetGlobalHubsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * returns global hubs + */ + public GetGlobalHubsResponse withObject(GetGlobalHubsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * returns global hubs + */ + public GetGlobalHubsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetGlobalHubsResponse other = (GetGlobalHubsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetGlobalHubsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * returns global hubs + */ + public Builder object(GetGlobalHubsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * returns global hubs + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetGlobalHubsResponse build() { + + return new GetGlobalHubsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataRequestBuilder.java new file mode 100644 index 00000000..7f37f495 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetHomeData; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetHomeDataRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetHomeDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetHomeData.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataResponse.java new file mode 100644 index 00000000..353ff02f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetHomeDataResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetHomeDataResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetHomeDataResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Home Data + */ + private Optional object; + + @JsonCreator + public GetHomeDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetHomeDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Home Data + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetHomeDataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetHomeDataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetHomeDataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Home Data + */ + public GetHomeDataResponse withObject(GetHomeDataResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Home Data + */ + public GetHomeDataResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetHomeDataResponse other = (GetHomeDataResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetHomeDataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Home Data + */ + public Builder object(GetHomeDataResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Home Data + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetHomeDataResponse build() { + + return new GetHomeDataResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsRequestBuilder.java new file mode 100644 index 00000000..43424913 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsRequestBuilder.java @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetLibraryDetailsRequest; +import dev.plexapi.sdk.models.operations.IncludeDetails; +import dev.plexapi.sdk.operations.GetLibraryDetails; +import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Integer; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetLibraryDetailsRequestBuilder { + + private Optional includeDetails = Utils.readDefaultOrConstValue( + "includeDetails", + "0", + new TypeReference>() {}); + private Integer sectionKey; + private final SDKConfiguration sdkConfiguration; + + public GetLibraryDetailsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetLibraryDetailsRequestBuilder includeDetails(IncludeDetails includeDetails) { + Utils.checkNotNull(includeDetails, "includeDetails"); + this.includeDetails = Optional.of(includeDetails); + return this; + } + + public GetLibraryDetailsRequestBuilder includeDetails(Optional includeDetails) { + Utils.checkNotNull(includeDetails, "includeDetails"); + this.includeDetails = includeDetails; + return this; + } + + public GetLibraryDetailsRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + + private GetLibraryDetailsRequest buildRequest() { + if (includeDetails == null) { + includeDetails = _SINGLETON_VALUE_IncludeDetails.value(); + } + + GetLibraryDetailsRequest request = new GetLibraryDetailsRequest(includeDetails, + sectionKey); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetLibraryDetails.Async(sdkConfiguration); + GetLibraryDetailsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeDetails = + new LazySingletonValue<>( + "includeDetails", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsResponse.java new file mode 100644 index 00000000..a86fc83a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryDetailsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetLibraryDetailsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The details of the library + */ + private Optional object; + + @JsonCreator + public GetLibraryDetailsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetLibraryDetailsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The details of the library + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetLibraryDetailsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetLibraryDetailsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryDetailsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The details of the library + */ + public GetLibraryDetailsResponse withObject(GetLibraryDetailsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The details of the library + */ + public GetLibraryDetailsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryDetailsResponse other = (GetLibraryDetailsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryDetailsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The details of the library + */ + public Builder object(GetLibraryDetailsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The details of the library + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetLibraryDetailsResponse build() { + + return new GetLibraryDetailsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsRequestBuilder.java new file mode 100644 index 00000000..cf140724 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsRequestBuilder.java @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetLibraryHubsRequest; +import dev.plexapi.sdk.models.operations.QueryParamOnlyTransient; +import dev.plexapi.sdk.operations.GetLibraryHubs; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetLibraryHubsRequestBuilder { + + private Double sectionId; + private Optional count = Optional.empty(); + private Optional onlyTransient = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetLibraryHubsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetLibraryHubsRequestBuilder sectionId(double sectionId) { + Utils.checkNotNull(sectionId, "sectionId"); + this.sectionId = sectionId; + return this; + } + + public GetLibraryHubsRequestBuilder count(double count) { + Utils.checkNotNull(count, "count"); + this.count = Optional.of(count); + return this; + } + + public GetLibraryHubsRequestBuilder count(Optional count) { + Utils.checkNotNull(count, "count"); + this.count = count; + return this; + } + + public GetLibraryHubsRequestBuilder onlyTransient(QueryParamOnlyTransient onlyTransient) { + Utils.checkNotNull(onlyTransient, "onlyTransient"); + this.onlyTransient = Optional.of(onlyTransient); + return this; + } + + public GetLibraryHubsRequestBuilder onlyTransient(Optional onlyTransient) { + Utils.checkNotNull(onlyTransient, "onlyTransient"); + this.onlyTransient = onlyTransient; + return this; + } + + + private GetLibraryHubsRequest buildRequest() { + + GetLibraryHubsRequest request = new GetLibraryHubsRequest(sectionId, + count, + onlyTransient); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetLibraryHubs.Async(sdkConfiguration); + GetLibraryHubsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsResponse.java new file mode 100644 index 00000000..87c03dd9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryHubsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetLibraryHubsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetLibraryHubsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The hubs specific to the library + */ + private Optional object; + + @JsonCreator + public GetLibraryHubsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetLibraryHubsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The hubs specific to the library + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetLibraryHubsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetLibraryHubsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryHubsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The hubs specific to the library + */ + public GetLibraryHubsResponse withObject(GetLibraryHubsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The hubs specific to the library + */ + public GetLibraryHubsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryHubsResponse other = (GetLibraryHubsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryHubsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The hubs specific to the library + */ + public Builder object(GetLibraryHubsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The hubs specific to the library + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetLibraryHubsResponse build() { + + return new GetLibraryHubsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsRequestBuilder.java new file mode 100644 index 00000000..71c1484d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest; +import dev.plexapi.sdk.operations.GetLibraryItems; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetLibraryItemsRequestBuilder { + + private GetLibraryItemsRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetLibraryItemsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetLibraryItemsRequestBuilder request(GetLibraryItemsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetLibraryItems.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsResponse.java new file mode 100644 index 00000000..f8ae6609 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibraryItemsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetLibraryItemsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetLibraryItemsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The contents of the library by section and tag + */ + private Optional object; + + @JsonCreator + public GetLibraryItemsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetLibraryItemsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The contents of the library by section and tag + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetLibraryItemsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetLibraryItemsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibraryItemsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The contents of the library by section and tag + */ + public GetLibraryItemsResponse withObject(GetLibraryItemsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The contents of the library by section and tag + */ + public GetLibraryItemsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibraryItemsResponse other = (GetLibraryItemsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetLibraryItemsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The contents of the library by section and tag + */ + public Builder object(GetLibraryItemsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The contents of the library by section and tag + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetLibraryItemsResponse build() { + + return new GetLibraryItemsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllRequestBuilder.java new file mode 100644 index 00000000..c0e46bb4 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllRequest; +import dev.plexapi.sdk.operations.GetLibrarySectionsAll; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetLibrarySectionsAllRequestBuilder { + + private GetLibrarySectionsAllRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetLibrarySectionsAllRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetLibrarySectionsAllRequestBuilder request(GetLibrarySectionsAllRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetLibrarySectionsAll.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllResponse.java new file mode 100644 index 00000000..f7d84754 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetLibrarySectionsAllResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetLibrarySectionsAllResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response containing media container data. + */ + private Optional object; + + @JsonCreator + public GetLibrarySectionsAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetLibrarySectionsAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response containing media container data. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetLibrarySectionsAllResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetLibrarySectionsAllResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetLibrarySectionsAllResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response containing media container data. + */ + public GetLibrarySectionsAllResponse withObject(GetLibrarySectionsAllResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Successful response containing media container data. + */ + public GetLibrarySectionsAllResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetLibrarySectionsAllResponse other = (GetLibrarySectionsAllResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetLibrarySectionsAllResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response containing media container data. + */ + public Builder object(GetLibrarySectionsAllResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Successful response containing media container data. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetLibrarySectionsAllResponse build() { + + return new GetLibrarySectionsAllResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsRequestBuilder.java new file mode 100644 index 00000000..07e5e1fd --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetMediaArtsRequest; +import dev.plexapi.sdk.operations.GetMediaArts; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.util.concurrent.CompletableFuture; + +public class GetMediaArtsRequestBuilder { + + private Long ratingKey; + private final SDKConfiguration sdkConfiguration; + + public GetMediaArtsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetMediaArtsRequestBuilder ratingKey(long ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + + private GetMediaArtsRequest buildRequest() { + + GetMediaArtsRequest request = new GetMediaArtsRequest(ratingKey); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetMediaArts.Async(sdkConfiguration); + GetMediaArtsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsResponse.java new file mode 100644 index 00000000..147542ea --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaArtsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetMediaArtsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetMediaArtsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The available background artwork for the library item. + */ + private Optional object; + + @JsonCreator + public GetMediaArtsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetMediaArtsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The available background artwork for the library item. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetMediaArtsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetMediaArtsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaArtsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The available background artwork for the library item. + */ + public GetMediaArtsResponse withObject(GetMediaArtsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The available background artwork for the library item. + */ + public GetMediaArtsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMediaArtsResponse other = (GetMediaArtsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetMediaArtsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The available background artwork for the library item. + */ + public Builder object(GetMediaArtsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The available background artwork for the library item. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetMediaArtsResponse build() { + + return new GetMediaArtsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataRequestBuilder.java new file mode 100644 index 00000000..9c954b60 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequest; +import dev.plexapi.sdk.operations.GetMediaMetaData; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetMediaMetaDataRequestBuilder { + + private GetMediaMetaDataRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetMediaMetaDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetMediaMetaDataRequestBuilder request(GetMediaMetaDataRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetMediaMetaData.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataResponse.java new file mode 100644 index 00000000..7110be59 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaMetaDataResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetMediaMetaDataResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The metadata of the library item. + */ + private Optional object; + + @JsonCreator + public GetMediaMetaDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetMediaMetaDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The metadata of the library item. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetMediaMetaDataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetMediaMetaDataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaMetaDataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The metadata of the library item. + */ + public GetMediaMetaDataResponse withObject(GetMediaMetaDataResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The metadata of the library item. + */ + public GetMediaMetaDataResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMediaMetaDataResponse other = (GetMediaMetaDataResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetMediaMetaDataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The metadata of the library item. + */ + public Builder object(GetMediaMetaDataResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The metadata of the library item. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetMediaMetaDataResponse build() { + + return new GetMediaMetaDataResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersRequestBuilder.java new file mode 100644 index 00000000..d1b9fb28 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetMediaPostersRequest; +import dev.plexapi.sdk.operations.GetMediaPosters; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.util.concurrent.CompletableFuture; + +public class GetMediaPostersRequestBuilder { + + private Long ratingKey; + private final SDKConfiguration sdkConfiguration; + + public GetMediaPostersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetMediaPostersRequestBuilder ratingKey(long ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + + private GetMediaPostersRequest buildRequest() { + + GetMediaPostersRequest request = new GetMediaPostersRequest(ratingKey); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetMediaPosters.Async(sdkConfiguration); + GetMediaPostersRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersResponse.java new file mode 100644 index 00000000..eb40df52 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaPostersResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetMediaPostersResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetMediaPostersResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The available posters for the library item. + */ + private Optional object; + + @JsonCreator + public GetMediaPostersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetMediaPostersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The available posters for the library item. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetMediaPostersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetMediaPostersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaPostersResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The available posters for the library item. + */ + public GetMediaPostersResponse withObject(GetMediaPostersResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The available posters for the library item. + */ + public GetMediaPostersResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMediaPostersResponse other = (GetMediaPostersResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetMediaPostersResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The available posters for the library item. + */ + public Builder object(GetMediaPostersResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The available posters for the library item. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetMediaPostersResponse build() { + + return new GetMediaPostersResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersRequestBuilder.java new file mode 100644 index 00000000..805f5c56 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetMediaProvidersRequest; +import dev.plexapi.sdk.operations.GetMediaProviders; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class GetMediaProvidersRequestBuilder { + + private String xPlexToken; + private final SDKConfiguration sdkConfiguration; + + public GetMediaProvidersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetMediaProvidersRequestBuilder xPlexToken(String xPlexToken) { + Utils.checkNotNull(xPlexToken, "xPlexToken"); + this.xPlexToken = xPlexToken; + return this; + } + + + private GetMediaProvidersRequest buildRequest() { + + GetMediaProvidersRequest request = new GetMediaProvidersRequest(xPlexToken); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetMediaProviders.Async(sdkConfiguration); + GetMediaProvidersRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersResponse.java new file mode 100644 index 00000000..f1c35624 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMediaProvidersResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetMediaProvidersResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetMediaProvidersResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Media providers and their features + */ + private Optional object; + + @JsonCreator + public GetMediaProvidersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetMediaProvidersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Media providers and their features + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetMediaProvidersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetMediaProvidersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMediaProvidersResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Media providers and their features + */ + public GetMediaProvidersResponse withObject(GetMediaProvidersResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Media providers and their features + */ + public GetMediaProvidersResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMediaProvidersResponse other = (GetMediaProvidersResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetMediaProvidersResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Media providers and their features + */ + public Builder object(GetMediaProvidersResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Media providers and their features + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetMediaProvidersResponse build() { + + return new GetMediaProvidersResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenRequestBuilder.java new file mode 100644 index 00000000..aad86594 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenRequestBuilder.java @@ -0,0 +1,64 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequest; +import dev.plexapi.sdk.operations.GetMetadataChildren; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetMetadataChildrenRequestBuilder { + + private Double ratingKey; + private Optional includeElements = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetMetadataChildrenRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetMetadataChildrenRequestBuilder ratingKey(double ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public GetMetadataChildrenRequestBuilder includeElements(String includeElements) { + Utils.checkNotNull(includeElements, "includeElements"); + this.includeElements = Optional.of(includeElements); + return this; + } + + public GetMetadataChildrenRequestBuilder includeElements(Optional includeElements) { + Utils.checkNotNull(includeElements, "includeElements"); + this.includeElements = includeElements; + return this; + } + + + private GetMetadataChildrenRequest buildRequest() { + + GetMetadataChildrenRequest request = new GetMetadataChildrenRequest(ratingKey, + includeElements); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetMetadataChildren.Async(sdkConfiguration); + GetMetadataChildrenRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenResponse.java new file mode 100644 index 00000000..2ba5650b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMetadataChildrenResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetMetadataChildrenResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The children of the library item. + */ + private Optional object; + + @JsonCreator + public GetMetadataChildrenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetMetadataChildrenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The children of the library item. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetMetadataChildrenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetMetadataChildrenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMetadataChildrenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The children of the library item. + */ + public GetMetadataChildrenResponse withObject(GetMetadataChildrenResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The children of the library item. + */ + public GetMetadataChildrenResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMetadataChildrenResponse other = (GetMetadataChildrenResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetMetadataChildrenResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The children of the library item. + */ + public Builder object(GetMetadataChildrenResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The children of the library item. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetMetadataChildrenResponse build() { + + return new GetMetadataChildrenResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountRequestBuilder.java new file mode 100644 index 00000000..558f4fa5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetMyPlexAccount; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetMyPlexAccountRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetMyPlexAccountRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetMyPlexAccount.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountResponse.java new file mode 100644 index 00000000..f40992b9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetMyPlexAccountResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetMyPlexAccountResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetMyPlexAccountResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * MyPlex Account + */ + private Optional object; + + @JsonCreator + public GetMyPlexAccountResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetMyPlexAccountResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * MyPlex Account + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetMyPlexAccountResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetMyPlexAccountResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetMyPlexAccountResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * MyPlex Account + */ + public GetMyPlexAccountResponse withObject(GetMyPlexAccountResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * MyPlex Account + */ + public GetMyPlexAccountResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetMyPlexAccountResponse other = (GetMyPlexAccountResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetMyPlexAccountResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * MyPlex Account + */ + public Builder object(GetMyPlexAccountResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * MyPlex Account + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetMyPlexAccountResponse build() { + + return new GetMyPlexAccountResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetPinRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPinRequestBuilder.java new file mode 100644 index 00000000..a7cbd095 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPinRequestBuilder.java @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetPinRequest; +import dev.plexapi.sdk.operations.GetPin; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetPinRequestBuilder { + + private GetPinRequest request; + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetPinRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetPinRequestBuilder request(GetPinRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetPinRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetPinRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetPin.Async(sdkConfiguration, serverURL); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetPinResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPinResponse.java new file mode 100644 index 00000000..e6e6396a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPinResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetPinAuthPinContainer; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetPinResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Requests a new pin id used in the authentication flow + */ + private Optional authPinContainer; + + @JsonCreator + public GetPinResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional authPinContainer) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.authPinContainer = authPinContainer; + } + + public GetPinResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Requests a new pin id used in the authentication flow + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional authPinContainer() { + return (Optional) authPinContainer; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetPinResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetPinResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPinResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Requests a new pin id used in the authentication flow + */ + public GetPinResponse withAuthPinContainer(GetPinAuthPinContainer authPinContainer) { + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.authPinContainer = Optional.ofNullable(authPinContainer); + return this; + } + + + /** + * Requests a new pin id used in the authentication flow + */ + public GetPinResponse withAuthPinContainer(Optional authPinContainer) { + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.authPinContainer = authPinContainer; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPinResponse other = (GetPinResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.authPinContainer, other.authPinContainer); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + authPinContainer); + } + + @Override + public String toString() { + return Utils.toString(GetPinResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "authPinContainer", authPinContainer); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional authPinContainer = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Requests a new pin id used in the authentication flow + */ + public Builder authPinContainer(GetPinAuthPinContainer authPinContainer) { + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.authPinContainer = Optional.ofNullable(authPinContainer); + return this; + } + + /** + * Requests a new pin id used in the authentication flow + */ + public Builder authPinContainer(Optional authPinContainer) { + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.authPinContainer = authPinContainer; + return this; + } + + public GetPinResponse build() { + + return new GetPinResponse( + contentType, statusCode, rawResponse, + authPinContainer); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsRequestBuilder.java new file mode 100644 index 00000000..dcaab695 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsRequestBuilder.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetPlaylistContentsQueryParamType; +import dev.plexapi.sdk.models.operations.GetPlaylistContentsRequest; +import dev.plexapi.sdk.operations.GetPlaylistContents; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetPlaylistContentsRequestBuilder { + + private Double playlistID; + private GetPlaylistContentsQueryParamType type; + private final SDKConfiguration sdkConfiguration; + + public GetPlaylistContentsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetPlaylistContentsRequestBuilder playlistID(double playlistID) { + Utils.checkNotNull(playlistID, "playlistID"); + this.playlistID = playlistID; + return this; + } + + public GetPlaylistContentsRequestBuilder type(GetPlaylistContentsQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + + private GetPlaylistContentsRequest buildRequest() { + + GetPlaylistContentsRequest request = new GetPlaylistContentsRequest(playlistID, + type); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetPlaylistContents.Async(sdkConfiguration); + GetPlaylistContentsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsResponse.java new file mode 100644 index 00000000..561f6833 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistContentsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetPlaylistContentsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetPlaylistContentsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The playlist contents + */ + private Optional object; + + @JsonCreator + public GetPlaylistContentsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetPlaylistContentsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The playlist contents + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetPlaylistContentsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetPlaylistContentsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistContentsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The playlist contents + */ + public GetPlaylistContentsResponse withObject(GetPlaylistContentsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The playlist contents + */ + public GetPlaylistContentsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistContentsResponse other = (GetPlaylistContentsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistContentsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The playlist contents + */ + public Builder object(GetPlaylistContentsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The playlist contents + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetPlaylistContentsResponse build() { + + return new GetPlaylistContentsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistRequestBuilder.java new file mode 100644 index 00000000..93737d7e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetPlaylistRequest; +import dev.plexapi.sdk.operations.GetPlaylist; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetPlaylistRequestBuilder { + + private Double playlistID; + private final SDKConfiguration sdkConfiguration; + + public GetPlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetPlaylistRequestBuilder playlistID(double playlistID) { + Utils.checkNotNull(playlistID, "playlistID"); + this.playlistID = playlistID; + return this; + } + + + private GetPlaylistRequest buildRequest() { + + GetPlaylistRequest request = new GetPlaylistRequest(playlistID); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetPlaylist.Async(sdkConfiguration); + GetPlaylistRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistResponse.java new file mode 100644 index 00000000..3fe4db18 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetPlaylistResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetPlaylistResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The playlist + */ + private Optional object; + + @JsonCreator + public GetPlaylistResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetPlaylistResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The playlist + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetPlaylistResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetPlaylistResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The playlist + */ + public GetPlaylistResponse withObject(GetPlaylistResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The playlist + */ + public GetPlaylistResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistResponse other = (GetPlaylistResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The playlist + */ + public Builder object(GetPlaylistResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The playlist + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetPlaylistResponse build() { + + return new GetPlaylistResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsRequestBuilder.java new file mode 100644 index 00000000..96cc11eb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsRequestBuilder.java @@ -0,0 +1,70 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetPlaylistsRequest; +import dev.plexapi.sdk.models.operations.PlaylistType; +import dev.plexapi.sdk.models.operations.QueryParamSmart; +import dev.plexapi.sdk.operations.GetPlaylists; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetPlaylistsRequestBuilder { + + private Optional playlistType = Optional.empty(); + private Optional smart = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetPlaylistsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetPlaylistsRequestBuilder playlistType(PlaylistType playlistType) { + Utils.checkNotNull(playlistType, "playlistType"); + this.playlistType = Optional.of(playlistType); + return this; + } + + public GetPlaylistsRequestBuilder playlistType(Optional playlistType) { + Utils.checkNotNull(playlistType, "playlistType"); + this.playlistType = playlistType; + return this; + } + + public GetPlaylistsRequestBuilder smart(QueryParamSmart smart) { + Utils.checkNotNull(smart, "smart"); + this.smart = Optional.of(smart); + return this; + } + + public GetPlaylistsRequestBuilder smart(Optional smart) { + Utils.checkNotNull(smart, "smart"); + this.smart = smart; + return this; + } + + + private GetPlaylistsRequest buildRequest() { + + GetPlaylistsRequest request = new GetPlaylistsRequest(playlistType, + smart); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetPlaylists.Async(sdkConfiguration); + GetPlaylistsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsResponse.java new file mode 100644 index 00000000..d06297c2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetPlaylistsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetPlaylistsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetPlaylistsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * returns all playlists + */ + private Optional object; + + @JsonCreator + public GetPlaylistsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetPlaylistsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * returns all playlists + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetPlaylistsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetPlaylistsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetPlaylistsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * returns all playlists + */ + public GetPlaylistsResponse withObject(GetPlaylistsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * returns all playlists + */ + public GetPlaylistsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetPlaylistsResponse other = (GetPlaylistsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetPlaylistsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * returns all playlists + */ + public Builder object(GetPlaylistsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * returns all playlists + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetPlaylistsResponse build() { + + return new GetPlaylistsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryRequestBuilder.java new file mode 100644 index 00000000..a96edd20 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryRequest; +import dev.plexapi.sdk.operations.GetRecentlyAddedLibrary; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetRecentlyAddedLibraryRequestBuilder { + + private GetRecentlyAddedLibraryRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetRecentlyAddedLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetRecentlyAddedLibraryRequestBuilder request(GetRecentlyAddedLibraryRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetRecentlyAddedLibrary.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryResponse.java new file mode 100644 index 00000000..ccf6cd4d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedLibraryResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetRecentlyAddedLibraryResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The recently added content + */ + private Optional object; + + @JsonCreator + public GetRecentlyAddedLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetRecentlyAddedLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The recently added content + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetRecentlyAddedLibraryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetRecentlyAddedLibraryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRecentlyAddedLibraryResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The recently added content + */ + public GetRecentlyAddedLibraryResponse withObject(GetRecentlyAddedLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The recently added content + */ + public GetRecentlyAddedLibraryResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRecentlyAddedLibraryResponse other = (GetRecentlyAddedLibraryResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetRecentlyAddedLibraryResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The recently added content + */ + public Builder object(GetRecentlyAddedLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The recently added content + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetRecentlyAddedLibraryResponse build() { + + return new GetRecentlyAddedLibraryResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedRequestBuilder.java new file mode 100644 index 00000000..f58e406f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedRequest; +import dev.plexapi.sdk.operations.GetRecentlyAdded; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetRecentlyAddedRequestBuilder { + + private GetRecentlyAddedRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetRecentlyAddedRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetRecentlyAddedRequestBuilder request(GetRecentlyAddedRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetRecentlyAdded.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedResponse.java new file mode 100644 index 00000000..0accdab2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRecentlyAddedResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetRecentlyAddedResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * A successful response with recently added content. + */ + private Optional object; + + @JsonCreator + public GetRecentlyAddedResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetRecentlyAddedResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * A successful response with recently added content. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetRecentlyAddedResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetRecentlyAddedResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRecentlyAddedResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * A successful response with recently added content. + */ + public GetRecentlyAddedResponse withObject(GetRecentlyAddedResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * A successful response with recently added content. + */ + public GetRecentlyAddedResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRecentlyAddedResponse other = (GetRecentlyAddedResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetRecentlyAddedResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * A successful response with recently added content. + */ + public Builder object(GetRecentlyAddedResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * A successful response with recently added content. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetRecentlyAddedResponse build() { + + return new GetRecentlyAddedResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataRequestBuilder.java new file mode 100644 index 00000000..70d14560 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataRequestBuilder.java @@ -0,0 +1,64 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.Force; +import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataRequest; +import dev.plexapi.sdk.operations.GetRefreshLibraryMetadata; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Integer; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetRefreshLibraryMetadataRequestBuilder { + + private Optional force = Optional.empty(); + private Integer sectionKey; + private final SDKConfiguration sdkConfiguration; + + public GetRefreshLibraryMetadataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetRefreshLibraryMetadataRequestBuilder force(Force force) { + Utils.checkNotNull(force, "force"); + this.force = Optional.of(force); + return this; + } + + public GetRefreshLibraryMetadataRequestBuilder force(Optional force) { + Utils.checkNotNull(force, "force"); + this.force = force; + return this; + } + + public GetRefreshLibraryMetadataRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + + private GetRefreshLibraryMetadataRequest buildRequest() { + + GetRefreshLibraryMetadataRequest request = new GetRefreshLibraryMetadataRequest(force, + sectionKey); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetRefreshLibraryMetadata.Async(sdkConfiguration); + GetRefreshLibraryMetadataRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataResponse.java new file mode 100644 index 00000000..8732052f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetRefreshLibraryMetadataResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class GetRefreshLibraryMetadataResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetRefreshLibraryMetadataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetRefreshLibraryMetadataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetRefreshLibraryMetadataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetRefreshLibraryMetadataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetRefreshLibraryMetadataResponse other = (GetRefreshLibraryMetadataResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetRefreshLibraryMetadataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetRefreshLibraryMetadataResponse build() { + + return new GetRefreshLibraryMetadataResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoRequestBuilder.java new file mode 100644 index 00000000..10367a8a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetResizedPhotoRequest; +import dev.plexapi.sdk.operations.GetResizedPhoto; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetResizedPhotoRequestBuilder { + + private GetResizedPhotoRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetResizedPhotoRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetResizedPhotoRequestBuilder request(GetResizedPhotoRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetResizedPhoto.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoResponse.java new file mode 100644 index 00000000..ea1e49dc --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetResizedPhotoResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class GetResizedPhotoResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetResizedPhotoResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetResizedPhotoResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetResizedPhotoResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResizedPhotoResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResizedPhotoResponse other = (GetResizedPhotoResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetResizedPhotoResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetResizedPhotoResponse build() { + + return new GetResizedPhotoResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsRequestBuilder.java new file mode 100644 index 00000000..f575d11f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetResourcesStatisticsRequest; +import dev.plexapi.sdk.operations.GetResourcesStatistics; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetResourcesStatisticsRequestBuilder { + + private Optional timespan = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetResourcesStatisticsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetResourcesStatisticsRequestBuilder timespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.of(timespan); + return this; + } + + public GetResourcesStatisticsRequestBuilder timespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + + private GetResourcesStatisticsRequest buildRequest() { + + GetResourcesStatisticsRequest request = new GetResourcesStatisticsRequest(timespan); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetResourcesStatistics.Async(sdkConfiguration); + GetResourcesStatisticsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsResponse.java new file mode 100644 index 00000000..510cd128 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetResourcesStatisticsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetResourcesStatisticsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Resource Statistics + */ + private Optional object; + + @JsonCreator + public GetResourcesStatisticsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetResourcesStatisticsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Resource Statistics + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetResourcesStatisticsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetResourcesStatisticsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetResourcesStatisticsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Resource Statistics + */ + public GetResourcesStatisticsResponse withObject(GetResourcesStatisticsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Resource Statistics + */ + public GetResourcesStatisticsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetResourcesStatisticsResponse other = (GetResourcesStatisticsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetResourcesStatisticsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Resource Statistics + */ + public Builder object(GetResourcesStatisticsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Resource Statistics + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetResourcesStatisticsResponse build() { + + return new GetResourcesStatisticsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesRequestBuilder.java new file mode 100644 index 00000000..faa06052 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequest; +import dev.plexapi.sdk.operations.GetSearchAllLibraries; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetSearchAllLibrariesRequestBuilder { + + private GetSearchAllLibrariesRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetSearchAllLibrariesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetSearchAllLibrariesRequestBuilder request(GetSearchAllLibrariesRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetSearchAllLibraries.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesResponse.java new file mode 100644 index 00000000..c24b0850 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchAllLibrariesResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetSearchAllLibrariesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The libraries available on the Server + */ + private Optional object; + + @JsonCreator + public GetSearchAllLibrariesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetSearchAllLibrariesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The libraries available on the Server + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetSearchAllLibrariesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSearchAllLibrariesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchAllLibrariesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The libraries available on the Server + */ + public GetSearchAllLibrariesResponse withObject(GetSearchAllLibrariesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The libraries available on the Server + */ + public GetSearchAllLibrariesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchAllLibrariesResponse other = (GetSearchAllLibrariesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetSearchAllLibrariesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The libraries available on the Server + */ + public Builder object(GetSearchAllLibrariesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The libraries available on the Server + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetSearchAllLibrariesResponse build() { + + return new GetSearchAllLibrariesResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryRequestBuilder.java new file mode 100644 index 00000000..59df4999 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryRequestBuilder.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetSearchLibraryQueryParamType; +import dev.plexapi.sdk.models.operations.GetSearchLibraryRequest; +import dev.plexapi.sdk.operations.GetSearchLibrary; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Integer; +import java.util.concurrent.CompletableFuture; + +public class GetSearchLibraryRequestBuilder { + + private Integer sectionKey; + private GetSearchLibraryQueryParamType type; + private final SDKConfiguration sdkConfiguration; + + public GetSearchLibraryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetSearchLibraryRequestBuilder sectionKey(int sectionKey) { + Utils.checkNotNull(sectionKey, "sectionKey"); + this.sectionKey = sectionKey; + return this; + } + + public GetSearchLibraryRequestBuilder type(GetSearchLibraryQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + + private GetSearchLibraryRequest buildRequest() { + + GetSearchLibraryRequest request = new GetSearchLibraryRequest(sectionKey, + type); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetSearchLibrary.Async(sdkConfiguration); + GetSearchLibraryRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryResponse.java new file mode 100644 index 00000000..558ecd47 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchLibraryResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetSearchLibraryResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetSearchLibraryResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The contents of the library by section and type + */ + private Optional object; + + @JsonCreator + public GetSearchLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetSearchLibraryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The contents of the library by section and type + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetSearchLibraryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSearchLibraryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchLibraryResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The contents of the library by section and type + */ + public GetSearchLibraryResponse withObject(GetSearchLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The contents of the library by section and type + */ + public GetSearchLibraryResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchLibraryResponse other = (GetSearchLibraryResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetSearchLibraryResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The contents of the library by section and type + */ + public Builder object(GetSearchLibraryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The contents of the library by section and type + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetSearchLibraryResponse build() { + + return new GetSearchLibraryResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsRequestBuilder.java new file mode 100644 index 00000000..ebb6f53f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetSearchResultsRequest; +import dev.plexapi.sdk.operations.GetSearchResults; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class GetSearchResultsRequestBuilder { + + private String query; + private final SDKConfiguration sdkConfiguration; + + public GetSearchResultsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetSearchResultsRequestBuilder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + + private GetSearchResultsRequest buildRequest() { + + GetSearchResultsRequest request = new GetSearchResultsRequest(query); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetSearchResults.Async(sdkConfiguration); + GetSearchResultsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsResponse.java new file mode 100644 index 00000000..74d41354 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSearchResultsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetSearchResultsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetSearchResultsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Search Results + */ + private Optional object; + + @JsonCreator + public GetSearchResultsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetSearchResultsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Search Results + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetSearchResultsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSearchResultsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSearchResultsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Search Results + */ + public GetSearchResultsResponse withObject(GetSearchResultsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Search Results + */ + public GetSearchResultsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSearchResultsResponse other = (GetSearchResultsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetSearchResultsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Search Results + */ + public Builder object(GetSearchResultsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Search Results + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetSearchResultsResponse build() { + + return new GetSearchResultsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesRequestBuilder.java new file mode 100644 index 00000000..12fe9b69 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerActivities; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetServerActivitiesRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetServerActivitiesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetServerActivities.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesResponse.java new file mode 100644 index 00000000..86747a34 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerActivitiesResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetServerActivitiesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The Server Activities + */ + private Optional object; + + @JsonCreator + public GetServerActivitiesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetServerActivitiesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The Server Activities + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetServerActivitiesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetServerActivitiesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerActivitiesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The Server Activities + */ + public GetServerActivitiesResponse withObject(GetServerActivitiesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The Server Activities + */ + public GetServerActivitiesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerActivitiesResponse other = (GetServerActivitiesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetServerActivitiesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The Server Activities + */ + public Builder object(GetServerActivitiesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The Server Activities + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetServerActivitiesResponse build() { + + return new GetServerActivitiesResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesRequestBuilder.java new file mode 100644 index 00000000..07e93dcb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerCapabilities; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetServerCapabilitiesRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetServerCapabilitiesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetServerCapabilities.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesResponse.java new file mode 100644 index 00000000..651d617c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerCapabilitiesResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetServerCapabilitiesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The Server Capabilities + */ + private Optional object; + + @JsonCreator + public GetServerCapabilitiesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetServerCapabilitiesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The Server Capabilities + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetServerCapabilitiesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetServerCapabilitiesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerCapabilitiesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The Server Capabilities + */ + public GetServerCapabilitiesResponse withObject(GetServerCapabilitiesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The Server Capabilities + */ + public GetServerCapabilitiesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerCapabilitiesResponse other = (GetServerCapabilitiesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetServerCapabilitiesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The Server Capabilities + */ + public Builder object(GetServerCapabilitiesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The Server Capabilities + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetServerCapabilitiesResponse build() { + + return new GetServerCapabilitiesResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityRequestBuilder.java new file mode 100644 index 00000000..2d5a6c8f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerIdentity; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetServerIdentityRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetServerIdentityRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetServerIdentity.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityResponse.java new file mode 100644 index 00000000..3be4d419 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerIdentityResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetServerIdentityResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetServerIdentityResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The Server Identity information + */ + private Optional object; + + @JsonCreator + public GetServerIdentityResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetServerIdentityResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The Server Identity information + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetServerIdentityResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetServerIdentityResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerIdentityResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The Server Identity information + */ + public GetServerIdentityResponse withObject(GetServerIdentityResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The Server Identity information + */ + public GetServerIdentityResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerIdentityResponse other = (GetServerIdentityResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetServerIdentityResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The Server Identity information + */ + public Builder object(GetServerIdentityResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The Server Identity information + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetServerIdentityResponse build() { + + return new GetServerIdentityResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListRequestBuilder.java new file mode 100644 index 00000000..541b6253 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerList; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetServerListRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetServerListRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetServerList.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListResponse.java new file mode 100644 index 00000000..6d3c48b3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerListResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetServerListResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetServerListResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * List of Servers + */ + private Optional object; + + @JsonCreator + public GetServerListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetServerListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * List of Servers + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetServerListResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetServerListResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerListResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of Servers + */ + public GetServerListResponse withObject(GetServerListResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * List of Servers + */ + public GetServerListResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerListResponse other = (GetServerListResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetServerListResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * List of Servers + */ + public Builder object(GetServerListResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * List of Servers + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetServerListResponse build() { + + return new GetServerListResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesRequestBuilder.java new file mode 100644 index 00000000..b6c8d7cb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetServerPreferences; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetServerPreferencesRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetServerPreferencesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetServerPreferences.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesResponse.java new file mode 100644 index 00000000..977a1f01 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerPreferencesResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetServerPreferencesResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetServerPreferencesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Server Preferences + */ + private Optional object; + + @JsonCreator + public GetServerPreferencesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetServerPreferencesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Server Preferences + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetServerPreferencesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetServerPreferencesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerPreferencesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Server Preferences + */ + public GetServerPreferencesResponse withObject(GetServerPreferencesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Server Preferences + */ + public GetServerPreferencesResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerPreferencesResponse other = (GetServerPreferencesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetServerPreferencesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Server Preferences + */ + public Builder object(GetServerPreferencesResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Server Preferences + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetServerPreferencesResponse build() { + + return new GetServerPreferencesResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesRequestBuilder.java new file mode 100644 index 00000000..4d29a7ce --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesRequestBuilder.java @@ -0,0 +1,145 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetServerResourcesRequest; +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.operations.GetServerResources; +import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetServerResourcesRequestBuilder { + + private Optional includeHttps = Utils.readDefaultOrConstValue( + "includeHttps", + "0", + new TypeReference>() {}); + private Optional includeRelay = Utils.readDefaultOrConstValue( + "includeRelay", + "0", + new TypeReference>() {}); + private Optional includeIPv6 = Utils.readDefaultOrConstValue( + "includeIPv6", + "0", + new TypeReference>() {}); + private String clientID; + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetServerResourcesRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetServerResourcesRequestBuilder includeHttps(IncludeHttps includeHttps) { + Utils.checkNotNull(includeHttps, "includeHttps"); + this.includeHttps = Optional.of(includeHttps); + return this; + } + + public GetServerResourcesRequestBuilder includeHttps(Optional includeHttps) { + Utils.checkNotNull(includeHttps, "includeHttps"); + this.includeHttps = includeHttps; + return this; + } + + public GetServerResourcesRequestBuilder includeRelay(IncludeRelay includeRelay) { + Utils.checkNotNull(includeRelay, "includeRelay"); + this.includeRelay = Optional.of(includeRelay); + return this; + } + + public GetServerResourcesRequestBuilder includeRelay(Optional includeRelay) { + Utils.checkNotNull(includeRelay, "includeRelay"); + this.includeRelay = includeRelay; + return this; + } + + public GetServerResourcesRequestBuilder includeIPv6(IncludeIPv6 includeIPv6) { + Utils.checkNotNull(includeIPv6, "includeIPv6"); + this.includeIPv6 = Optional.of(includeIPv6); + return this; + } + + public GetServerResourcesRequestBuilder includeIPv6(Optional includeIPv6) { + Utils.checkNotNull(includeIPv6, "includeIPv6"); + this.includeIPv6 = includeIPv6; + return this; + } + + public GetServerResourcesRequestBuilder clientID(String clientID) { + Utils.checkNotNull(clientID, "clientID"); + this.clientID = clientID; + return this; + } + + public GetServerResourcesRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetServerResourcesRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + + private GetServerResourcesRequest buildRequest() { + if (includeHttps == null) { + includeHttps = _SINGLETON_VALUE_IncludeHttps.value(); + } + if (includeRelay == null) { + includeRelay = _SINGLETON_VALUE_IncludeRelay.value(); + } + if (includeIPv6 == null) { + includeIPv6 = _SINGLETON_VALUE_IncludeIPv6.value(); + } + + GetServerResourcesRequest request = new GetServerResourcesRequest(includeHttps, + includeRelay, + includeIPv6, + clientID); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetServerResources.Async(sdkConfiguration, serverURL); + GetServerResourcesRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeHttps = + new LazySingletonValue<>( + "includeHttps", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeRelay = + new LazySingletonValue<>( + "includeRelay", + "0", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeIPv6 = + new LazySingletonValue<>( + "includeIPv6", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesResponse.java new file mode 100644 index 00000000..2bf2cd5b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetServerResourcesResponse.java @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.PlexDevice; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + + +public class GetServerResourcesResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * List of Plex Devices. This includes Plex hosted servers and clients + */ + private Optional> plexDevices; + + @JsonCreator + public GetServerResourcesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> plexDevices) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(plexDevices, "plexDevices"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.plexDevices = plexDevices; + } + + public GetServerResourcesResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * List of Plex Devices. This includes Plex hosted servers and clients + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> plexDevices() { + return (Optional>) plexDevices; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetServerResourcesResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetServerResourcesResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetServerResourcesResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of Plex Devices. This includes Plex hosted servers and clients + */ + public GetServerResourcesResponse withPlexDevices(List plexDevices) { + Utils.checkNotNull(plexDevices, "plexDevices"); + this.plexDevices = Optional.ofNullable(plexDevices); + return this; + } + + + /** + * List of Plex Devices. This includes Plex hosted servers and clients + */ + public GetServerResourcesResponse withPlexDevices(Optional> plexDevices) { + Utils.checkNotNull(plexDevices, "plexDevices"); + this.plexDevices = plexDevices; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetServerResourcesResponse other = (GetServerResourcesResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.plexDevices, other.plexDevices); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + plexDevices); + } + + @Override + public String toString() { + return Utils.toString(GetServerResourcesResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "plexDevices", plexDevices); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> plexDevices = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * List of Plex Devices. This includes Plex hosted servers and clients + */ + public Builder plexDevices(List plexDevices) { + Utils.checkNotNull(plexDevices, "plexDevices"); + this.plexDevices = Optional.ofNullable(plexDevices); + return this; + } + + /** + * List of Plex Devices. This includes Plex hosted servers and clients + */ + public Builder plexDevices(Optional> plexDevices) { + Utils.checkNotNull(plexDevices, "plexDevices"); + this.plexDevices = plexDevices; + return this; + } + + public GetServerResourcesResponse build() { + + return new GetServerResourcesResponse( + contentType, statusCode, rawResponse, + plexDevices); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryRequestBuilder.java new file mode 100644 index 00000000..f84b49c8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryRequestBuilder.java @@ -0,0 +1,99 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetSessionHistoryRequest; +import dev.plexapi.sdk.models.operations.QueryParamFilter; +import dev.plexapi.sdk.operations.GetSessionHistory; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetSessionHistoryRequestBuilder { + + private Optional sort = Optional.empty(); + private Optional accountId = Optional.empty(); + private Optional filter = Optional.empty(); + private Optional librarySectionID = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetSessionHistoryRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetSessionHistoryRequestBuilder sort(String sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = Optional.of(sort); + return this; + } + + public GetSessionHistoryRequestBuilder sort(Optional sort) { + Utils.checkNotNull(sort, "sort"); + this.sort = sort; + return this; + } + + public GetSessionHistoryRequestBuilder accountId(long accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = Optional.of(accountId); + return this; + } + + public GetSessionHistoryRequestBuilder accountId(Optional accountId) { + Utils.checkNotNull(accountId, "accountId"); + this.accountId = accountId; + return this; + } + + public GetSessionHistoryRequestBuilder filter(QueryParamFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.of(filter); + return this; + } + + public GetSessionHistoryRequestBuilder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public GetSessionHistoryRequestBuilder librarySectionID(long librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = Optional.of(librarySectionID); + return this; + } + + public GetSessionHistoryRequestBuilder librarySectionID(Optional librarySectionID) { + Utils.checkNotNull(librarySectionID, "librarySectionID"); + this.librarySectionID = librarySectionID; + return this; + } + + + private GetSessionHistoryRequest buildRequest() { + + GetSessionHistoryRequest request = new GetSessionHistoryRequest(sort, + accountId, + filter, + librarySectionID); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetSessionHistory.Async(sdkConfiguration); + GetSessionHistoryRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryResponse.java new file mode 100644 index 00000000..940afccb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionHistoryResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetSessionHistoryResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetSessionHistoryResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * List of Plex Sessions + */ + private Optional object; + + @JsonCreator + public GetSessionHistoryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetSessionHistoryResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * List of Plex Sessions + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetSessionHistoryResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSessionHistoryResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionHistoryResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of Plex Sessions + */ + public GetSessionHistoryResponse withObject(GetSessionHistoryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * List of Plex Sessions + */ + public GetSessionHistoryResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionHistoryResponse other = (GetSessionHistoryResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetSessionHistoryResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * List of Plex Sessions + */ + public Builder object(GetSessionHistoryResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * List of Plex Sessions + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetSessionHistoryResponse build() { + + return new GetSessionHistoryResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsRequestBuilder.java new file mode 100644 index 00000000..ff8f97ce --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetSessions; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetSessionsRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetSessionsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetSessions.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsResponse.java new file mode 100644 index 00000000..7507ba24 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSessionsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetSessionsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetSessionsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * List of Active Plex Sessions + */ + private Optional object; + + @JsonCreator + public GetSessionsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetSessionsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * List of Active Plex Sessions + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetSessionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSessionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSessionsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * List of Active Plex Sessions + */ + public GetSessionsResponse withObject(GetSessionsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * List of Active Plex Sessions + */ + public GetSessionsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSessionsResponse other = (GetSessionsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetSessionsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * List of Active Plex Sessions + */ + public Builder object(GetSessionsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * List of Active Plex Sessions + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetSessionsResponse build() { + + return new GetSessionsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationRequestBuilder.java new file mode 100644 index 00000000..e94ef544 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationRequest; +import dev.plexapi.sdk.operations.GetSourceConnectionInformation; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class GetSourceConnectionInformationRequestBuilder { + + private String source; + private final SDKConfiguration sdkConfiguration; + + public GetSourceConnectionInformationRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetSourceConnectionInformationRequestBuilder source(String source) { + Utils.checkNotNull(source, "source"); + this.source = source; + return this; + } + + + private GetSourceConnectionInformationRequest buildRequest() { + + GetSourceConnectionInformationRequest request = new GetSourceConnectionInformationRequest(source); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetSourceConnectionInformation.Async(sdkConfiguration); + GetSourceConnectionInformationRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationResponse.java new file mode 100644 index 00000000..9a0f0716 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetSourceConnectionInformationResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class GetSourceConnectionInformationResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetSourceConnectionInformationResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetSourceConnectionInformationResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetSourceConnectionInformationResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetSourceConnectionInformationResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSourceConnectionInformationResponse other = (GetSourceConnectionInformationResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetSourceConnectionInformationResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetSourceConnectionInformationResponse build() { + + return new GetSourceConnectionInformationResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsRequestBuilder.java new file mode 100644 index 00000000..36800e2e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetStatisticsRequest; +import dev.plexapi.sdk.operations.GetStatistics; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetStatisticsRequestBuilder { + + private Optional timespan = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetStatisticsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetStatisticsRequestBuilder timespan(long timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = Optional.of(timespan); + return this; + } + + public GetStatisticsRequestBuilder timespan(Optional timespan) { + Utils.checkNotNull(timespan, "timespan"); + this.timespan = timespan; + return this; + } + + + private GetStatisticsRequest buildRequest() { + + GetStatisticsRequest request = new GetStatisticsRequest(timespan); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetStatistics.Async(sdkConfiguration); + GetStatisticsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsResponse.java new file mode 100644 index 00000000..613bc040 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetStatisticsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetStatisticsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Media Statistics + */ + private Optional object; + + @JsonCreator + public GetStatisticsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetStatisticsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Media Statistics + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetStatisticsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetStatisticsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetStatisticsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Media Statistics + */ + public GetStatisticsResponse withObject(GetStatisticsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Media Statistics + */ + public GetStatisticsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetStatisticsResponse other = (GetStatisticsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetStatisticsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Media Statistics + */ + public Builder object(GetStatisticsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Media Statistics + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetStatisticsResponse build() { + + return new GetStatisticsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageRequestBuilder.java new file mode 100644 index 00000000..fcd227ba --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetThumbImageRequest; +import dev.plexapi.sdk.operations.GetThumbImage; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetThumbImageRequestBuilder { + + private GetThumbImageRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetThumbImageRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetThumbImageRequestBuilder request(GetThumbImageRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetThumbImage.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageResponse.java new file mode 100644 index 00000000..553eb26d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetThumbImageResponse.java @@ -0,0 +1,284 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Map; +import java.util.Optional; + + +public class GetThumbImageResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Successful response returning an image + */ + private Optional responseStream; + + + private Map> headers; + + @JsonCreator + public GetThumbImageResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional responseStream, + Map> headers) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(responseStream, "responseStream"); + headers = Utils.emptyMapIfNull(headers); + Utils.checkNotNull(headers, "headers"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.responseStream = responseStream; + this.headers = headers; + } + + public GetThumbImageResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Map> headers) { + this(contentType, statusCode, rawResponse, + Optional.empty(), headers); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Successful response returning an image + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional responseStream() { + return (Optional) responseStream; + } + + @JsonIgnore + public Map> headers() { + return headers; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetThumbImageResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetThumbImageResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetThumbImageResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Successful response returning an image + */ + public GetThumbImageResponse withResponseStream(Blob responseStream) { + Utils.checkNotNull(responseStream, "responseStream"); + this.responseStream = Optional.ofNullable(responseStream); + return this; + } + + + /** + * Successful response returning an image + */ + public GetThumbImageResponse withResponseStream(Optional responseStream) { + Utils.checkNotNull(responseStream, "responseStream"); + this.responseStream = responseStream; + return this; + } + + public GetThumbImageResponse withHeaders(Map> headers) { + Utils.checkNotNull(headers, "headers"); + this.headers = headers; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetThumbImageResponse other = (GetThumbImageResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.responseStream, other.responseStream) && + Utils.enhancedDeepEquals(this.headers, other.headers); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + responseStream, headers); + } + + @Override + public String toString() { + return Utils.toString(GetThumbImageResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "responseStream", responseStream, + "headers", headers); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional responseStream = Optional.empty(); + + private Map> headers; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Successful response returning an image + */ + public Builder responseStream(Blob responseStream) { + Utils.checkNotNull(responseStream, "responseStream"); + this.responseStream = Optional.ofNullable(responseStream); + return this; + } + + /** + * Successful response returning an image + */ + public Builder responseStream(Optional responseStream) { + Utils.checkNotNull(responseStream, "responseStream"); + this.responseStream = responseStream; + return this; + } + + + public Builder headers(Map> headers) { + Utils.checkNotNull(headers, "headers"); + this.headers = headers; + return this; + } + + public GetThumbImageResponse build() { + + return new GetThumbImageResponse( + contentType, statusCode, rawResponse, + responseStream, headers); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineRequestBuilder.java new file mode 100644 index 00000000..8b931504 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetTimelineRequest; +import dev.plexapi.sdk.operations.GetTimeline; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetTimelineRequestBuilder { + + private GetTimelineRequest request; + private final SDKConfiguration sdkConfiguration; + + public GetTimelineRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetTimelineRequestBuilder request(GetTimelineRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetTimeline.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineResponse.java new file mode 100644 index 00000000..16e06aff --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTimelineResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class GetTimelineResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetTimelineResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetTimelineResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetTimelineResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTimelineResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTimelineResponse other = (GetTimelineResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTimelineResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTimelineResponse build() { + + return new GetTimelineResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdRequestBuilder.java new file mode 100644 index 00000000..e4a9e5f2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdRequestBuilder.java @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetTokenByPinIdRequest; +import dev.plexapi.sdk.operations.GetTokenByPinId; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetTokenByPinIdRequestBuilder { + + private GetTokenByPinIdRequest request; + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetTokenByPinIdRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetTokenByPinIdRequestBuilder request(GetTokenByPinIdRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetTokenByPinIdRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetTokenByPinIdRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetTokenByPinId.Async(sdkConfiguration, serverURL); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdResponse.java new file mode 100644 index 00000000..47b0e750 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenByPinIdResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetTokenByPinIdAuthPinContainer; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetTokenByPinIdResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The Pin with a non-null authToken when it has been verified by the user + */ + private Optional authPinContainer; + + @JsonCreator + public GetTokenByPinIdResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional authPinContainer) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.authPinContainer = authPinContainer; + } + + public GetTokenByPinIdResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The Pin with a non-null authToken when it has been verified by the user + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional authPinContainer() { + return (Optional) authPinContainer; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetTokenByPinIdResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetTokenByPinIdResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenByPinIdResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The Pin with a non-null authToken when it has been verified by the user + */ + public GetTokenByPinIdResponse withAuthPinContainer(GetTokenByPinIdAuthPinContainer authPinContainer) { + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.authPinContainer = Optional.ofNullable(authPinContainer); + return this; + } + + + /** + * The Pin with a non-null authToken when it has been verified by the user + */ + public GetTokenByPinIdResponse withAuthPinContainer(Optional authPinContainer) { + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.authPinContainer = authPinContainer; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenByPinIdResponse other = (GetTokenByPinIdResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.authPinContainer, other.authPinContainer); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + authPinContainer); + } + + @Override + public String toString() { + return Utils.toString(GetTokenByPinIdResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "authPinContainer", authPinContainer); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional authPinContainer = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The Pin with a non-null authToken when it has been verified by the user + */ + public Builder authPinContainer(GetTokenByPinIdAuthPinContainer authPinContainer) { + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.authPinContainer = Optional.ofNullable(authPinContainer); + return this; + } + + /** + * The Pin with a non-null authToken when it has been verified by the user + */ + public Builder authPinContainer(Optional authPinContainer) { + Utils.checkNotNull(authPinContainer, "authPinContainer"); + this.authPinContainer = authPinContainer; + return this; + } + + public GetTokenByPinIdResponse build() { + + return new GetTokenByPinIdResponse( + contentType, statusCode, rawResponse, + authPinContainer); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsRequestBuilder.java new file mode 100644 index 00000000..2b9ca9ed --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsRequestBuilder.java @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetTokenDetails; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetTokenDetailsRequestBuilder { + + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetTokenDetailsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetTokenDetailsRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetTokenDetailsRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetTokenDetails.Async(sdkConfiguration, serverURL); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsResponse.java new file mode 100644 index 00000000..eda0253b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTokenDetailsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetTokenDetailsUserPlexAccount; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetTokenDetailsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Logged in user details + */ + private Optional userPlexAccount; + + @JsonCreator + public GetTokenDetailsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional userPlexAccount) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.userPlexAccount = userPlexAccount; + } + + public GetTokenDetailsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Logged in user details + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userPlexAccount() { + return (Optional) userPlexAccount; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetTokenDetailsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetTokenDetailsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTokenDetailsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Logged in user details + */ + public GetTokenDetailsResponse withUserPlexAccount(GetTokenDetailsUserPlexAccount userPlexAccount) { + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.userPlexAccount = Optional.ofNullable(userPlexAccount); + return this; + } + + + /** + * Logged in user details + */ + public GetTokenDetailsResponse withUserPlexAccount(Optional userPlexAccount) { + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.userPlexAccount = userPlexAccount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTokenDetailsResponse other = (GetTokenDetailsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.userPlexAccount, other.userPlexAccount); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + userPlexAccount); + } + + @Override + public String toString() { + return Utils.toString(GetTokenDetailsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "userPlexAccount", userPlexAccount); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional userPlexAccount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Logged in user details + */ + public Builder userPlexAccount(GetTokenDetailsUserPlexAccount userPlexAccount) { + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.userPlexAccount = Optional.ofNullable(userPlexAccount); + return this; + } + + /** + * Logged in user details + */ + public Builder userPlexAccount(Optional userPlexAccount) { + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.userPlexAccount = userPlexAccount; + return this; + } + + public GetTokenDetailsResponse build() { + + return new GetTokenDetailsResponse( + contentType, statusCode, rawResponse, + userPlexAccount); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentRequestBuilder.java new file mode 100644 index 00000000..d7919637 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentRequestBuilder.java @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamIncludeGuids; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentQueryParamType; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentRequest; +import dev.plexapi.sdk.operations.GetTopWatchedContent; +import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetTopWatchedContentRequestBuilder { + + private GetTopWatchedContentQueryParamType type; + private Optional includeGuids = Utils.readDefaultOrConstValue( + "includeGuids", + "0", + new TypeReference>() {}); + private final SDKConfiguration sdkConfiguration; + + public GetTopWatchedContentRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetTopWatchedContentRequestBuilder type(GetTopWatchedContentQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetTopWatchedContentRequestBuilder includeGuids(GetTopWatchedContentQueryParamIncludeGuids includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = Optional.of(includeGuids); + return this; + } + + public GetTopWatchedContentRequestBuilder includeGuids(Optional includeGuids) { + Utils.checkNotNull(includeGuids, "includeGuids"); + this.includeGuids = includeGuids; + return this; + } + + + private GetTopWatchedContentRequest buildRequest() { + if (includeGuids == null) { + includeGuids = _SINGLETON_VALUE_IncludeGuids.value(); + } + + GetTopWatchedContentRequest request = new GetTopWatchedContentRequest(type, + includeGuids); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetTopWatchedContent.Async(sdkConfiguration); + GetTopWatchedContentRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_IncludeGuids = + new LazySingletonValue<>( + "includeGuids", + "0", + new TypeReference>() {}); +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentResponse.java new file mode 100644 index 00000000..23d62d96 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTopWatchedContentResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetTopWatchedContentResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The metadata of the library item. + */ + private Optional object; + + @JsonCreator + public GetTopWatchedContentResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetTopWatchedContentResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The metadata of the library item. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetTopWatchedContentResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetTopWatchedContentResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTopWatchedContentResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The metadata of the library item. + */ + public GetTopWatchedContentResponse withObject(GetTopWatchedContentResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The metadata of the library item. + */ + public GetTopWatchedContentResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTopWatchedContentResponse other = (GetTopWatchedContentResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetTopWatchedContentResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The metadata of the library item. + */ + public Builder object(GetTopWatchedContentResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The metadata of the library item. + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetTopWatchedContentResponse build() { + + return new GetTopWatchedContentResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsRequestBuilder.java new file mode 100644 index 00000000..60078751 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetTranscodeSessions; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetTranscodeSessionsRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetTranscodeSessionsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetTranscodeSessions.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsResponse.java new file mode 100644 index 00000000..59074dbe --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTranscodeSessionsResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetTranscodeSessionsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The Transcode Sessions + */ + private Optional object; + + @JsonCreator + public GetTranscodeSessionsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetTranscodeSessionsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The Transcode Sessions + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetTranscodeSessionsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetTranscodeSessionsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTranscodeSessionsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The Transcode Sessions + */ + public GetTranscodeSessionsResponse withObject(GetTranscodeSessionsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The Transcode Sessions + */ + public GetTranscodeSessionsResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTranscodeSessionsResponse other = (GetTranscodeSessionsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetTranscodeSessionsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The Transcode Sessions + */ + public Builder object(GetTranscodeSessionsResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The Transcode Sessions + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetTranscodeSessionsResponse build() { + + return new GetTranscodeSessionsResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenRequestBuilder.java new file mode 100644 index 00000000..39bff5fc --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenRequestBuilder.java @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetTransientTokenQueryParamType; +import dev.plexapi.sdk.models.operations.GetTransientTokenRequest; +import dev.plexapi.sdk.models.operations.Scope; +import dev.plexapi.sdk.operations.GetTransientToken; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetTransientTokenRequestBuilder { + + private GetTransientTokenQueryParamType type; + private Scope scope; + private final SDKConfiguration sdkConfiguration; + + public GetTransientTokenRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetTransientTokenRequestBuilder type(GetTransientTokenQueryParamType type) { + Utils.checkNotNull(type, "type"); + this.type = type; + return this; + } + + public GetTransientTokenRequestBuilder scope(Scope scope) { + Utils.checkNotNull(scope, "scope"); + this.scope = scope; + return this; + } + + + private GetTransientTokenRequest buildRequest() { + + GetTransientTokenRequest request = new GetTransientTokenRequest(type, + scope); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetTransientToken.Async(sdkConfiguration); + GetTransientTokenRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenResponse.java new file mode 100644 index 00000000..a196cf71 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetTransientTokenResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class GetTransientTokenResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public GetTransientTokenResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetTransientTokenResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetTransientTokenResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetTransientTokenResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetTransientTokenResponse other = (GetTransientTokenResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(GetTransientTokenResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetTransientTokenResponse build() { + + return new GetTransientTokenResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusRequestBuilder.java new file mode 100644 index 00000000..6a2feaa2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetUpdateStatus; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class GetUpdateStatusRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public GetUpdateStatusRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetUpdateStatus.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusResponse.java new file mode 100644 index 00000000..67abb839 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUpdateStatusResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetUpdateStatusResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetUpdateStatusResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * The Server Updates + */ + private Optional object; + + @JsonCreator + public GetUpdateStatusResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetUpdateStatusResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * The Server Updates + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetUpdateStatusResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetUpdateStatusResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUpdateStatusResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * The Server Updates + */ + public GetUpdateStatusResponse withObject(GetUpdateStatusResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * The Server Updates + */ + public GetUpdateStatusResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUpdateStatusResponse other = (GetUpdateStatusResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetUpdateStatusResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * The Server Updates + */ + public Builder object(GetUpdateStatusResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * The Server Updates + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetUpdateStatusResponse build() { + + return new GetUpdateStatusResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsRequestBuilder.java new file mode 100644 index 00000000..98add9d2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsRequestBuilder.java @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.GetUserFriends; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetUserFriendsRequestBuilder { + + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetUserFriendsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetUserFriendsRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetUserFriendsRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new GetUserFriends.Async(sdkConfiguration, serverURL); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsResponse.java new file mode 100644 index 00000000..f0f2e671 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUserFriendsResponse.java @@ -0,0 +1,254 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.Friend; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Optional; + + +public class GetUserFriendsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Friends Data + */ + private Optional> friends; + + @JsonCreator + public GetUserFriendsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional> friends) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(friends, "friends"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.friends = friends; + } + + public GetUserFriendsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Friends Data + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> friends() { + return (Optional>) friends; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetUserFriendsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetUserFriendsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUserFriendsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Friends Data + */ + public GetUserFriendsResponse withFriends(List friends) { + Utils.checkNotNull(friends, "friends"); + this.friends = Optional.ofNullable(friends); + return this; + } + + + /** + * Friends Data + */ + public GetUserFriendsResponse withFriends(Optional> friends) { + Utils.checkNotNull(friends, "friends"); + this.friends = friends; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUserFriendsResponse other = (GetUserFriendsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.friends, other.friends); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + friends); + } + + @Override + public String toString() { + return Utils.toString(GetUserFriendsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "friends", friends); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional> friends = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Friends Data + */ + public Builder friends(List friends) { + Utils.checkNotNull(friends, "friends"); + this.friends = Optional.ofNullable(friends); + return this; + } + + /** + * Friends Data + */ + public Builder friends(Optional> friends) { + Utils.checkNotNull(friends, "friends"); + this.friends = friends; + return this; + } + + public GetUserFriendsResponse build() { + + return new GetUserFriendsResponse( + contentType, statusCode, rawResponse, + friends); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersRequestBuilder.java new file mode 100644 index 00000000..c5ddd516 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersRequestBuilder.java @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetUsersRequest; +import dev.plexapi.sdk.operations.GetUsers; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetUsersRequestBuilder { + + private GetUsersRequest request; + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetUsersRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetUsersRequestBuilder request(GetUsersRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetUsersRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetUsersRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetUsers.Async(sdkConfiguration, serverURL); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersResponse.java new file mode 100644 index 00000000..4bf89157 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetUsersResponse.java @@ -0,0 +1,233 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetUsersResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + + private Optional body; + + @JsonCreator + public GetUsersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional body) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(body, "body"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.body = body; + } + + public GetUsersResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + @JsonIgnore + public Blob body() { + return rawResponse.body(); + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetUsersResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetUsersResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetUsersResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public GetUsersResponse withBody(byte[] body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + + public GetUsersResponse withBody(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetUsersResponse other = (GetUsersResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.body, other.body); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + body); + } + + @Override + public String toString() { + return Utils.toString(GetUsersResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "body", body); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional body = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + public Builder body(byte[] body) { + Utils.checkNotNull(body, "body"); + this.body = Optional.ofNullable(body); + return this; + } + + public Builder body(Optional body) { + Utils.checkNotNull(body, "body"); + this.body = body; + return this; + } + + public GetUsersResponse build() { + + return new GetUsersResponse( + contentType, statusCode, rawResponse, + body); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListRequestBuilder.java new file mode 100644 index 00000000..dcc22a78 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListRequestBuilder.java @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.GetWatchListRequest; +import dev.plexapi.sdk.operations.GetWatchList; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class GetWatchListRequestBuilder { + + private GetWatchListRequest request; + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public GetWatchListRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public GetWatchListRequestBuilder request(GetWatchListRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public GetWatchListRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public GetWatchListRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new GetWatchList.Async(sdkConfiguration, serverURL); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListResponse.java new file mode 100644 index 00000000..09e49c5e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/GetWatchListResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.GetWatchListResponseBody; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class GetWatchListResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Watchlist Data + */ + private Optional object; + + @JsonCreator + public GetWatchListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional object) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(object, "object"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.object = object; + } + + public GetWatchListResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Watchlist Data + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional object() { + return (Optional) object; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public GetWatchListResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public GetWatchListResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public GetWatchListResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Watchlist Data + */ + public GetWatchListResponse withObject(GetWatchListResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + + /** + * Watchlist Data + */ + public GetWatchListResponse withObject(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetWatchListResponse other = (GetWatchListResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.object, other.object); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + object); + } + + @Override + public String toString() { + return Utils.toString(GetWatchListResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "object", object); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional object = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Watchlist Data + */ + public Builder object(GetWatchListResponseBody object) { + Utils.checkNotNull(object, "object"); + this.object = Optional.ofNullable(object); + return this; + } + + /** + * Watchlist Data + */ + public Builder object(Optional object) { + Utils.checkNotNull(object, "object"); + this.object = object; + return this; + } + + public GetWatchListResponse build() { + + return new GetWatchListResponse( + contentType, statusCode, rawResponse, + object); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/LogLineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/LogLineRequestBuilder.java new file mode 100644 index 00000000..b6f2b97e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/LogLineRequestBuilder.java @@ -0,0 +1,65 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.Level; +import dev.plexapi.sdk.models.operations.LogLineRequest; +import dev.plexapi.sdk.operations.LogLine; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class LogLineRequestBuilder { + + private Level level; + private String message; + private String source; + private final SDKConfiguration sdkConfiguration; + + public LogLineRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public LogLineRequestBuilder level(Level level) { + Utils.checkNotNull(level, "level"); + this.level = level; + return this; + } + + public LogLineRequestBuilder message(String message) { + Utils.checkNotNull(message, "message"); + this.message = message; + return this; + } + + public LogLineRequestBuilder source(String source) { + Utils.checkNotNull(source, "source"); + this.source = source; + return this; + } + + + private LogLineRequest buildRequest() { + + LogLineRequest request = new LogLineRequest(level, + message, + source); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new LogLine.Async(sdkConfiguration); + LogLineRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/LogLineResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/LogLineResponse.java new file mode 100644 index 00000000..fab99e70 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/LogLineResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class LogLineResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public LogLineResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public LogLineResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public LogLineResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogLineResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogLineResponse other = (LogLineResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(LogLineResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public LogLineResponse build() { + + return new LogLineResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineRequestBuilder.java new file mode 100644 index 00000000..448e12d3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.LogMultiLine; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class LogMultiLineRequestBuilder { + + private String request; + private final SDKConfiguration sdkConfiguration; + + public LogMultiLineRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public LogMultiLineRequestBuilder request(String request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new LogMultiLine.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineResponse.java new file mode 100644 index 00000000..324ecd8c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/LogMultiLineResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class LogMultiLineResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public LogMultiLineResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public LogMultiLineResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public LogMultiLineResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public LogMultiLineResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogMultiLineResponse other = (LogMultiLineResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(LogMultiLineResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public LogMultiLineResponse build() { + + return new LogMultiLineResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedRequestBuilder.java new file mode 100644 index 00000000..f25969d5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.MarkPlayedRequest; +import dev.plexapi.sdk.operations.MarkPlayed; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class MarkPlayedRequestBuilder { + + private Double key; + private final SDKConfiguration sdkConfiguration; + + public MarkPlayedRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public MarkPlayedRequestBuilder key(double key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + + private MarkPlayedRequest buildRequest() { + + MarkPlayedRequest request = new MarkPlayedRequest(key); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new MarkPlayed.Async(sdkConfiguration); + MarkPlayedRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedResponse.java new file mode 100644 index 00000000..4c6de5be --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/MarkPlayedResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class MarkPlayedResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public MarkPlayedResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public MarkPlayedResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public MarkPlayedResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkPlayedResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkPlayedResponse other = (MarkPlayedResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(MarkPlayedResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public MarkPlayedResponse build() { + + return new MarkPlayedResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedRequestBuilder.java new file mode 100644 index 00000000..934b6256 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.MarkUnplayedRequest; +import dev.plexapi.sdk.operations.MarkUnplayed; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class MarkUnplayedRequestBuilder { + + private Double key; + private final SDKConfiguration sdkConfiguration; + + public MarkUnplayedRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public MarkUnplayedRequestBuilder key(double key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + + private MarkUnplayedRequest buildRequest() { + + MarkUnplayedRequest request = new MarkUnplayedRequest(key); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new MarkUnplayed.Async(sdkConfiguration); + MarkUnplayedRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedResponse.java new file mode 100644 index 00000000..ed588c44 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/MarkUnplayedResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class MarkUnplayedResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public MarkUnplayedResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public MarkUnplayedResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public MarkUnplayedResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public MarkUnplayedResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MarkUnplayedResponse other = (MarkUnplayedResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(MarkUnplayedResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public MarkUnplayedResponse build() { + + return new MarkUnplayedResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchRequestBuilder.java new file mode 100644 index 00000000..f9a821d1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchRequestBuilder.java @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.PerformSearchRequest; +import dev.plexapi.sdk.operations.PerformSearch; +import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class PerformSearchRequestBuilder { + + private String query; + private Optional sectionId = Optional.empty(); + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "3", + new TypeReference>() {}); + private final SDKConfiguration sdkConfiguration; + + public PerformSearchRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PerformSearchRequestBuilder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public PerformSearchRequestBuilder sectionId(double sectionId) { + Utils.checkNotNull(sectionId, "sectionId"); + this.sectionId = Optional.of(sectionId); + return this; + } + + public PerformSearchRequestBuilder sectionId(Optional sectionId) { + Utils.checkNotNull(sectionId, "sectionId"); + this.sectionId = sectionId; + return this; + } + + public PerformSearchRequestBuilder limit(double limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public PerformSearchRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + + private PerformSearchRequest buildRequest() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + PerformSearchRequest request = new PerformSearchRequest(query, + sectionId, + limit); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new PerformSearch.Async(sdkConfiguration); + PerformSearchRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "3", + new TypeReference>() {}); +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchResponse.java new file mode 100644 index 00000000..ba699211 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PerformSearchResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class PerformSearchResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public PerformSearchResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PerformSearchResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PerformSearchResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformSearchResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerformSearchResponse other = (PerformSearchResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PerformSearchResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PerformSearchResponse build() { + + return new PerformSearchResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchRequestBuilder.java new file mode 100644 index 00000000..a1e468b2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchRequestBuilder.java @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequest; +import dev.plexapi.sdk.operations.PerformVoiceSearch; +import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class PerformVoiceSearchRequestBuilder { + + private String query; + private Optional sectionId = Optional.empty(); + private Optional limit = Utils.readDefaultOrConstValue( + "limit", + "3", + new TypeReference>() {}); + private final SDKConfiguration sdkConfiguration; + + public PerformVoiceSearchRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PerformVoiceSearchRequestBuilder query(String query) { + Utils.checkNotNull(query, "query"); + this.query = query; + return this; + } + + public PerformVoiceSearchRequestBuilder sectionId(double sectionId) { + Utils.checkNotNull(sectionId, "sectionId"); + this.sectionId = Optional.of(sectionId); + return this; + } + + public PerformVoiceSearchRequestBuilder sectionId(Optional sectionId) { + Utils.checkNotNull(sectionId, "sectionId"); + this.sectionId = sectionId; + return this; + } + + public PerformVoiceSearchRequestBuilder limit(double limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.of(limit); + return this; + } + + public PerformVoiceSearchRequestBuilder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + + private PerformVoiceSearchRequest buildRequest() { + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + PerformVoiceSearchRequest request = new PerformVoiceSearchRequest(query, + sectionId, + limit); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new PerformVoiceSearch.Async(sdkConfiguration); + PerformVoiceSearchRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "3", + new TypeReference>() {}); +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchResponse.java new file mode 100644 index 00000000..8c97b55b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PerformVoiceSearchResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class PerformVoiceSearchResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public PerformVoiceSearchResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PerformVoiceSearchResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PerformVoiceSearchResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PerformVoiceSearchResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerformVoiceSearchResponse other = (PerformVoiceSearchResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PerformVoiceSearchResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PerformVoiceSearchResponse build() { + + return new PerformVoiceSearchResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsRequestBuilder.java new file mode 100644 index 00000000..5abe3534 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsRequestBuilder.java @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.PostMediaArtsRequest; +import dev.plexapi.sdk.operations.PostMediaArts; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class PostMediaArtsRequestBuilder { + + private Long ratingKey; + private Optional url = Optional.empty(); + private Optional requestBody = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public PostMediaArtsRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PostMediaArtsRequestBuilder ratingKey(long ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public PostMediaArtsRequestBuilder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = Optional.of(url); + return this; + } + + public PostMediaArtsRequestBuilder url(Optional url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + public PostMediaArtsRequestBuilder requestBody(byte[] requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public PostMediaArtsRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + + private PostMediaArtsRequest buildRequest() { + + PostMediaArtsRequest request = new PostMediaArtsRequest(ratingKey, + url, + requestBody); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new PostMediaArts.Async(sdkConfiguration); + PostMediaArtsRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsResponse.java new file mode 100644 index 00000000..e51af579 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaArtsResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class PostMediaArtsResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public PostMediaArtsResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PostMediaArtsResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PostMediaArtsResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PostMediaArtsResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostMediaArtsResponse other = (PostMediaArtsResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PostMediaArtsResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PostMediaArtsResponse build() { + + return new PostMediaArtsResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterRequestBuilder.java new file mode 100644 index 00000000..14994051 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterRequestBuilder.java @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.PostMediaPosterRequest; +import dev.plexapi.sdk.operations.PostMediaPoster; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class PostMediaPosterRequestBuilder { + + private Long ratingKey; + private Optional url = Optional.empty(); + private Optional requestBody = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public PostMediaPosterRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PostMediaPosterRequestBuilder ratingKey(long ratingKey) { + Utils.checkNotNull(ratingKey, "ratingKey"); + this.ratingKey = ratingKey; + return this; + } + + public PostMediaPosterRequestBuilder url(String url) { + Utils.checkNotNull(url, "url"); + this.url = Optional.of(url); + return this; + } + + public PostMediaPosterRequestBuilder url(Optional url) { + Utils.checkNotNull(url, "url"); + this.url = url; + return this; + } + + public PostMediaPosterRequestBuilder requestBody(byte[] requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = Optional.of(requestBody); + return this; + } + + public PostMediaPosterRequestBuilder requestBody(Optional requestBody) { + Utils.checkNotNull(requestBody, "requestBody"); + this.requestBody = requestBody; + return this; + } + + + private PostMediaPosterRequest buildRequest() { + + PostMediaPosterRequest request = new PostMediaPosterRequest(ratingKey, + url, + requestBody); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new PostMediaPoster.Async(sdkConfiguration); + PostMediaPosterRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterResponse.java new file mode 100644 index 00000000..7ed2e3d4 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PostMediaPosterResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class PostMediaPosterResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public PostMediaPosterResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PostMediaPosterResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PostMediaPosterResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PostMediaPosterResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostMediaPosterResponse other = (PostMediaPosterResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(PostMediaPosterResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public PostMediaPosterResponse build() { + + return new PostMediaPosterResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataRequestBuilder.java new file mode 100644 index 00000000..6caa4de8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataRequestBuilder.java @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequest; +import dev.plexapi.sdk.operations.PostUsersSignInData; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class PostUsersSignInDataRequestBuilder { + + private PostUsersSignInDataRequest request; + private Optional serverURL = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public PostUsersSignInDataRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public PostUsersSignInDataRequestBuilder request(PostUsersSignInDataRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public PostUsersSignInDataRequestBuilder serverURL(String serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = Optional.of(serverURL); + return this; + } + + public PostUsersSignInDataRequestBuilder serverURL(Optional serverURL) { + Utils.checkNotNull(serverURL, "serverURL"); + this.serverURL = serverURL; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new PostUsersSignInData.Async(sdkConfiguration, serverURL); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataResponse.java new file mode 100644 index 00000000..2db6a96b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/PostUsersSignInDataResponse.java @@ -0,0 +1,253 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.net.http.HttpResponse; +import java.util.Optional; + + +public class PostUsersSignInDataResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + /** + * Returns the user account data with a valid auth token + */ + private Optional userPlexAccount; + + @JsonCreator + public PostUsersSignInDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional userPlexAccount) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.userPlexAccount = userPlexAccount; + } + + public PostUsersSignInDataResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty()); + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + /** + * Returns the user account data with a valid auth token + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional userPlexAccount() { + return (Optional) userPlexAccount; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public PostUsersSignInDataResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public PostUsersSignInDataResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public PostUsersSignInDataResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Returns the user account data with a valid auth token + */ + public PostUsersSignInDataResponse withUserPlexAccount(PostUsersSignInDataUserPlexAccount userPlexAccount) { + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.userPlexAccount = Optional.ofNullable(userPlexAccount); + return this; + } + + + /** + * Returns the user account data with a valid auth token + */ + public PostUsersSignInDataResponse withUserPlexAccount(Optional userPlexAccount) { + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.userPlexAccount = userPlexAccount; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PostUsersSignInDataResponse other = (PostUsersSignInDataResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.userPlexAccount, other.userPlexAccount); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + userPlexAccount); + } + + @Override + public String toString() { + return Utils.toString(PostUsersSignInDataResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "userPlexAccount", userPlexAccount); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional userPlexAccount = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + + /** + * Returns the user account data with a valid auth token + */ + public Builder userPlexAccount(PostUsersSignInDataUserPlexAccount userPlexAccount) { + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.userPlexAccount = Optional.ofNullable(userPlexAccount); + return this; + } + + /** + * Returns the user account data with a valid auth token + */ + public Builder userPlexAccount(Optional userPlexAccount) { + Utils.checkNotNull(userPlexAccount, "userPlexAccount"); + this.userPlexAccount = userPlexAccount; + return this; + } + + public PostUsersSignInDataResponse build() { + + return new PostUsersSignInDataResponse( + contentType, statusCode, rawResponse, + userPlexAccount); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksRequestBuilder.java new file mode 100644 index 00000000..2ab47d7c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.StartAllTasks; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class StartAllTasksRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public StartAllTasksRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new StartAllTasks.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksResponse.java new file mode 100644 index 00000000..cbd2bcbd --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StartAllTasksResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class StartAllTasksResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public StartAllTasksResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public StartAllTasksResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public StartAllTasksResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartAllTasksResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartAllTasksResponse other = (StartAllTasksResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartAllTasksResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartAllTasksResponse build() { + + return new StartAllTasksResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskRequestBuilder.java new file mode 100644 index 00000000..74faca6a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.StartTaskRequest; +import dev.plexapi.sdk.models.operations.TaskName; +import dev.plexapi.sdk.operations.StartTask; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class StartTaskRequestBuilder { + + private TaskName taskName; + private final SDKConfiguration sdkConfiguration; + + public StartTaskRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public StartTaskRequestBuilder taskName(TaskName taskName) { + Utils.checkNotNull(taskName, "taskName"); + this.taskName = taskName; + return this; + } + + + private StartTaskRequest buildRequest() { + + StartTaskRequest request = new StartTaskRequest(taskName); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new StartTask.Async(sdkConfiguration); + StartTaskRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskResponse.java new file mode 100644 index 00000000..521f1737 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StartTaskResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class StartTaskResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public StartTaskResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public StartTaskResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public StartTaskResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartTaskResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartTaskResponse other = (StartTaskResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartTaskResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartTaskResponse build() { + + return new StartTaskResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeRequestBuilder.java new file mode 100644 index 00000000..5e1f89cb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeRequestBuilder.java @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.StartUniversalTranscodeRequest; +import dev.plexapi.sdk.operations.StartUniversalTranscode; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class StartUniversalTranscodeRequestBuilder { + + private StartUniversalTranscodeRequest request; + private final SDKConfiguration sdkConfiguration; + + public StartUniversalTranscodeRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public StartUniversalTranscodeRequestBuilder request(StartUniversalTranscodeRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new StartUniversalTranscode.Async(sdkConfiguration); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeResponse.java new file mode 100644 index 00000000..58a383c6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StartUniversalTranscodeResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class StartUniversalTranscodeResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public StartUniversalTranscodeResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public StartUniversalTranscodeResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public StartUniversalTranscodeResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StartUniversalTranscodeResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StartUniversalTranscodeResponse other = (StartUniversalTranscodeResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StartUniversalTranscodeResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StartUniversalTranscodeResponse build() { + + return new StartUniversalTranscodeResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksRequestBuilder.java new file mode 100644 index 00000000..19c84507 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksRequestBuilder.java @@ -0,0 +1,29 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.operations.StopAllTasks; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class StopAllTasksRequestBuilder { + + private final SDKConfiguration sdkConfiguration; + + public StopAllTasksRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestlessOperation operation + = new StopAllTasks.Async(sdkConfiguration); + + return operation.doRequest() + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksResponse.java new file mode 100644 index 00000000..00025b07 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StopAllTasksResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class StopAllTasksResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public StopAllTasksResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public StopAllTasksResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public StopAllTasksResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopAllTasksResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopAllTasksResponse other = (StopAllTasksResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopAllTasksResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopAllTasksResponse build() { + + return new StopAllTasksResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskRequestBuilder.java new file mode 100644 index 00000000..9e2f3406 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.PathParamTaskName; +import dev.plexapi.sdk.models.operations.StopTaskRequest; +import dev.plexapi.sdk.operations.StopTask; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.util.concurrent.CompletableFuture; + +public class StopTaskRequestBuilder { + + private PathParamTaskName taskName; + private final SDKConfiguration sdkConfiguration; + + public StopTaskRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public StopTaskRequestBuilder taskName(PathParamTaskName taskName) { + Utils.checkNotNull(taskName, "taskName"); + this.taskName = taskName; + return this; + } + + + private StopTaskRequest buildRequest() { + + StopTaskRequest request = new StopTaskRequest(taskName); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new StopTask.Async(sdkConfiguration); + StopTaskRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskResponse.java new file mode 100644 index 00000000..a43d0729 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StopTaskResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class StopTaskResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public StopTaskResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public StopTaskResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public StopTaskResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTaskResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopTaskResponse other = (StopTaskResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopTaskResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopTaskResponse build() { + + return new StopTaskResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionRequestBuilder.java new file mode 100644 index 00000000..02b984ec --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionRequestBuilder.java @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.StopTranscodeSessionRequest; +import dev.plexapi.sdk.operations.StopTranscodeSession; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class StopTranscodeSessionRequestBuilder { + + private String sessionKey; + private final SDKConfiguration sdkConfiguration; + + public StopTranscodeSessionRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public StopTranscodeSessionRequestBuilder sessionKey(String sessionKey) { + Utils.checkNotNull(sessionKey, "sessionKey"); + this.sessionKey = sessionKey; + return this; + } + + + private StopTranscodeSessionRequest buildRequest() { + + StopTranscodeSessionRequest request = new StopTranscodeSessionRequest(sessionKey); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new StopTranscodeSession.Async(sdkConfiguration); + StopTranscodeSessionRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionResponse.java new file mode 100644 index 00000000..7db5a127 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/StopTranscodeSessionResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class StopTranscodeSessionResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public StopTranscodeSessionResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public StopTranscodeSessionResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public StopTranscodeSessionResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public StopTranscodeSessionResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StopTranscodeSessionResponse other = (StopTranscodeSessionResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(StopTranscodeSessionResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public StopTranscodeSessionResponse build() { + + return new StopTranscodeSessionResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressRequestBuilder.java new file mode 100644 index 00000000..b22b5f29 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressRequestBuilder.java @@ -0,0 +1,65 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.UpdatePlayProgressRequest; +import dev.plexapi.sdk.operations.UpdatePlayProgress; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class UpdatePlayProgressRequestBuilder { + + private String key; + private Double time; + private String state; + private final SDKConfiguration sdkConfiguration; + + public UpdatePlayProgressRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public UpdatePlayProgressRequestBuilder key(String key) { + Utils.checkNotNull(key, "key"); + this.key = key; + return this; + } + + public UpdatePlayProgressRequestBuilder time(double time) { + Utils.checkNotNull(time, "time"); + this.time = time; + return this; + } + + public UpdatePlayProgressRequestBuilder state(String state) { + Utils.checkNotNull(state, "state"); + this.state = state; + return this; + } + + + private UpdatePlayProgressRequest buildRequest() { + + UpdatePlayProgressRequest request = new UpdatePlayProgressRequest(key, + time, + state); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new UpdatePlayProgress.Async(sdkConfiguration); + UpdatePlayProgressRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressResponse.java new file mode 100644 index 00000000..d5eeb10d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlayProgressResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class UpdatePlayProgressResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public UpdatePlayProgressResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public UpdatePlayProgressResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdatePlayProgressResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlayProgressResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePlayProgressResponse other = (UpdatePlayProgressResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdatePlayProgressResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UpdatePlayProgressResponse build() { + + return new UpdatePlayProgressResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistRequestBuilder.java new file mode 100644 index 00000000..ece5ede6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistRequestBuilder.java @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.UpdatePlaylistRequest; +import dev.plexapi.sdk.operations.UpdatePlaylist; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Double; +import java.lang.Exception; +import java.lang.String; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class UpdatePlaylistRequestBuilder { + + private Double playlistID; + private Optional title = Optional.empty(); + private Optional summary = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + + public UpdatePlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public UpdatePlaylistRequestBuilder playlistID(double playlistID) { + Utils.checkNotNull(playlistID, "playlistID"); + this.playlistID = playlistID; + return this; + } + + public UpdatePlaylistRequestBuilder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = Optional.of(title); + return this; + } + + public UpdatePlaylistRequestBuilder title(Optional title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + public UpdatePlaylistRequestBuilder summary(String summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = Optional.of(summary); + return this; + } + + public UpdatePlaylistRequestBuilder summary(Optional summary) { + Utils.checkNotNull(summary, "summary"); + this.summary = summary; + return this; + } + + + private UpdatePlaylistRequest buildRequest() { + + UpdatePlaylistRequest request = new UpdatePlaylistRequest(playlistID, + title, + summary); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new UpdatePlaylist.Async(sdkConfiguration); + UpdatePlaylistRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistResponse.java new file mode 100644 index 00000000..07741067 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/UpdatePlaylistResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class UpdatePlaylistResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public UpdatePlaylistResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public UpdatePlaylistResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UpdatePlaylistResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UpdatePlaylistResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdatePlaylistResponse other = (UpdatePlaylistResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UpdatePlaylistResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UpdatePlaylistResponse build() { + + return new UpdatePlaylistResponse( + contentType, statusCode, rawResponse); + } + + } +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistRequestBuilder.java b/src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistRequestBuilder.java new file mode 100644 index 00000000..7539d9ba --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistRequestBuilder.java @@ -0,0 +1,77 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.models.operations.QueryParamForce; +import dev.plexapi.sdk.models.operations.UploadPlaylistRequest; +import dev.plexapi.sdk.operations.UploadPlaylist; +import dev.plexapi.sdk.utils.LazySingletonValue; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Exception; +import java.lang.Long; +import java.lang.String; +import java.util.concurrent.CompletableFuture; + +public class UploadPlaylistRequestBuilder { + + private String path; + private QueryParamForce force; + private Long sectionID; + private final SDKConfiguration sdkConfiguration; + + public UploadPlaylistRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public UploadPlaylistRequestBuilder path(String path) { + Utils.checkNotNull(path, "path"); + this.path = path; + return this; + } + + public UploadPlaylistRequestBuilder force(QueryParamForce force) { + Utils.checkNotNull(force, "force"); + this.force = force; + return this; + } + + public UploadPlaylistRequestBuilder sectionID(long sectionID) { + Utils.checkNotNull(sectionID, "sectionID"); + this.sectionID = sectionID; + return this; + } + + + private UploadPlaylistRequest buildRequest() { + if (sectionID == null) { + sectionID = _SINGLETON_VALUE_SectionID.value(); + } + + UploadPlaylistRequest request = new UploadPlaylistRequest(path, + force, + sectionID); + + return request; + } + + public CompletableFuture call() throws Exception { + + AsyncRequestOperation operation + = new UploadPlaylist.Async(sdkConfiguration); + UploadPlaylistRequest request = buildRequest(); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + private static final LazySingletonValue _SINGLETON_VALUE_SectionID = + new LazySingletonValue<>( + "sectionID", + "1", + new TypeReference() {}); +} diff --git a/src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistResponse.java b/src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistResponse.java new file mode 100644 index 00000000..67efc1a8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/models/operations/async/UploadPlaylistResponse.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.models.operations.async; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Utils; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.net.http.HttpResponse; + + +public class UploadPlaylistResponse implements AsyncResponse { + /** + * HTTP response content type for this operation + */ + private String contentType; + + /** + * HTTP response status code for this operation + */ + private int statusCode; + + /** + * Raw HTTP response; suitable for custom response parsing + */ + private HttpResponse rawResponse; + + @JsonCreator + public UploadPlaylistResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + } + + /** + * HTTP response content type for this operation + */ + @JsonIgnore + public String contentType() { + return contentType; + } + + /** + * HTTP response status code for this operation + */ + @JsonIgnore + public int statusCode() { + return statusCode; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + @JsonIgnore + public HttpResponse rawResponse() { + return rawResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public UploadPlaylistResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public UploadPlaylistResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public UploadPlaylistResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UploadPlaylistResponse other = (UploadPlaylistResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse); + } + + @Override + public String toString() { + return Utils.toString(UploadPlaylistResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP response content type for this operation + */ + public Builder contentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + + /** + * HTTP response status code for this operation + */ + public Builder statusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public Builder rawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + public UploadPlaylistResponse build() { + + return new UploadPlaylistResponse( + contentType, statusCode, rawResponse); + } + + } +} 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 6d9328a3..72b432d9 100644 --- a/src/main/java/dev/plexapi/sdk/models/shared/Security.java +++ b/src/main/java/dev/plexapi/sdk/models/shared/Security.java @@ -10,9 +10,9 @@ import dev.plexapi.sdk.utils.SpeakeasyMetadata; import dev.plexapi.sdk.utils.Utils; import java.lang.Override; import java.lang.String; -import java.util.Objects; import java.util.Optional; + public class Security implements HasSecurity { @SpeakeasyMetadata("security:scheme=true,type=apiKey,subtype=header,name=X-Plex-Token") @@ -34,9 +34,10 @@ public class Security implements HasSecurity { return accessToken; } - public final static Builder builder() { + public static Builder builder() { return new Builder(); - } + } + public Security withAccessToken(String accessToken) { Utils.checkNotNull(accessToken, "accessToken"); @@ -44,13 +45,13 @@ public class Security implements HasSecurity { return this; } + public Security withAccessToken(Optional accessToken) { Utils.checkNotNull(accessToken, "accessToken"); this.accessToken = accessToken; return this; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -61,12 +62,12 @@ public class Security implements HasSecurity { } Security other = (Security) o; return - Objects.deepEquals(this.accessToken, other.accessToken); + Utils.enhancedDeepEquals(this.accessToken, other.accessToken); } @Override public int hashCode() { - return Objects.hash( + return Utils.enhancedHash( accessToken); } @@ -75,15 +76,17 @@ public class Security implements HasSecurity { return Utils.toString(Security.class, "accessToken", accessToken); } - + + @SuppressWarnings("UnusedReturnValue") public final static class Builder { - + private Optional accessToken = Optional.empty(); - + private Builder() { // force use of static builder() method } + public Builder accessToken(String accessToken) { Utils.checkNotNull(accessToken, "accessToken"); this.accessToken = Optional.ofNullable(accessToken); @@ -95,10 +98,12 @@ public class Security implements HasSecurity { this.accessToken = accessToken; return this; } - + public Security build() { + return new Security( accessToken); } + } } diff --git a/src/main/java/dev/plexapi/sdk/operations/AddPlaylistContents.java b/src/main/java/dev/plexapi/sdk/operations/AddPlaylistContents.java new file mode 100644 index 00000000..7e57ee18 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/AddPlaylistContents.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.AddPlaylistContentsBadRequest; +import dev.plexapi.sdk.models.errors.AddPlaylistContentsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.AddPlaylistContentsRequest; +import dev.plexapi.sdk.models.operations.AddPlaylistContentsResponse; +import dev.plexapi.sdk.models.operations.AddPlaylistContentsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class AddPlaylistContents { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "addPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "addPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "addPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/playlists/{playlistID}/items", + request, null); + HTTPRequest req = new HTTPRequest(url, "PUT"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(AddPlaylistContentsRequest request) throws Exception { + HttpRequest req = buildRequest(request, AddPlaylistContentsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(AddPlaylistContentsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public AddPlaylistContentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AddPlaylistContentsResponse.Builder resBuilder = + AddPlaylistContentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AddPlaylistContentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + AddPlaylistContentsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + AddPlaylistContentsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + AddPlaylistContentsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(AddPlaylistContentsRequest request) throws Exception { + HttpRequest req = buildRequest(request, AddPlaylistContentsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(AddPlaylistContentsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.AddPlaylistContentsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.AddPlaylistContentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.AddPlaylistContentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + AddPlaylistContentsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.AddPlaylistContentsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.AddPlaylistContentsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/ApplyUpdates.java b/src/main/java/dev/plexapi/sdk/operations/ApplyUpdates.java new file mode 100644 index 00000000..97a4d3b0 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/ApplyUpdates.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.ApplyUpdatesBadRequest; +import dev.plexapi.sdk.models.errors.ApplyUpdatesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.ApplyUpdatesRequest; +import dev.plexapi.sdk.models.operations.ApplyUpdatesResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class ApplyUpdates { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "applyUpdates", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "applyUpdates", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "applyUpdates", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/updater/apply"); + HTTPRequest req = new HTTPRequest(url, "PUT"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(ApplyUpdatesRequest request) throws Exception { + HttpRequest req = buildRequest(request, ApplyUpdatesRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(ApplyUpdatesRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "500", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public ApplyUpdatesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ApplyUpdatesResponse.Builder resBuilder = + ApplyUpdatesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ApplyUpdatesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ApplyUpdatesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ApplyUpdatesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(ApplyUpdatesRequest request) throws Exception { + HttpRequest req = buildRequest(request, ApplyUpdatesRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(ApplyUpdatesRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "500", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.ApplyUpdatesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.ApplyUpdatesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.ApplyUpdatesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.ApplyUpdatesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.ApplyUpdatesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "500", "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/CancelServerActivities.java b/src/main/java/dev/plexapi/sdk/operations/CancelServerActivities.java new file mode 100644 index 00000000..81bba6e7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/CancelServerActivities.java @@ -0,0 +1,330 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.CancelServerActivitiesBadRequest; +import dev.plexapi.sdk.models.errors.CancelServerActivitiesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.CancelServerActivitiesRequest; +import dev.plexapi.sdk.models.operations.CancelServerActivitiesResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class CancelServerActivities { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "cancelServerActivities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "cancelServerActivities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "cancelServerActivities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/activities/{activityUUID}", + request, null); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(CancelServerActivitiesRequest request) throws Exception { + HttpRequest req = buildRequest(request, CancelServerActivitiesRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(CancelServerActivitiesRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public CancelServerActivitiesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CancelServerActivitiesResponse.Builder resBuilder = + CancelServerActivitiesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CancelServerActivitiesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CancelServerActivitiesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CancelServerActivitiesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(CancelServerActivitiesRequest request) throws Exception { + HttpRequest req = buildRequest(request, CancelServerActivitiesRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(CancelServerActivitiesRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.CancelServerActivitiesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.CancelServerActivitiesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.CancelServerActivitiesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.CancelServerActivitiesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.CancelServerActivitiesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/CheckForUpdates.java b/src/main/java/dev/plexapi/sdk/operations/CheckForUpdates.java new file mode 100644 index 00000000..6ce738e1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/CheckForUpdates.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.CheckForUpdatesBadRequest; +import dev.plexapi.sdk.models.errors.CheckForUpdatesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.CheckForUpdatesRequest; +import dev.plexapi.sdk.models.operations.CheckForUpdatesResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class CheckForUpdates { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "checkForUpdates", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "checkForUpdates", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "checkForUpdates", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/updater/check"); + HTTPRequest req = new HTTPRequest(url, "PUT"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(CheckForUpdatesRequest request) throws Exception { + HttpRequest req = buildRequest(request, CheckForUpdatesRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(CheckForUpdatesRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public CheckForUpdatesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CheckForUpdatesResponse.Builder resBuilder = + CheckForUpdatesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CheckForUpdatesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CheckForUpdatesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CheckForUpdatesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(CheckForUpdatesRequest request) throws Exception { + HttpRequest req = buildRequest(request, CheckForUpdatesRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(CheckForUpdatesRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.CheckForUpdatesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.CheckForUpdatesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.CheckForUpdatesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.CheckForUpdatesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.CheckForUpdatesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/ClearPlaylistContents.java b/src/main/java/dev/plexapi/sdk/operations/ClearPlaylistContents.java new file mode 100644 index 00000000..0343e161 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/ClearPlaylistContents.java @@ -0,0 +1,330 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.ClearPlaylistContentsBadRequest; +import dev.plexapi.sdk.models.errors.ClearPlaylistContentsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.ClearPlaylistContentsRequest; +import dev.plexapi.sdk.models.operations.ClearPlaylistContentsResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class ClearPlaylistContents { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "clearPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "clearPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "clearPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/playlists/{playlistID}/items", + request, null); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(ClearPlaylistContentsRequest request) throws Exception { + HttpRequest req = buildRequest(request, ClearPlaylistContentsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(ClearPlaylistContentsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public ClearPlaylistContentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + ClearPlaylistContentsResponse.Builder resBuilder = + ClearPlaylistContentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + ClearPlaylistContentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ClearPlaylistContentsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + ClearPlaylistContentsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(ClearPlaylistContentsRequest request) throws Exception { + HttpRequest req = buildRequest(request, ClearPlaylistContentsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(ClearPlaylistContentsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.ClearPlaylistContentsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.ClearPlaylistContentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.ClearPlaylistContentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.ClearPlaylistContentsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.ClearPlaylistContentsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/CreatePlaylist.java b/src/main/java/dev/plexapi/sdk/operations/CreatePlaylist.java new file mode 100644 index 00000000..e8eccd6d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/CreatePlaylist.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.CreatePlaylistBadRequest; +import dev.plexapi.sdk.models.errors.CreatePlaylistUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.CreatePlaylistRequest; +import dev.plexapi.sdk.models.operations.CreatePlaylistResponse; +import dev.plexapi.sdk.models.operations.CreatePlaylistResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class CreatePlaylist { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "createPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "createPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "createPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/playlists"); + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(CreatePlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, CreatePlaylistRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(CreatePlaylistRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public CreatePlaylistResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + CreatePlaylistResponse.Builder resBuilder = + CreatePlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + CreatePlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CreatePlaylistResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CreatePlaylistBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + CreatePlaylistUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(CreatePlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, CreatePlaylistRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(CreatePlaylistRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.CreatePlaylistResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.CreatePlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.CreatePlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + CreatePlaylistResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.CreatePlaylistBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.CreatePlaylistUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/DeleteLibrary.java b/src/main/java/dev/plexapi/sdk/operations/DeleteLibrary.java new file mode 100644 index 00000000..172e2f62 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/DeleteLibrary.java @@ -0,0 +1,330 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.DeleteLibraryBadRequest; +import dev.plexapi.sdk.models.errors.DeleteLibraryUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.DeleteLibraryRequest; +import dev.plexapi.sdk.models.operations.DeleteLibraryResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class DeleteLibrary { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "deleteLibrary", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "deleteLibrary", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "deleteLibrary", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}", + request, null); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(DeleteLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, DeleteLibraryRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(DeleteLibraryRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public DeleteLibraryResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeleteLibraryResponse.Builder resBuilder = + DeleteLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeleteLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + DeleteLibraryBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + DeleteLibraryUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(DeleteLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, DeleteLibraryRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(DeleteLibraryRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.DeleteLibraryResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.DeleteLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.DeleteLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.DeleteLibraryBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.DeleteLibraryUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/DeletePlaylist.java b/src/main/java/dev/plexapi/sdk/operations/DeletePlaylist.java new file mode 100644 index 00000000..c82baec9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/DeletePlaylist.java @@ -0,0 +1,330 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.DeletePlaylistBadRequest; +import dev.plexapi.sdk.models.errors.DeletePlaylistUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.DeletePlaylistRequest; +import dev.plexapi.sdk.models.operations.DeletePlaylistResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class DeletePlaylist { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "deletePlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "deletePlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "deletePlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/playlists/{playlistID}", + request, null); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(DeletePlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, DeletePlaylistRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(DeletePlaylistRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public DeletePlaylistResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + DeletePlaylistResponse.Builder resBuilder = + DeletePlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + DeletePlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "204")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + DeletePlaylistBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + DeletePlaylistUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(DeletePlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, DeletePlaylistRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(DeletePlaylistRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.DeletePlaylistResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.DeletePlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.DeletePlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "204")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.DeletePlaylistBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.DeletePlaylistUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/EnablePaperTrail.java b/src/main/java/dev/plexapi/sdk/operations/EnablePaperTrail.java new file mode 100644 index 00000000..b9ebefda --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/EnablePaperTrail.java @@ -0,0 +1,327 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.EnablePaperTrailBadRequest; +import dev.plexapi.sdk.models.errors.EnablePaperTrailUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.EnablePaperTrailResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class EnablePaperTrail { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "enablePaperTrail", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "enablePaperTrail", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "enablePaperTrail", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/log/networked"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "403", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public EnablePaperTrailResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + EnablePaperTrailResponse.Builder resBuilder = + EnablePaperTrailResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + EnablePaperTrailResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + EnablePaperTrailBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + EnablePaperTrailUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "403", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.EnablePaperTrailResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.EnablePaperTrailResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.EnablePaperTrailResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.EnablePaperTrailBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.EnablePaperTrailUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "403", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetActorsLibrary.java b/src/main/java/dev/plexapi/sdk/operations/GetActorsLibrary.java new file mode 100644 index 00000000..a0927037 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetActorsLibrary.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetActorsLibraryBadRequest; +import dev.plexapi.sdk.models.errors.GetActorsLibraryUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetActorsLibraryRequest; +import dev.plexapi.sdk.models.operations.GetActorsLibraryResponse; +import dev.plexapi.sdk.models.operations.GetActorsLibraryResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetActorsLibrary { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-actors-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-actors-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-actors-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}/actor", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetActorsLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetActorsLibraryRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetActorsLibraryRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetActorsLibraryResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetActorsLibraryResponse.Builder resBuilder = + GetActorsLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetActorsLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetActorsLibraryResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetActorsLibraryBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetActorsLibraryUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetActorsLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetActorsLibraryRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetActorsLibraryRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetActorsLibraryResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetActorsLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetActorsLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetActorsLibraryResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetActorsLibraryBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetActorsLibraryUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetAllLibraries.java b/src/main/java/dev/plexapi/sdk/operations/GetAllLibraries.java new file mode 100644 index 00000000..e6676245 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetAllLibraries.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetAllLibrariesBadRequest; +import dev.plexapi.sdk.models.errors.GetAllLibrariesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetAllLibrariesResponse; +import dev.plexapi.sdk.models.operations.GetAllLibrariesResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetAllLibraries { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-all-libraries", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-all-libraries", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-all-libraries", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/library/sections"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetAllLibrariesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetAllLibrariesResponse.Builder resBuilder = + GetAllLibrariesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetAllLibrariesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetAllLibrariesResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetAllLibrariesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetAllLibrariesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetAllLibrariesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetAllLibrariesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetAllLibrariesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetAllLibrariesResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetAllLibrariesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetAllLibrariesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetAvailableClients.java b/src/main/java/dev/plexapi/sdk/operations/GetAvailableClients.java new file mode 100644 index 00000000..0388605d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetAvailableClients.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetAvailableClientsBadRequest; +import dev.plexapi.sdk.models.errors.GetAvailableClientsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetAvailableClientsResponse; +import dev.plexapi.sdk.models.operations.GetAvailableClientsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetAvailableClients { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getAvailableClients", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getAvailableClients", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getAvailableClients", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/clients"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetAvailableClientsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetAvailableClientsResponse.Builder resBuilder = + GetAvailableClientsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetAvailableClientsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetAvailableClientsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetAvailableClientsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetAvailableClientsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetAvailableClientsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetAvailableClientsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetAvailableClientsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetAvailableClientsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetAvailableClientsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetAvailableClientsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetBandwidthStatistics.java b/src/main/java/dev/plexapi/sdk/operations/GetBandwidthStatistics.java new file mode 100644 index 00000000..c12151b4 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetBandwidthStatistics.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetBandwidthStatisticsBadRequest; +import dev.plexapi.sdk.models.errors.GetBandwidthStatisticsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsRequest; +import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponse; +import dev.plexapi.sdk.models.operations.GetBandwidthStatisticsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetBandwidthStatistics { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getBandwidthStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getBandwidthStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getBandwidthStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/statistics/bandwidth"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetBandwidthStatisticsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetBandwidthStatisticsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetBandwidthStatisticsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetBandwidthStatisticsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetBandwidthStatisticsResponse.Builder resBuilder = + GetBandwidthStatisticsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetBandwidthStatisticsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetBandwidthStatisticsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetBandwidthStatisticsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetBandwidthStatisticsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetBandwidthStatisticsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetBandwidthStatisticsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetBandwidthStatisticsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetBandwidthStatisticsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetBandwidthStatisticsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetBandwidthStatisticsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetBandwidthStatisticsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetBandwidthStatisticsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetBandwidthStatisticsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetBannerImage.java b/src/main/java/dev/plexapi/sdk/operations/GetBannerImage.java new file mode 100644 index 00000000..42d7446c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetBannerImage.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetBannerImageBadRequest; +import dev.plexapi.sdk.models.errors.GetBannerImageUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetBannerImageRequest; +import dev.plexapi.sdk.models.operations.GetBannerImageResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetBannerImage { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-banner-image", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-banner-image", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-banner-image", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/metadata/{ratingKey}/banner", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "image/jpeg") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetBannerImageRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetBannerImageRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetBannerImageRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetBannerImageResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetBannerImageResponse.Builder resBuilder = + GetBannerImageResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + if (Utils.statusCodeMatches(response.statusCode(), "200") && Utils.contentTypeMatches(contentType, "image/jpeg")) { + resBuilder.responseStream(response.body()); + } + + GetBannerImageResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + res.withHeaders(response.headers().map()); + if (Utils.contentTypeMatches(contentType, "image/jpeg")) { + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetBannerImageBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetBannerImageUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetBannerImageRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetBannerImageRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetBannerImageRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetBannerImageResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetBannerImageResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + if (Utils.statusCodeMatches(response.statusCode(), "200") && Utils.contentTypeMatches(contentType, "image/jpeg")) { + resBuilder.responseStream(response.body()); + } + + dev.plexapi.sdk.models.operations.async.GetBannerImageResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + res.withHeaders(response.headers().map()); + if (Utils.contentTypeMatches(contentType, "image/jpeg")) { + return CompletableFuture.completedFuture(res); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetBannerImageBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetBannerImageUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetButlerTasks.java b/src/main/java/dev/plexapi/sdk/operations/GetButlerTasks.java new file mode 100644 index 00000000..cb3d9d5c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetButlerTasks.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetButlerTasksBadRequest; +import dev.plexapi.sdk.models.errors.GetButlerTasksUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetButlerTasksResponse; +import dev.plexapi.sdk.models.operations.GetButlerTasksResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetButlerTasks { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getButlerTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getButlerTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getButlerTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/butler"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetButlerTasksResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetButlerTasksResponse.Builder resBuilder = + GetButlerTasksResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetButlerTasksResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetButlerTasksResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetButlerTasksBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetButlerTasksUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetButlerTasksResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetButlerTasksResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetButlerTasksResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetButlerTasksResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetButlerTasksBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetButlerTasksUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetCompanionsData.java b/src/main/java/dev/plexapi/sdk/operations/GetCompanionsData.java new file mode 100644 index 00000000..fd6bedb2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetCompanionsData.java @@ -0,0 +1,366 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetCompanionsDataBadRequest; +import dev.plexapi.sdk.models.errors.GetCompanionsDataUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetCompanionsDataResponse; +import dev.plexapi.sdk.models.operations.ResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetCompanionsData { + + /** + * GET_COMPANIONS_DATA_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_COMPANIONS_DATA_SERVERS = { + "https://plex.tv/api/v2", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_COMPANIONS_DATA_SERVERS[0], + Map.of())); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getCompanionsData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getCompanionsData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getCompanionsData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/companions"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetCompanionsDataResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetCompanionsDataResponse.Builder resBuilder = + GetCompanionsDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetCompanionsDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + List out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withResponseBodies(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetCompanionsDataBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetCompanionsDataUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetCompanionsDataResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetCompanionsDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetCompanionsDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + List out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withResponseBodies(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetCompanionsDataBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetCompanionsDataUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetCountriesLibrary.java b/src/main/java/dev/plexapi/sdk/operations/GetCountriesLibrary.java new file mode 100644 index 00000000..60790a42 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetCountriesLibrary.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetCountriesLibraryBadRequest; +import dev.plexapi.sdk.models.errors.GetCountriesLibraryUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetCountriesLibraryRequest; +import dev.plexapi.sdk.models.operations.GetCountriesLibraryResponse; +import dev.plexapi.sdk.models.operations.GetCountriesLibraryResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetCountriesLibrary { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-countries-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-countries-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-countries-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}/country", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetCountriesLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetCountriesLibraryRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetCountriesLibraryRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetCountriesLibraryResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetCountriesLibraryResponse.Builder resBuilder = + GetCountriesLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetCountriesLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetCountriesLibraryResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetCountriesLibraryBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetCountriesLibraryUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetCountriesLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetCountriesLibraryRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetCountriesLibraryRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetCountriesLibraryResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetCountriesLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetCountriesLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetCountriesLibraryResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetCountriesLibraryBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetCountriesLibraryUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetDevices.java b/src/main/java/dev/plexapi/sdk/operations/GetDevices.java new file mode 100644 index 00000000..a6e68ec4 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetDevices.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetDevicesBadRequest; +import dev.plexapi.sdk.models.errors.GetDevicesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetDevicesResponse; +import dev.plexapi.sdk.models.operations.GetDevicesResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetDevices { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getDevices", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getDevices", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getDevices", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/devices"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetDevicesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetDevicesResponse.Builder resBuilder = + GetDevicesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetDevicesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDevicesResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDevicesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetDevicesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetDevicesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetDevicesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetDevicesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetDevicesResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetDevicesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetDevicesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetFileHash.java b/src/main/java/dev/plexapi/sdk/operations/GetFileHash.java new file mode 100644 index 00000000..79ff564e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetFileHash.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetFileHashBadRequest; +import dev.plexapi.sdk.models.errors.GetFileHashUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetFileHashRequest; +import dev.plexapi.sdk.models.operations.GetFileHashResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetFileHash { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getFileHash", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getFileHash", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getFileHash", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/library/hashes"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetFileHashRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetFileHashRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetFileHashRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetFileHashResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetFileHashResponse.Builder resBuilder = + GetFileHashResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetFileHashResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetFileHashBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetFileHashUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetFileHashRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetFileHashRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetFileHashRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetFileHashResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetFileHashResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetFileHashResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetFileHashBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetFileHashUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetGenresLibrary.java b/src/main/java/dev/plexapi/sdk/operations/GetGenresLibrary.java new file mode 100644 index 00000000..f10def1c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetGenresLibrary.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetGenresLibraryBadRequest; +import dev.plexapi.sdk.models.errors.GetGenresLibraryUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetGenresLibraryRequest; +import dev.plexapi.sdk.models.operations.GetGenresLibraryResponse; +import dev.plexapi.sdk.models.operations.GetGenresLibraryResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetGenresLibrary { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-genres-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-genres-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-genres-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}/genre", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetGenresLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetGenresLibraryRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetGenresLibraryRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetGenresLibraryResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetGenresLibraryResponse.Builder resBuilder = + GetGenresLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetGenresLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGenresLibraryResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGenresLibraryBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGenresLibraryUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetGenresLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetGenresLibraryRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetGenresLibraryRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetGenresLibraryResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetGenresLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetGenresLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetGenresLibraryResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetGenresLibraryBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetGenresLibraryUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetGeoData.java b/src/main/java/dev/plexapi/sdk/operations/GetGeoData.java new file mode 100644 index 00000000..be99841a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetGeoData.java @@ -0,0 +1,364 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetGeoDataBadRequest; +import dev.plexapi.sdk.models.errors.GetGeoDataUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetGeoDataGeoData; +import dev.plexapi.sdk.models.operations.GetGeoDataResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetGeoData { + + /** + * GET_GEO_DATA_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_GEO_DATA_SERVERS = { + "https://plex.tv/api/v2", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_GEO_DATA_SERVERS[0], + Map.of())); + this.securitySource = null; + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getGeoData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getGeoData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getGeoData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/geoip"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetGeoDataResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetGeoDataResponse.Builder resBuilder = + GetGeoDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetGeoDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGeoDataGeoData out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withGeoData(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGeoDataBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGeoDataUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetGeoDataResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetGeoDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetGeoDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetGeoDataGeoData out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withGeoData(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetGeoDataBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetGeoDataUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetGlobalHubs.java b/src/main/java/dev/plexapi/sdk/operations/GetGlobalHubs.java new file mode 100644 index 00000000..42ef4770 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetGlobalHubs.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetGlobalHubsBadRequest; +import dev.plexapi.sdk.models.errors.GetGlobalHubsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetGlobalHubsRequest; +import dev.plexapi.sdk.models.operations.GetGlobalHubsResponse; +import dev.plexapi.sdk.models.operations.GetGlobalHubsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetGlobalHubs { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getGlobalHubs", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getGlobalHubs", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getGlobalHubs", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/hubs"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetGlobalHubsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetGlobalHubsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetGlobalHubsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetGlobalHubsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetGlobalHubsResponse.Builder resBuilder = + GetGlobalHubsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetGlobalHubsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGlobalHubsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGlobalHubsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetGlobalHubsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetGlobalHubsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetGlobalHubsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetGlobalHubsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetGlobalHubsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetGlobalHubsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetGlobalHubsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetGlobalHubsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetGlobalHubsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetGlobalHubsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetHomeData.java b/src/main/java/dev/plexapi/sdk/operations/GetHomeData.java new file mode 100644 index 00000000..93bdad78 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetHomeData.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetHomeDataBadRequest; +import dev.plexapi.sdk.models.errors.GetHomeDataUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetHomeDataResponse; +import dev.plexapi.sdk.models.operations.GetHomeDataResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetHomeData { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getHomeData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getHomeData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getHomeData", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/home"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetHomeDataResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetHomeDataResponse.Builder resBuilder = + GetHomeDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetHomeDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetHomeDataResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetHomeDataBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetHomeDataUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetHomeDataResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetHomeDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetHomeDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetHomeDataResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetHomeDataBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetHomeDataUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetLibraryDetails.java b/src/main/java/dev/plexapi/sdk/operations/GetLibraryDetails.java new file mode 100644 index 00000000..870c7db1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetLibraryDetails.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetLibraryDetailsBadRequest; +import dev.plexapi.sdk.models.errors.GetLibraryDetailsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetLibraryDetailsRequest; +import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponse; +import dev.plexapi.sdk.models.operations.GetLibraryDetailsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetLibraryDetails { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-details", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-details", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-details", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetLibraryDetailsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetLibraryDetailsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetLibraryDetailsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetLibraryDetailsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetLibraryDetailsResponse.Builder resBuilder = + GetLibraryDetailsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetLibraryDetailsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryDetailsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryDetailsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryDetailsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetLibraryDetailsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetLibraryDetailsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetLibraryDetailsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetLibraryDetailsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetLibraryDetailsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetLibraryDetailsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetLibraryDetailsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetLibraryDetailsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetLibraryDetailsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetLibraryHubs.java b/src/main/java/dev/plexapi/sdk/operations/GetLibraryHubs.java new file mode 100644 index 00000000..18d87e33 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetLibraryHubs.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetLibraryHubsBadRequest; +import dev.plexapi.sdk.models.errors.GetLibraryHubsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetLibraryHubsRequest; +import dev.plexapi.sdk.models.operations.GetLibraryHubsResponse; +import dev.plexapi.sdk.models.operations.GetLibraryHubsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetLibraryHubs { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getLibraryHubs", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getLibraryHubs", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getLibraryHubs", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/hubs/sections/{sectionId}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetLibraryHubsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetLibraryHubsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetLibraryHubsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetLibraryHubsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetLibraryHubsResponse.Builder resBuilder = + GetLibraryHubsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetLibraryHubsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryHubsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryHubsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryHubsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetLibraryHubsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetLibraryHubsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetLibraryHubsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetLibraryHubsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetLibraryHubsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetLibraryHubsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetLibraryHubsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetLibraryHubsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetLibraryHubsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetLibraryItems.java b/src/main/java/dev/plexapi/sdk/operations/GetLibraryItems.java new file mode 100644 index 00000000..d4e52829 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetLibraryItems.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetLibraryItemsBadRequest; +import dev.plexapi.sdk.models.errors.GetLibraryItemsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetLibraryItemsRequest; +import dev.plexapi.sdk.models.operations.GetLibraryItemsResponse; +import dev.plexapi.sdk.models.operations.GetLibraryItemsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetLibraryItems { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-items", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-items", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-items", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}/{tag}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetLibraryItemsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetLibraryItemsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetLibraryItemsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetLibraryItemsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetLibraryItemsResponse.Builder resBuilder = + GetLibraryItemsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetLibraryItemsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryItemsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryItemsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibraryItemsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetLibraryItemsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetLibraryItemsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetLibraryItemsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetLibraryItemsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetLibraryItemsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetLibraryItemsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetLibraryItemsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetLibraryItemsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetLibraryItemsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetLibrarySectionsAll.java b/src/main/java/dev/plexapi/sdk/operations/GetLibrarySectionsAll.java new file mode 100644 index 00000000..612ef136 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetLibrarySectionsAll.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetLibrarySectionsAllBadRequest; +import dev.plexapi.sdk.models.errors.GetLibrarySectionsAllUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllRequest; +import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllResponse; +import dev.plexapi.sdk.models.operations.GetLibrarySectionsAllResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetLibrarySectionsAll { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-sections-all", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-sections-all", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-library-sections-all", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}/all", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetLibrarySectionsAllRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetLibrarySectionsAllRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetLibrarySectionsAllRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetLibrarySectionsAllResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetLibrarySectionsAllResponse.Builder resBuilder = + GetLibrarySectionsAllResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetLibrarySectionsAllResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibrarySectionsAllResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibrarySectionsAllBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetLibrarySectionsAllUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetLibrarySectionsAllRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetLibrarySectionsAllRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetLibrarySectionsAllRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetLibrarySectionsAllResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetLibrarySectionsAllResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetLibrarySectionsAllResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetLibrarySectionsAllResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetLibrarySectionsAllBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetLibrarySectionsAllUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetMediaArts.java b/src/main/java/dev/plexapi/sdk/operations/GetMediaArts.java new file mode 100644 index 00000000..811ad433 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetMediaArts.java @@ -0,0 +1,279 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetMediaArtsRequest; +import dev.plexapi.sdk.models.operations.GetMediaArtsResponse; +import dev.plexapi.sdk.models.operations.GetMediaArtsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetMediaArts { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-arts", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-arts", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-arts", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/metadata/{ratingKey}/arts", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetMediaArtsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetMediaArtsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetMediaArtsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetMediaArtsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetMediaArtsResponse.Builder resBuilder = + GetMediaArtsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetMediaArtsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMediaArtsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetMediaArtsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetMediaArtsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetMediaArtsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetMediaArtsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetMediaArtsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetMediaArtsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetMediaArtsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetMediaMetaData.java b/src/main/java/dev/plexapi/sdk/operations/GetMediaMetaData.java new file mode 100644 index 00000000..f75d0e39 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetMediaMetaData.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetMediaMetaDataBadRequest; +import dev.plexapi.sdk.models.errors.GetMediaMetaDataUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetMediaMetaDataRequest; +import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponse; +import dev.plexapi.sdk.models.operations.GetMediaMetaDataResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetMediaMetaData { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-meta-data", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-meta-data", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-meta-data", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/metadata/{ratingKey}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetMediaMetaDataRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetMediaMetaDataRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetMediaMetaDataRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetMediaMetaDataResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetMediaMetaDataResponse.Builder resBuilder = + GetMediaMetaDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetMediaMetaDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMediaMetaDataResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMediaMetaDataBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMediaMetaDataUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetMediaMetaDataRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetMediaMetaDataRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetMediaMetaDataRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetMediaMetaDataResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetMediaMetaDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetMediaMetaDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetMediaMetaDataResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetMediaMetaDataBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetMediaMetaDataUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetMediaPosters.java b/src/main/java/dev/plexapi/sdk/operations/GetMediaPosters.java new file mode 100644 index 00000000..cfd32a92 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetMediaPosters.java @@ -0,0 +1,279 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetMediaPostersRequest; +import dev.plexapi.sdk.models.operations.GetMediaPostersResponse; +import dev.plexapi.sdk.models.operations.GetMediaPostersResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetMediaPosters { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-posters", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-posters", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-posters", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/metadata/{ratingKey}/posters", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetMediaPostersRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetMediaPostersRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetMediaPostersRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetMediaPostersResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetMediaPostersResponse.Builder resBuilder = + GetMediaPostersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetMediaPostersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMediaPostersResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetMediaPostersRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetMediaPostersRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetMediaPostersRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetMediaPostersResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetMediaPostersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetMediaPostersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetMediaPostersResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetMediaProviders.java b/src/main/java/dev/plexapi/sdk/operations/GetMediaProviders.java new file mode 100644 index 00000000..cff7955b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetMediaProviders.java @@ -0,0 +1,356 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetMediaProvidersBadRequest; +import dev.plexapi.sdk.models.errors.GetMediaProvidersUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetMediaProvidersRequest; +import dev.plexapi.sdk.models.operations.GetMediaProvidersResponse; +import dev.plexapi.sdk.models.operations.GetMediaProvidersResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetMediaProviders { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-providers", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-providers", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-media-providers", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/media/providers"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetMediaProvidersRequest request) throws Exception { + HttpRequest req = buildRequest(request); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetMediaProvidersRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetMediaProvidersResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetMediaProvidersResponse.Builder resBuilder = + GetMediaProvidersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetMediaProvidersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMediaProvidersResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMediaProvidersBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMediaProvidersUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetMediaProvidersRequest request) throws Exception { + HttpRequest req = buildRequest(request); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetMediaProvidersRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetMediaProvidersResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetMediaProvidersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetMediaProvidersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetMediaProvidersResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetMediaProvidersBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetMediaProvidersUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetMetadataChildren.java b/src/main/java/dev/plexapi/sdk/operations/GetMetadataChildren.java new file mode 100644 index 00000000..57aacd6a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetMetadataChildren.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetMetadataChildrenBadRequest; +import dev.plexapi.sdk.models.errors.GetMetadataChildrenUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetMetadataChildrenRequest; +import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponse; +import dev.plexapi.sdk.models.operations.GetMetadataChildrenResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetMetadataChildren { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getMetadataChildren", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getMetadataChildren", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getMetadataChildren", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/metadata/{ratingKey}/children", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetMetadataChildrenRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetMetadataChildrenRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetMetadataChildrenRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetMetadataChildrenResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetMetadataChildrenResponse.Builder resBuilder = + GetMetadataChildrenResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetMetadataChildrenResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMetadataChildrenResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMetadataChildrenBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMetadataChildrenUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetMetadataChildrenRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetMetadataChildrenRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetMetadataChildrenRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetMetadataChildrenResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetMetadataChildrenResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetMetadataChildrenResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetMetadataChildrenResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetMetadataChildrenBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetMetadataChildrenUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetMyPlexAccount.java b/src/main/java/dev/plexapi/sdk/operations/GetMyPlexAccount.java new file mode 100644 index 00000000..fb7b3e09 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetMyPlexAccount.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetMyPlexAccountBadRequest; +import dev.plexapi.sdk.models.errors.GetMyPlexAccountUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetMyPlexAccountResponse; +import dev.plexapi.sdk.models.operations.GetMyPlexAccountResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetMyPlexAccount { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getMyPlexAccount", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getMyPlexAccount", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getMyPlexAccount", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/myplex/account"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetMyPlexAccountResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetMyPlexAccountResponse.Builder resBuilder = + GetMyPlexAccountResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetMyPlexAccountResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMyPlexAccountResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMyPlexAccountBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetMyPlexAccountUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetMyPlexAccountResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetMyPlexAccountResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetMyPlexAccountResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetMyPlexAccountResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetMyPlexAccountBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetMyPlexAccountUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetPin.java b/src/main/java/dev/plexapi/sdk/operations/GetPin.java new file mode 100644 index 00000000..eab1f9e1 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetPin.java @@ -0,0 +1,332 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetPinBadRequest; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetPinAuthPinContainer; +import dev.plexapi.sdk.models.operations.GetPinRequest; +import dev.plexapi.sdk.models.operations.GetPinResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetPin { + + /** + * GET_PIN_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_PIN_SERVERS = { + "https://plex.tv/api/v2", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_PIN_SERVERS[0], + Map.of())); + this.securitySource = null; + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPin", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPin", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPin", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/pins"); + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest(GetPinRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetPinRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetPinRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetPinResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetPinResponse.Builder resBuilder = + GetPinResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetPinResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPinAuthPinContainer out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAuthPinContainer(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPinBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest(GetPinRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetPinRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetPinRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetPinResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetPinResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetPinResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetPinAuthPinContainer out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withAuthPinContainer(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetPinBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetPlaylist.java b/src/main/java/dev/plexapi/sdk/operations/GetPlaylist.java new file mode 100644 index 00000000..63aa5cb3 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetPlaylist.java @@ -0,0 +1,357 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetPlaylistBadRequest; +import dev.plexapi.sdk.models.errors.GetPlaylistUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetPlaylistRequest; +import dev.plexapi.sdk.models.operations.GetPlaylistResponse; +import dev.plexapi.sdk.models.operations.GetPlaylistResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetPlaylist { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/playlists/{playlistID}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetPlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetPlaylistRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetPlaylistRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetPlaylistResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetPlaylistResponse.Builder resBuilder = + GetPlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetPlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetPlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetPlaylistRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetPlaylistRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetPlaylistResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetPlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetPlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetPlaylistResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetPlaylistBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetPlaylistUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetPlaylistContents.java b/src/main/java/dev/plexapi/sdk/operations/GetPlaylistContents.java new file mode 100644 index 00000000..3483768d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetPlaylistContents.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetPlaylistContentsBadRequest; +import dev.plexapi.sdk.models.errors.GetPlaylistContentsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetPlaylistContentsRequest; +import dev.plexapi.sdk.models.operations.GetPlaylistContentsResponse; +import dev.plexapi.sdk.models.operations.GetPlaylistContentsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetPlaylistContents { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylistContents", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/playlists/{playlistID}/items", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetPlaylistContentsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetPlaylistContentsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetPlaylistContentsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetPlaylistContentsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetPlaylistContentsResponse.Builder resBuilder = + GetPlaylistContentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetPlaylistContentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistContentsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistContentsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistContentsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetPlaylistContentsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetPlaylistContentsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetPlaylistContentsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetPlaylistContentsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetPlaylistContentsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetPlaylistContentsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetPlaylistContentsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetPlaylistContentsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetPlaylistContentsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetPlaylists.java b/src/main/java/dev/plexapi/sdk/operations/GetPlaylists.java new file mode 100644 index 00000000..a5a4e656 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetPlaylists.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetPlaylistsBadRequest; +import dev.plexapi.sdk.models.errors.GetPlaylistsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetPlaylistsRequest; +import dev.plexapi.sdk.models.operations.GetPlaylistsResponse; +import dev.plexapi.sdk.models.operations.GetPlaylistsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetPlaylists { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylists", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylists", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getPlaylists", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/playlists"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetPlaylistsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetPlaylistsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetPlaylistsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetPlaylistsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetPlaylistsResponse.Builder resBuilder = + GetPlaylistsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetPlaylistsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetPlaylistsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetPlaylistsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetPlaylistsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetPlaylistsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetPlaylistsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetPlaylistsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetPlaylistsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetPlaylistsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetPlaylistsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetPlaylistsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetRecentlyAdded.java b/src/main/java/dev/plexapi/sdk/operations/GetRecentlyAdded.java new file mode 100644 index 00000000..565ff1c9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetRecentlyAdded.java @@ -0,0 +1,282 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedRequest; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponse; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetRecentlyAdded { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-recently-added", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-recently-added", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-recently-added", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/hubs/home/recentlyAdded"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetRecentlyAddedRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetRecentlyAddedRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetRecentlyAddedRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetRecentlyAddedResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetRecentlyAddedResponse.Builder resBuilder = + GetRecentlyAddedResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetRecentlyAddedResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetRecentlyAddedResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetRecentlyAddedRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetRecentlyAddedRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetRecentlyAddedRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetRecentlyAddedResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetRecentlyAddedResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetRecentlyAddedResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetRecentlyAddedResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400", "401", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetRecentlyAddedLibrary.java b/src/main/java/dev/plexapi/sdk/operations/GetRecentlyAddedLibrary.java new file mode 100644 index 00000000..2e6873f7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetRecentlyAddedLibrary.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetRecentlyAddedLibraryBadRequest; +import dev.plexapi.sdk.models.errors.GetRecentlyAddedLibraryUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryRequest; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryResponse; +import dev.plexapi.sdk.models.operations.GetRecentlyAddedLibraryResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetRecentlyAddedLibrary { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-recently-added-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-recently-added-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-recently-added-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/library/recentlyAdded"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetRecentlyAddedLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetRecentlyAddedLibraryRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetRecentlyAddedLibraryRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetRecentlyAddedLibraryResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetRecentlyAddedLibraryResponse.Builder resBuilder = + GetRecentlyAddedLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetRecentlyAddedLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetRecentlyAddedLibraryResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetRecentlyAddedLibraryBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetRecentlyAddedLibraryUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetRecentlyAddedLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetRecentlyAddedLibraryRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetRecentlyAddedLibraryRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetRecentlyAddedLibraryResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetRecentlyAddedLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetRecentlyAddedLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetRecentlyAddedLibraryResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetRecentlyAddedLibraryBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetRecentlyAddedLibraryUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetRefreshLibraryMetadata.java b/src/main/java/dev/plexapi/sdk/operations/GetRefreshLibraryMetadata.java new file mode 100644 index 00000000..29a05feb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetRefreshLibraryMetadata.java @@ -0,0 +1,335 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataBadRequest; +import dev.plexapi.sdk.models.errors.GetRefreshLibraryMetadataUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataRequest; +import dev.plexapi.sdk.models.operations.GetRefreshLibraryMetadataResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetRefreshLibraryMetadata { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-refresh-library-metadata", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-refresh-library-metadata", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-refresh-library-metadata", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}/refresh", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetRefreshLibraryMetadataRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetRefreshLibraryMetadataRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetRefreshLibraryMetadataRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetRefreshLibraryMetadataResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetRefreshLibraryMetadataResponse.Builder resBuilder = + GetRefreshLibraryMetadataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetRefreshLibraryMetadataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetRefreshLibraryMetadataBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetRefreshLibraryMetadataUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetRefreshLibraryMetadataRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetRefreshLibraryMetadataRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetRefreshLibraryMetadataRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetRefreshLibraryMetadataResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetRefreshLibraryMetadataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetRefreshLibraryMetadataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetRefreshLibraryMetadataBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetRefreshLibraryMetadataUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetResizedPhoto.java b/src/main/java/dev/plexapi/sdk/operations/GetResizedPhoto.java new file mode 100644 index 00000000..94d80bfb --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetResizedPhoto.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetResizedPhotoBadRequest; +import dev.plexapi.sdk.models.errors.GetResizedPhotoUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetResizedPhotoRequest; +import dev.plexapi.sdk.models.operations.GetResizedPhotoResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetResizedPhoto { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getResizedPhoto", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getResizedPhoto", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getResizedPhoto", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/photo/:/transcode"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetResizedPhotoRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetResizedPhotoRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetResizedPhotoRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetResizedPhotoResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetResizedPhotoResponse.Builder resBuilder = + GetResizedPhotoResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetResizedPhotoResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetResizedPhotoBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetResizedPhotoUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetResizedPhotoRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetResizedPhotoRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetResizedPhotoRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetResizedPhotoResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetResizedPhotoResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetResizedPhotoResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetResizedPhotoBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetResizedPhotoUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetResourcesStatistics.java b/src/main/java/dev/plexapi/sdk/operations/GetResourcesStatistics.java new file mode 100644 index 00000000..ceda902d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetResourcesStatistics.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetResourcesStatisticsBadRequest; +import dev.plexapi.sdk.models.errors.GetResourcesStatisticsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetResourcesStatisticsRequest; +import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponse; +import dev.plexapi.sdk.models.operations.GetResourcesStatisticsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetResourcesStatistics { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getResourcesStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getResourcesStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getResourcesStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/statistics/resources"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetResourcesStatisticsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetResourcesStatisticsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetResourcesStatisticsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetResourcesStatisticsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetResourcesStatisticsResponse.Builder resBuilder = + GetResourcesStatisticsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetResourcesStatisticsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetResourcesStatisticsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetResourcesStatisticsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetResourcesStatisticsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetResourcesStatisticsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetResourcesStatisticsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetResourcesStatisticsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetResourcesStatisticsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetResourcesStatisticsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetResourcesStatisticsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetResourcesStatisticsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetResourcesStatisticsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetResourcesStatisticsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetSearchAllLibraries.java b/src/main/java/dev/plexapi/sdk/operations/GetSearchAllLibraries.java new file mode 100644 index 00000000..1397ec3b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetSearchAllLibraries.java @@ -0,0 +1,361 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesBadRequest; +import dev.plexapi.sdk.models.errors.GetSearchAllLibrariesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesRequest; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponse; +import dev.plexapi.sdk.models.operations.GetSearchAllLibrariesResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetSearchAllLibraries { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-search-all-libraries", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-search-all-libraries", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-search-all-libraries", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/library/search"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetSearchAllLibrariesRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSearchAllLibrariesRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetSearchAllLibrariesRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetSearchAllLibrariesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetSearchAllLibrariesResponse.Builder resBuilder = + GetSearchAllLibrariesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetSearchAllLibrariesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchAllLibrariesResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchAllLibrariesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchAllLibrariesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetSearchAllLibrariesRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSearchAllLibrariesRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetSearchAllLibrariesRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetSearchAllLibrariesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetSearchAllLibrariesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetSearchAllLibrariesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetSearchAllLibrariesResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSearchAllLibrariesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSearchAllLibrariesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetSearchLibrary.java b/src/main/java/dev/plexapi/sdk/operations/GetSearchLibrary.java new file mode 100644 index 00000000..40f52187 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetSearchLibrary.java @@ -0,0 +1,362 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetSearchLibraryBadRequest; +import dev.plexapi.sdk.models.errors.GetSearchLibraryUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetSearchLibraryRequest; +import dev.plexapi.sdk.models.operations.GetSearchLibraryResponse; +import dev.plexapi.sdk.models.operations.GetSearchLibraryResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetSearchLibrary { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-search-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-search-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-search-library", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/{sectionKey}/search", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetSearchLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSearchLibraryRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetSearchLibraryRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetSearchLibraryResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetSearchLibraryResponse.Builder resBuilder = + GetSearchLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetSearchLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchLibraryResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchLibraryBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchLibraryUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetSearchLibraryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSearchLibraryRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetSearchLibraryRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetSearchLibraryResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetSearchLibraryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetSearchLibraryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetSearchLibraryResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSearchLibraryBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSearchLibraryUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetSearchResults.java b/src/main/java/dev/plexapi/sdk/operations/GetSearchResults.java new file mode 100644 index 00000000..d343f502 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetSearchResults.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetSearchResultsBadRequest; +import dev.plexapi.sdk.models.errors.GetSearchResultsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetSearchResultsRequest; +import dev.plexapi.sdk.models.operations.GetSearchResultsResponse; +import dev.plexapi.sdk.models.operations.GetSearchResultsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetSearchResults { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSearchResults", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSearchResults", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSearchResults", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/search"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetSearchResultsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSearchResultsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetSearchResultsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetSearchResultsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetSearchResultsResponse.Builder resBuilder = + GetSearchResultsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetSearchResultsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchResultsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchResultsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSearchResultsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetSearchResultsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSearchResultsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetSearchResultsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetSearchResultsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetSearchResultsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetSearchResultsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetSearchResultsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSearchResultsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSearchResultsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetServerActivities.java b/src/main/java/dev/plexapi/sdk/operations/GetServerActivities.java new file mode 100644 index 00000000..ee3237bf --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetServerActivities.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetServerActivitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerActivitiesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetServerActivitiesResponse; +import dev.plexapi.sdk.models.operations.GetServerActivitiesResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetServerActivities { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerActivities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerActivities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerActivities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/activities"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetServerActivitiesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetServerActivitiesResponse.Builder resBuilder = + GetServerActivitiesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetServerActivitiesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerActivitiesResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerActivitiesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerActivitiesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetServerActivitiesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetServerActivitiesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetServerActivitiesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetServerActivitiesResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerActivitiesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerActivitiesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetServerCapabilities.java b/src/main/java/dev/plexapi/sdk/operations/GetServerCapabilities.java new file mode 100644 index 00000000..7c47dee5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetServerCapabilities.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerCapabilitiesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponse; +import dev.plexapi.sdk.models.operations.GetServerCapabilitiesResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetServerCapabilities { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerCapabilities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerCapabilities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerCapabilities", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetServerCapabilitiesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetServerCapabilitiesResponse.Builder resBuilder = + GetServerCapabilitiesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetServerCapabilitiesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerCapabilitiesResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerCapabilitiesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerCapabilitiesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetServerCapabilitiesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetServerCapabilitiesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetServerCapabilitiesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetServerCapabilitiesResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerCapabilitiesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerCapabilitiesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetServerIdentity.java b/src/main/java/dev/plexapi/sdk/operations/GetServerIdentity.java new file mode 100644 index 00000000..a359e950 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetServerIdentity.java @@ -0,0 +1,314 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetServerIdentityRequestTimeout; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetServerIdentityResponse; +import dev.plexapi.sdk.models.operations.GetServerIdentityResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetServerIdentity { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = null; + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-server-identity", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-server-identity", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-server-identity", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/identity"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "408", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetServerIdentityResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetServerIdentityResponse.Builder resBuilder = + GetServerIdentityResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetServerIdentityResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerIdentityResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "408")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerIdentityRequestTimeout out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "408", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetServerIdentityResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetServerIdentityResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetServerIdentityResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetServerIdentityResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "408")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerIdentityRequestTimeout out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetServerList.java b/src/main/java/dev/plexapi/sdk/operations/GetServerList.java new file mode 100644 index 00000000..c637d8c2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetServerList.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetServerListBadRequest; +import dev.plexapi.sdk.models.errors.GetServerListUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetServerListResponse; +import dev.plexapi.sdk.models.operations.GetServerListResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetServerList { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerList", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerList", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerList", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/servers"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetServerListResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetServerListResponse.Builder resBuilder = + GetServerListResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetServerListResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerListResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerListBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerListUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetServerListResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetServerListResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetServerListResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetServerListResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerListBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerListUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetServerPreferences.java b/src/main/java/dev/plexapi/sdk/operations/GetServerPreferences.java new file mode 100644 index 00000000..0eccf367 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetServerPreferences.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetServerPreferencesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerPreferencesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetServerPreferencesResponse; +import dev.plexapi.sdk.models.operations.GetServerPreferencesResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetServerPreferences { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerPreferences", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerPreferences", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getServerPreferences", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/:/prefs"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetServerPreferencesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetServerPreferencesResponse.Builder resBuilder = + GetServerPreferencesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetServerPreferencesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerPreferencesResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerPreferencesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerPreferencesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetServerPreferencesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetServerPreferencesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetServerPreferencesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetServerPreferencesResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerPreferencesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerPreferencesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetServerResources.java b/src/main/java/dev/plexapi/sdk/operations/GetServerResources.java new file mode 100644 index 00000000..ae30295f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetServerResources.java @@ -0,0 +1,373 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetServerResourcesBadRequest; +import dev.plexapi.sdk.models.errors.GetServerResourcesUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetServerResourcesRequest; +import dev.plexapi.sdk.models.operations.GetServerResourcesResponse; +import dev.plexapi.sdk.models.operations.PlexDevice; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetServerResources { + + /** + * GET_SERVER_RESOURCES_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_SERVER_RESOURCES_SERVERS = { + "https://plex.tv/api/v2", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_SERVER_RESOURCES_SERVERS[0], + Map.of())); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-server-resources", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-server-resources", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-server-resources", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/resources"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest(GetServerResourcesRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetServerResourcesRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetServerResourcesRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetServerResourcesResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetServerResourcesResponse.Builder resBuilder = + GetServerResourcesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetServerResourcesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + List out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withPlexDevices(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerResourcesBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetServerResourcesUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest(GetServerResourcesRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetServerResourcesRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetServerResourcesRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetServerResourcesResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetServerResourcesResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetServerResourcesResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + List out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withPlexDevices(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerResourcesBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetServerResourcesUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetSessionHistory.java b/src/main/java/dev/plexapi/sdk/operations/GetSessionHistory.java new file mode 100644 index 00000000..f440ce1a --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetSessionHistory.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetSessionHistoryBadRequest; +import dev.plexapi.sdk.models.errors.GetSessionHistoryUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetSessionHistoryRequest; +import dev.plexapi.sdk.models.operations.GetSessionHistoryResponse; +import dev.plexapi.sdk.models.operations.GetSessionHistoryResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetSessionHistory { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSessionHistory", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSessionHistory", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSessionHistory", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/status/sessions/history/all"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetSessionHistoryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSessionHistoryRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetSessionHistoryRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetSessionHistoryResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetSessionHistoryResponse.Builder resBuilder = + GetSessionHistoryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetSessionHistoryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSessionHistoryResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSessionHistoryBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSessionHistoryUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetSessionHistoryRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSessionHistoryRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetSessionHistoryRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetSessionHistoryResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetSessionHistoryResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetSessionHistoryResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetSessionHistoryResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSessionHistoryBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSessionHistoryUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetSessions.java b/src/main/java/dev/plexapi/sdk/operations/GetSessions.java new file mode 100644 index 00000000..075ae688 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetSessions.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetSessionsBadRequest; +import dev.plexapi.sdk.models.errors.GetSessionsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetSessionsResponse; +import dev.plexapi.sdk.models.operations.GetSessionsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetSessions { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSessions", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSessions", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSessions", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/status/sessions"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetSessionsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetSessionsResponse.Builder resBuilder = + GetSessionsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetSessionsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSessionsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSessionsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSessionsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetSessionsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetSessionsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetSessionsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetSessionsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSessionsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSessionsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetSourceConnectionInformation.java b/src/main/java/dev/plexapi/sdk/operations/GetSourceConnectionInformation.java new file mode 100644 index 00000000..f084eb5f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetSourceConnectionInformation.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationBadRequest; +import dev.plexapi.sdk.models.errors.GetSourceConnectionInformationUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationRequest; +import dev.plexapi.sdk.models.operations.GetSourceConnectionInformationResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetSourceConnectionInformation { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSourceConnectionInformation", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSourceConnectionInformation", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getSourceConnectionInformation", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/security/resources"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetSourceConnectionInformationRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSourceConnectionInformationRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetSourceConnectionInformationRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetSourceConnectionInformationResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetSourceConnectionInformationResponse.Builder resBuilder = + GetSourceConnectionInformationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetSourceConnectionInformationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSourceConnectionInformationBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetSourceConnectionInformationUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetSourceConnectionInformationRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetSourceConnectionInformationRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetSourceConnectionInformationRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetSourceConnectionInformationResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetSourceConnectionInformationResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetSourceConnectionInformationResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSourceConnectionInformationBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetSourceConnectionInformationUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetStatistics.java b/src/main/java/dev/plexapi/sdk/operations/GetStatistics.java new file mode 100644 index 00000000..823cda6b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetStatistics.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetStatisticsBadRequest; +import dev.plexapi.sdk.models.errors.GetStatisticsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetStatisticsRequest; +import dev.plexapi.sdk.models.operations.GetStatisticsResponse; +import dev.plexapi.sdk.models.operations.GetStatisticsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetStatistics { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getStatistics", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/statistics/media"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetStatisticsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetStatisticsRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetStatisticsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetStatisticsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetStatisticsResponse.Builder resBuilder = + GetStatisticsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetStatisticsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetStatisticsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetStatisticsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetStatisticsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetStatisticsRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetStatisticsRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetStatisticsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetStatisticsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetStatisticsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetStatisticsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetStatisticsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetStatisticsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetStatisticsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetThumbImage.java b/src/main/java/dev/plexapi/sdk/operations/GetThumbImage.java new file mode 100644 index 00000000..446c78d6 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetThumbImage.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetThumbImageBadRequest; +import dev.plexapi.sdk.models.errors.GetThumbImageUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetThumbImageRequest; +import dev.plexapi.sdk.models.operations.GetThumbImageResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetThumbImage { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-thumb-image", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-thumb-image", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-thumb-image", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/metadata/{ratingKey}/thumb", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "image/jpeg") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetThumbImageRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetThumbImageRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetThumbImageRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetThumbImageResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetThumbImageResponse.Builder resBuilder = + GetThumbImageResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + if (Utils.statusCodeMatches(response.statusCode(), "200") && Utils.contentTypeMatches(contentType, "image/jpeg")) { + resBuilder.responseStream(response.body()); + } + + GetThumbImageResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + res.withHeaders(response.headers().map()); + if (Utils.contentTypeMatches(contentType, "image/jpeg")) { + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetThumbImageBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetThumbImageUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetThumbImageRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetThumbImageRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetThumbImageRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetThumbImageResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetThumbImageResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + if (Utils.statusCodeMatches(response.statusCode(), "200") && Utils.contentTypeMatches(contentType, "image/jpeg")) { + resBuilder.responseStream(response.body()); + } + + dev.plexapi.sdk.models.operations.async.GetThumbImageResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + res.withHeaders(response.headers().map()); + if (Utils.contentTypeMatches(contentType, "image/jpeg")) { + return CompletableFuture.completedFuture(res); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetThumbImageBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetThumbImageUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetTimeline.java b/src/main/java/dev/plexapi/sdk/operations/GetTimeline.java new file mode 100644 index 00000000..8fd95a4f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetTimeline.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetTimelineBadRequest; +import dev.plexapi.sdk.models.errors.GetTimelineUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetTimelineRequest; +import dev.plexapi.sdk.models.operations.GetTimelineResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetTimeline { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTimeline", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTimeline", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTimeline", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/:/timeline"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetTimelineRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetTimelineRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetTimelineRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetTimelineResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetTimelineResponse.Builder resBuilder = + GetTimelineResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetTimelineResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTimelineBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTimelineUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetTimelineRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetTimelineRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetTimelineRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetTimelineResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetTimelineResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetTimelineResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTimelineBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTimelineUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetTokenByPinId.java b/src/main/java/dev/plexapi/sdk/operations/GetTokenByPinId.java new file mode 100644 index 00000000..2bcb25f8 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetTokenByPinId.java @@ -0,0 +1,368 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetTokenByPinIdBadRequest; +import dev.plexapi.sdk.models.errors.GetTokenByPinIdResponseBody; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetTokenByPinIdAuthPinContainer; +import dev.plexapi.sdk.models.operations.GetTokenByPinIdRequest; +import dev.plexapi.sdk.models.operations.GetTokenByPinIdResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetTokenByPinId { + + /** + * GET_TOKEN_BY_PIN_ID_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_TOKEN_BY_PIN_ID_SERVERS = { + "https://plex.tv/api/v2", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_TOKEN_BY_PIN_ID_SERVERS[0], + Map.of())); + this.securitySource = null; + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTokenByPinId", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTokenByPinId", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTokenByPinId", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/pins/{pinID}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest(GetTokenByPinIdRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetTokenByPinIdRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetTokenByPinIdRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetTokenByPinIdResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetTokenByPinIdResponse.Builder resBuilder = + GetTokenByPinIdResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetTokenByPinIdResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTokenByPinIdAuthPinContainer out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withAuthPinContainer(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTokenByPinIdBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTokenByPinIdResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest(GetTokenByPinIdRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetTokenByPinIdRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetTokenByPinIdRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetTokenByPinIdResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetTokenByPinIdResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetTokenByPinIdResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetTokenByPinIdAuthPinContainer out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withAuthPinContainer(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTokenByPinIdBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTokenByPinIdResponseBody out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetTokenDetails.java b/src/main/java/dev/plexapi/sdk/operations/GetTokenDetails.java new file mode 100644 index 00000000..ca9cebc7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetTokenDetails.java @@ -0,0 +1,365 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetTokenDetailsBadRequest; +import dev.plexapi.sdk.models.errors.GetTokenDetailsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetTokenDetailsResponse; +import dev.plexapi.sdk.models.operations.GetTokenDetailsUserPlexAccount; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetTokenDetails { + + /** + * GET_TOKEN_DETAILS_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_TOKEN_DETAILS_SERVERS = { + "https://plex.tv/api/v2", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_TOKEN_DETAILS_SERVERS[0], + Map.of())); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTokenDetails", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTokenDetails", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTokenDetails", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/user"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetTokenDetailsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetTokenDetailsResponse.Builder resBuilder = + GetTokenDetailsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetTokenDetailsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTokenDetailsUserPlexAccount out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withUserPlexAccount(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTokenDetailsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTokenDetailsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetTokenDetailsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetTokenDetailsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetTokenDetailsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetTokenDetailsUserPlexAccount out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withUserPlexAccount(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTokenDetailsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTokenDetailsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetTopWatchedContent.java b/src/main/java/dev/plexapi/sdk/operations/GetTopWatchedContent.java new file mode 100644 index 00000000..8a981a3b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetTopWatchedContent.java @@ -0,0 +1,360 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetTopWatchedContentBadRequest; +import dev.plexapi.sdk.models.errors.GetTopWatchedContentUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentRequest; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponse; +import dev.plexapi.sdk.models.operations.GetTopWatchedContentResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetTopWatchedContent { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTopWatchedContent", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTopWatchedContent", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTopWatchedContent", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/library/all/top"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetTopWatchedContentRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetTopWatchedContentRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetTopWatchedContentRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetTopWatchedContentResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetTopWatchedContentResponse.Builder resBuilder = + GetTopWatchedContentResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetTopWatchedContentResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTopWatchedContentResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTopWatchedContentBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTopWatchedContentUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetTopWatchedContentRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetTopWatchedContentRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetTopWatchedContentRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetTopWatchedContentResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetTopWatchedContentResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetTopWatchedContentResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetTopWatchedContentResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTopWatchedContentBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTopWatchedContentUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetTranscodeSessions.java b/src/main/java/dev/plexapi/sdk/operations/GetTranscodeSessions.java new file mode 100644 index 00000000..b4d604e7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetTranscodeSessions.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetTranscodeSessionsBadRequest; +import dev.plexapi.sdk.models.errors.GetTranscodeSessionsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponse; +import dev.plexapi.sdk.models.operations.GetTranscodeSessionsResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetTranscodeSessions { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTranscodeSessions", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTranscodeSessions", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTranscodeSessions", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/transcode/sessions"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetTranscodeSessionsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetTranscodeSessionsResponse.Builder resBuilder = + GetTranscodeSessionsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetTranscodeSessionsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTranscodeSessionsResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTranscodeSessionsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTranscodeSessionsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetTranscodeSessionsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetTranscodeSessionsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetTranscodeSessionsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetTranscodeSessionsResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTranscodeSessionsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTranscodeSessionsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetTransientToken.java b/src/main/java/dev/plexapi/sdk/operations/GetTransientToken.java new file mode 100644 index 00000000..804c4792 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetTransientToken.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetTransientTokenBadRequest; +import dev.plexapi.sdk.models.errors.GetTransientTokenUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetTransientTokenRequest; +import dev.plexapi.sdk.models.operations.GetTransientTokenResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetTransientToken { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTransientToken", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTransientToken", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getTransientToken", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/security/token"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(GetTransientTokenRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetTransientTokenRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetTransientTokenRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetTransientTokenResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetTransientTokenResponse.Builder resBuilder = + GetTransientTokenResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetTransientTokenResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTransientTokenBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetTransientTokenUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(GetTransientTokenRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetTransientTokenRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetTransientTokenRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetTransientTokenResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetTransientTokenResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetTransientTokenResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTransientTokenBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetTransientTokenUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetUpdateStatus.java b/src/main/java/dev/plexapi/sdk/operations/GetUpdateStatus.java new file mode 100644 index 00000000..65a7d002 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetUpdateStatus.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetUpdateStatusBadRequest; +import dev.plexapi.sdk.models.errors.GetUpdateStatusUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetUpdateStatusResponse; +import dev.plexapi.sdk.models.operations.GetUpdateStatusResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetUpdateStatus { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getUpdateStatus", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getUpdateStatus", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getUpdateStatus", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/updater/status"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetUpdateStatusResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetUpdateStatusResponse.Builder resBuilder = + GetUpdateStatusResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetUpdateStatusResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetUpdateStatusResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetUpdateStatusBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetUpdateStatusUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetUpdateStatusResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetUpdateStatusResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetUpdateStatusResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetUpdateStatusResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetUpdateStatusBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetUpdateStatusUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetUserFriends.java b/src/main/java/dev/plexapi/sdk/operations/GetUserFriends.java new file mode 100644 index 00000000..33af8b4d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetUserFriends.java @@ -0,0 +1,366 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetUserFriendsBadRequest; +import dev.plexapi.sdk.models.errors.GetUserFriendsUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.Friend; +import dev.plexapi.sdk.models.operations.GetUserFriendsResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetUserFriends { + + /** + * GET_USER_FRIENDS_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_USER_FRIENDS_SERVERS = { + "https://plex.tv/api/v2", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_USER_FRIENDS_SERVERS[0], + Map.of())); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getUserFriends", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getUserFriends", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "getUserFriends", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/friends"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetUserFriendsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetUserFriendsResponse.Builder resBuilder = + GetUserFriendsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetUserFriendsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + List out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withFriends(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetUserFriendsBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetUserFriendsUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetUserFriendsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetUserFriendsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetUserFriendsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + List out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withFriends(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetUserFriendsBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetUserFriendsUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetUsers.java b/src/main/java/dev/plexapi/sdk/operations/GetUsers.java new file mode 100644 index 00000000..821680d7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetUsers.java @@ -0,0 +1,349 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetUsersBadRequest; +import dev.plexapi.sdk.models.errors.GetUsersUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetUsersRequest; +import dev.plexapi.sdk.models.operations.GetUsersResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetUsers { + + /** + * GET_USERS_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_USERS_SERVERS = { + "https://plex.tv/api", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_USERS_SERVERS[0], + Map.of())); + this.securitySource = null; + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-users", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-users", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-users", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/users"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/xml") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest(GetUsersRequest request) throws Exception { + HttpRequest req = buildRequest(request); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetUsersRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetUsersResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetUsersResponse.Builder resBuilder = + GetUsersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetUsersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/xml")) { + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetUsersBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetUsersUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest(GetUsersRequest request) throws Exception { + HttpRequest req = buildRequest(request); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetUsersRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetUsersResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetUsersResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetUsersResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/xml")) { + return CompletableFuture.completedFuture(res); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetUsersBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetUsersUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/GetWatchList.java b/src/main/java/dev/plexapi/sdk/operations/GetWatchList.java new file mode 100644 index 00000000..bf2083ff --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/GetWatchList.java @@ -0,0 +1,377 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.GetWatchListBadRequest; +import dev.plexapi.sdk.models.errors.GetWatchListUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.GetWatchListRequest; +import dev.plexapi.sdk.models.operations.GetWatchListResponse; +import dev.plexapi.sdk.models.operations.GetWatchListResponseBody; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class GetWatchList { + + /** + * GET_WATCH_LIST_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] GET_WATCH_LIST_SERVERS = { + /** + * The plex discover provider server + */ + "https://discover.provider.plex.tv", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + GET_WATCH_LIST_SERVERS[0], + Map.of())); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-watch-list", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-watch-list", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "get-watch-list", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/sections/watchlist/{filter}", + request, null); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest(GetWatchListRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetWatchListRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(GetWatchListRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public GetWatchListResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + GetWatchListResponse.Builder resBuilder = + GetWatchListResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + GetWatchListResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetWatchListResponseBody out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withObject(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetWatchListBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + GetWatchListUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest(GetWatchListRequest request) throws Exception { + HttpRequest req = buildRequest(request, GetWatchListRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(GetWatchListRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.GetWatchListResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.GetWatchListResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.GetWatchListResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + GetWatchListResponseBody out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withObject(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetWatchListBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.GetWatchListUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/LogLine.java b/src/main/java/dev/plexapi/sdk/operations/LogLine.java new file mode 100644 index 00000000..2bf98558 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/LogLine.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.LogLineBadRequest; +import dev.plexapi.sdk.models.errors.LogLineUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.LogLineRequest; +import dev.plexapi.sdk.models.operations.LogLineResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class LogLine { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "logLine", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "logLine", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "logLine", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/log"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(LogLineRequest request) throws Exception { + HttpRequest req = buildRequest(request, LogLineRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(LogLineRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public LogLineResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + LogLineResponse.Builder resBuilder = + LogLineResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + LogLineResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + LogLineBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + LogLineUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(LogLineRequest request) throws Exception { + HttpRequest req = buildRequest(request, LogLineRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(LogLineRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.LogLineResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.LogLineResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.LogLineResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.LogLineBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.LogLineUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/LogMultiLine.java b/src/main/java/dev/plexapi/sdk/operations/LogMultiLine.java new file mode 100644 index 00000000..ef3b5466 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/LogMultiLine.java @@ -0,0 +1,343 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.LogMultiLineBadRequest; +import dev.plexapi.sdk.models.errors.LogMultiLineUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.LogMultiLineResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.SerializedBody; +import dev.plexapi.sdk.utils.Utils.JsonShape; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class LogMultiLine { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "logMultiLine", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "logMultiLine", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "logMultiLine", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/log"); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "request", + "string", + false); + if (serializedRequestBody == null) { + throw new Exception("Request body is required"); + } + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(String request) throws Exception { + HttpRequest req = buildRequest(request, new TypeReference() {}); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(String request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public LogMultiLineResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + LogMultiLineResponse.Builder resBuilder = + LogMultiLineResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + LogMultiLineResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + LogMultiLineBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + LogMultiLineUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(String request) throws Exception { + HttpRequest req = buildRequest(request, new TypeReference() {}); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(String request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.LogMultiLineResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.LogMultiLineResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.LogMultiLineResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.LogMultiLineBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.LogMultiLineUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/MarkPlayed.java b/src/main/java/dev/plexapi/sdk/operations/MarkPlayed.java new file mode 100644 index 00000000..476a4f3c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/MarkPlayed.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.MarkPlayedBadRequest; +import dev.plexapi.sdk.models.errors.MarkPlayedUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.MarkPlayedRequest; +import dev.plexapi.sdk.models.operations.MarkPlayedResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class MarkPlayed { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "markPlayed", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "markPlayed", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "markPlayed", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/:/scrobble"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(MarkPlayedRequest request) throws Exception { + HttpRequest req = buildRequest(request, MarkPlayedRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(MarkPlayedRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public MarkPlayedResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + MarkPlayedResponse.Builder resBuilder = + MarkPlayedResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + MarkPlayedResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + MarkPlayedBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + MarkPlayedUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(MarkPlayedRequest request) throws Exception { + HttpRequest req = buildRequest(request, MarkPlayedRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(MarkPlayedRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.MarkPlayedResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.MarkPlayedResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.MarkPlayedResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.MarkPlayedBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.MarkPlayedUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/MarkUnplayed.java b/src/main/java/dev/plexapi/sdk/operations/MarkUnplayed.java new file mode 100644 index 00000000..9650d92d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/MarkUnplayed.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.MarkUnplayedBadRequest; +import dev.plexapi.sdk.models.errors.MarkUnplayedUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.MarkUnplayedRequest; +import dev.plexapi.sdk.models.operations.MarkUnplayedResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class MarkUnplayed { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "markUnplayed", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "markUnplayed", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "markUnplayed", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/:/unscrobble"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(MarkUnplayedRequest request) throws Exception { + HttpRequest req = buildRequest(request, MarkUnplayedRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(MarkUnplayedRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public MarkUnplayedResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + MarkUnplayedResponse.Builder resBuilder = + MarkUnplayedResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + MarkUnplayedResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + MarkUnplayedBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + MarkUnplayedUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(MarkUnplayedRequest request) throws Exception { + HttpRequest req = buildRequest(request, MarkUnplayedRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(MarkUnplayedRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.MarkUnplayedResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.MarkUnplayedResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.MarkUnplayedResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.MarkUnplayedBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.MarkUnplayedUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/Operations.java b/src/main/java/dev/plexapi/sdk/operations/Operations.java new file mode 100644 index 00000000..ce6a3017 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/Operations.java @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import dev.plexapi.sdk.utils.Blob; + +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.concurrent.CompletableFuture; + +// Internal API only + +public class Operations { + /** + * Base interface for all operations + */ + public interface Operation { + ResT handleResponse(HttpResponse response) throws Exception; + } + + /** + * Interface for operations that require a request parameter + */ + public interface RequestOperation extends Operation { + HttpResponse doRequest(ReqT request) throws Exception; + } + + /** + * Interface for operations that don't require a request parameter + */ + public interface RequestlessOperation extends Operation { + HttpResponse doRequest() throws Exception; + } + + /** + * Base interface for all async operations + */ + public interface AsyncOperation { + CompletableFuture handleResponse(HttpResponse response); + } + + /** + * Interface for async operations that require a request parameter + */ + public interface AsyncRequestOperation extends AsyncOperation { + CompletableFuture> doRequest(ReqT request); + } + + /** + * Interface for async operations that don't require a request parameter + */ + public interface AsyncRequestlessOperation extends AsyncOperation { + CompletableFuture> doRequest(); + } +} \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/operations/PerformSearch.java b/src/main/java/dev/plexapi/sdk/operations/PerformSearch.java new file mode 100644 index 00000000..99ae86f7 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/PerformSearch.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.PerformSearchBadRequest; +import dev.plexapi.sdk.models.errors.PerformSearchUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.PerformSearchRequest; +import dev.plexapi.sdk.models.operations.PerformSearchResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class PerformSearch { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "performSearch", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "performSearch", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "performSearch", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/hubs/search"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(PerformSearchRequest request) throws Exception { + HttpRequest req = buildRequest(request, PerformSearchRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(PerformSearchRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public PerformSearchResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PerformSearchResponse.Builder resBuilder = + PerformSearchResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PerformSearchResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PerformSearchBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PerformSearchUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(PerformSearchRequest request) throws Exception { + HttpRequest req = buildRequest(request, PerformSearchRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(PerformSearchRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.PerformSearchResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.PerformSearchResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.PerformSearchResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.PerformSearchBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.PerformSearchUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/PerformVoiceSearch.java b/src/main/java/dev/plexapi/sdk/operations/PerformVoiceSearch.java new file mode 100644 index 00000000..49f324ee --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/PerformVoiceSearch.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.PerformVoiceSearchBadRequest; +import dev.plexapi.sdk.models.errors.PerformVoiceSearchUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.PerformVoiceSearchRequest; +import dev.plexapi.sdk.models.operations.PerformVoiceSearchResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class PerformVoiceSearch { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "performVoiceSearch", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "performVoiceSearch", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "performVoiceSearch", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/hubs/search/voice"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(PerformVoiceSearchRequest request) throws Exception { + HttpRequest req = buildRequest(request, PerformVoiceSearchRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(PerformVoiceSearchRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public PerformVoiceSearchResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PerformVoiceSearchResponse.Builder resBuilder = + PerformVoiceSearchResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PerformVoiceSearchResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PerformVoiceSearchBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PerformVoiceSearchUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(PerformVoiceSearchRequest request) throws Exception { + HttpRequest req = buildRequest(request, PerformVoiceSearchRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(PerformVoiceSearchRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.PerformVoiceSearchResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.PerformVoiceSearchResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.PerformVoiceSearchResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.PerformVoiceSearchBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.PerformVoiceSearchUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/PostMediaArts.java b/src/main/java/dev/plexapi/sdk/operations/PostMediaArts.java new file mode 100644 index 00000000..b547b40c --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/PostMediaArts.java @@ -0,0 +1,269 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.PostMediaArtsRequest; +import dev.plexapi.sdk.models.operations.PostMediaArtsResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.SerializedBody; +import dev.plexapi.sdk.utils.Utils.JsonShape; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class PostMediaArts { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-media-arts", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-media-arts", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-media-arts", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/metadata/{ratingKey}/arts", + request, null); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "requestBody", + "raw", + false); + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(PostMediaArtsRequest request) throws Exception { + HttpRequest req = buildRequest(request, PostMediaArtsRequest.class, new TypeReference() {}); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(PostMediaArtsRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public PostMediaArtsResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostMediaArtsResponse.Builder resBuilder = + PostMediaArtsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostMediaArtsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(PostMediaArtsRequest request) throws Exception { + HttpRequest req = buildRequest(request, PostMediaArtsRequest.class, new TypeReference() {}); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(PostMediaArtsRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.PostMediaArtsResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.PostMediaArtsResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.PostMediaArtsResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/PostMediaPoster.java b/src/main/java/dev/plexapi/sdk/operations/PostMediaPoster.java new file mode 100644 index 00000000..af26cea5 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/PostMediaPoster.java @@ -0,0 +1,269 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.PostMediaPosterRequest; +import dev.plexapi.sdk.models.operations.PostMediaPosterResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.SerializedBody; +import dev.plexapi.sdk.utils.Utils.JsonShape; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class PostMediaPoster { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-media-poster", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-media-poster", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-media-poster", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/library/metadata/{ratingKey}/posters", + request, null); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "requestBody", + "raw", + false); + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "*/*") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(PostMediaPosterRequest request) throws Exception { + HttpRequest req = buildRequest(request, PostMediaPosterRequest.class, new TypeReference() {}); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(PostMediaPosterRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public PostMediaPosterResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostMediaPosterResponse.Builder resBuilder = + PostMediaPosterResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostMediaPosterResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(PostMediaPosterRequest request) throws Exception { + HttpRequest req = buildRequest(request, PostMediaPosterRequest.class, new TypeReference() {}); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(PostMediaPosterRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.PostMediaPosterResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.PostMediaPosterResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.PostMediaPosterResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/PostUsersSignInData.java b/src/main/java/dev/plexapi/sdk/operations/PostUsersSignInData.java new file mode 100644 index 00000000..0ad17a58 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/PostUsersSignInData.java @@ -0,0 +1,379 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +import dev.plexapi.sdk.models.errors.PostUsersSignInDataBadRequest; +import dev.plexapi.sdk.models.errors.PostUsersSignInDataUnauthorized; +import dev.plexapi.sdk.models.errors.SDKError; +import dev.plexapi.sdk.models.operations.PostUsersSignInDataRequest; +import dev.plexapi.sdk.models.operations.PostUsersSignInDataResponse; +import dev.plexapi.sdk.models.operations.PostUsersSignInDataUserPlexAccount; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.SerializedBody; +import dev.plexapi.sdk.utils.Utils.JsonShape; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.Object; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class PostUsersSignInData { + + /** + * POST_USERS_SIGN_IN_DATA_SERVERS contains the list of server urls available to the SDK. + */ + public static final String[] POST_USERS_SIGN_IN_DATA_SERVERS = { + "https://plex.tv/api/v2", + }; + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration, Optional serverURL) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = serverURL + .filter(u -> !u.isBlank()) + .orElse(Utils.templateUrl( + POST_USERS_SIGN_IN_DATA_SERVERS[0], + Map.of())); + this.securitySource = null; + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-users-sign-in-data", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-users-sign-in-data", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "post-users-sign-in-data", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/users/signin"); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "requestBody", + "form", + false); + req.setBody(Optional.ofNullable(serializedRequestBody)); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + req.addHeaders(Utils.getHeadersFromMetadata(request, null)); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private HttpRequest onBuildRequest(PostUsersSignInDataRequest request) throws Exception { + HttpRequest req = buildRequest(request, new TypeReference() {}); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(PostUsersSignInDataRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public PostUsersSignInDataResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + PostUsersSignInDataResponse.Builder resBuilder = + PostUsersSignInDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + PostUsersSignInDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PostUsersSignInDataUserPlexAccount out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + res.withUserPlexAccount(out); + return res; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PostUsersSignInDataBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + PostUsersSignInDataUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration, Optional serverURL) { + super(sdkConfiguration, serverURL); + } + + private CompletableFuture onBuildRequest(PostUsersSignInDataRequest request) throws Exception { + HttpRequest req = buildRequest(request, new TypeReference() {}); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(PostUsersSignInDataRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.PostUsersSignInDataResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.PostUsersSignInDataResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.PostUsersSignInDataResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + try { + PostUsersSignInDataUserPlexAccount out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + res.withUserPlexAccount(out); + return res; + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.PostUsersSignInDataBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.PostUsersSignInDataUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/StartAllTasks.java b/src/main/java/dev/plexapi/sdk/operations/StartAllTasks.java new file mode 100644 index 00000000..136d729e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/StartAllTasks.java @@ -0,0 +1,327 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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 dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class StartAllTasks { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startAllTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startAllTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startAllTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/butler"); + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public StartAllTasksResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + StartAllTasksResponse.Builder resBuilder = + StartAllTasksResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + StartAllTasksResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StartAllTasksBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StartAllTasksUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.StartAllTasksResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.StartAllTasksResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.StartAllTasksResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StartAllTasksBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StartAllTasksUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/StartTask.java b/src/main/java/dev/plexapi/sdk/operations/StartTask.java new file mode 100644 index 00000000..493eadb0 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/StartTask.java @@ -0,0 +1,330 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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.StartTaskRequest; +import dev.plexapi.sdk.models.operations.StartTaskResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class StartTask { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startTask", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startTask", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startTask", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/butler/{taskName}", + request, null); + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(StartTaskRequest request) throws Exception { + HttpRequest req = buildRequest(request, StartTaskRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(StartTaskRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public StartTaskResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + StartTaskResponse.Builder resBuilder = + StartTaskResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + StartTaskResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200", "202")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StartTaskBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StartTaskUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(StartTaskRequest request) throws Exception { + HttpRequest req = buildRequest(request, StartTaskRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(StartTaskRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.StartTaskResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.StartTaskResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.StartTaskResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200", "202")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StartTaskBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StartTaskUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/StartUniversalTranscode.java b/src/main/java/dev/plexapi/sdk/operations/StartUniversalTranscode.java new file mode 100644 index 00000000..ceb2c9d2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/StartUniversalTranscode.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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 dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class StartUniversalTranscode { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startUniversalTranscode", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startUniversalTranscode", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "startUniversalTranscode", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/video/:/transcode/universal/start.mpd"); + HTTPRequest req = new HTTPRequest(url, "GET"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(StartUniversalTranscodeRequest request) throws Exception { + HttpRequest req = buildRequest(request, StartUniversalTranscodeRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(StartUniversalTranscodeRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public StartUniversalTranscodeResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + StartUniversalTranscodeResponse.Builder resBuilder = + StartUniversalTranscodeResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + StartUniversalTranscodeResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StartUniversalTranscodeBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StartUniversalTranscodeUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(StartUniversalTranscodeRequest request) throws Exception { + HttpRequest req = buildRequest(request, StartUniversalTranscodeRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(StartUniversalTranscodeRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.StartUniversalTranscodeResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.StartUniversalTranscodeResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.StartUniversalTranscodeResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StartUniversalTranscodeBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StartUniversalTranscodeUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/StopAllTasks.java b/src/main/java/dev/plexapi/sdk/operations/StopAllTasks.java new file mode 100644 index 00000000..8771f6b0 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/StopAllTasks.java @@ -0,0 +1,327 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestlessOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestlessOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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 dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class StopAllTasks { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopAllTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopAllTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopAllTasks", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest() throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/butler"); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestlessOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest() throws Exception { + HttpRequest r = onBuildRequest(); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public StopAllTasksResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + StopAllTasksResponse.Builder resBuilder = + StopAllTasksResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + StopAllTasksResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StopAllTasksBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StopAllTasksUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestlessOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest() throws Exception { + HttpRequest req = buildRequest(); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest() { + return Exceptions.unchecked(() -> onBuildRequest()).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.StopAllTasksResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.StopAllTasksResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.StopAllTasksResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StopAllTasksBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StopAllTasksUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/StopTask.java b/src/main/java/dev/plexapi/sdk/operations/StopTask.java new file mode 100644 index 00000000..30a5a6db --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/StopTask.java @@ -0,0 +1,330 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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.StopTaskRequest; +import dev.plexapi.sdk.models.operations.StopTaskResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class StopTask { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopTask", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopTask", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopTask", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/butler/{taskName}", + request, null); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(StopTaskRequest request) throws Exception { + HttpRequest req = buildRequest(request, StopTaskRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(StopTaskRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "404", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public StopTaskResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + StopTaskResponse.Builder resBuilder = + StopTaskResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + StopTaskResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StopTaskBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StopTaskUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(StopTaskRequest request) throws Exception { + HttpRequest req = buildRequest(request, StopTaskRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(StopTaskRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "404", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.StopTaskResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.StopTaskResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.StopTaskResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StopTaskBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StopTaskUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "404", "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/StopTranscodeSession.java b/src/main/java/dev/plexapi/sdk/operations/StopTranscodeSession.java new file mode 100644 index 00000000..cc2f553b --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/StopTranscodeSession.java @@ -0,0 +1,330 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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.StopTranscodeSessionRequest; +import dev.plexapi.sdk.models.operations.StopTranscodeSessionResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class StopTranscodeSession { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopTranscodeSession", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopTranscodeSession", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "stopTranscodeSession", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/transcode/sessions/{sessionKey}", + request, null); + HTTPRequest req = new HTTPRequest(url, "DELETE"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(StopTranscodeSessionRequest request) throws Exception { + HttpRequest req = buildRequest(request, StopTranscodeSessionRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(StopTranscodeSessionRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public StopTranscodeSessionResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + StopTranscodeSessionResponse.Builder resBuilder = + StopTranscodeSessionResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + StopTranscodeSessionResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "204")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StopTranscodeSessionBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + StopTranscodeSessionUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(StopTranscodeSessionRequest request) throws Exception { + HttpRequest req = buildRequest(request, StopTranscodeSessionRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(StopTranscodeSessionRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.StopTranscodeSessionResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.StopTranscodeSessionResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.StopTranscodeSessionResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "204")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StopTranscodeSessionBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.StopTranscodeSessionUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/UpdatePlayProgress.java b/src/main/java/dev/plexapi/sdk/operations/UpdatePlayProgress.java new file mode 100644 index 00000000..76a5dc4f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/UpdatePlayProgress.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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.UpdatePlayProgressRequest; +import dev.plexapi.sdk.models.operations.UpdatePlayProgressResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class UpdatePlayProgress { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "updatePlayProgress", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "updatePlayProgress", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "updatePlayProgress", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/:/progress"); + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(UpdatePlayProgressRequest request) throws Exception { + HttpRequest req = buildRequest(request, UpdatePlayProgressRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(UpdatePlayProgressRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public UpdatePlayProgressResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UpdatePlayProgressResponse.Builder resBuilder = + UpdatePlayProgressResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UpdatePlayProgressResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + UpdatePlayProgressBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + UpdatePlayProgressUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(UpdatePlayProgressRequest request) throws Exception { + HttpRequest req = buildRequest(request, UpdatePlayProgressRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(UpdatePlayProgressRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.UpdatePlayProgressResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.UpdatePlayProgressResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.UpdatePlayProgressResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.UpdatePlayProgressBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.UpdatePlayProgressUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/UpdatePlaylist.java b/src/main/java/dev/plexapi/sdk/operations/UpdatePlaylist.java new file mode 100644 index 00000000..46885d1e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/UpdatePlaylist.java @@ -0,0 +1,335 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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.UpdatePlaylistRequest; +import dev.plexapi.sdk.models.operations.UpdatePlaylistResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class UpdatePlaylist { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "updatePlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "updatePlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "updatePlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/playlists/{playlistID}", + request, null); + HTTPRequest req = new HTTPRequest(url, "PUT"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(UpdatePlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, UpdatePlaylistRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(UpdatePlaylistRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public UpdatePlaylistResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UpdatePlaylistResponse.Builder resBuilder = + UpdatePlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UpdatePlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + UpdatePlaylistBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + UpdatePlaylistUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(UpdatePlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, UpdatePlaylistRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(UpdatePlaylistRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.UpdatePlaylistResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.UpdatePlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.UpdatePlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.UpdatePlaylistBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.UpdatePlaylistUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/operations/UploadPlaylist.java b/src/main/java/dev/plexapi/sdk/operations/UploadPlaylist.java new file mode 100644 index 00000000..54d18589 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/operations/UploadPlaylist.java @@ -0,0 +1,333 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.operations; + +import static dev.plexapi.sdk.operations.Operations.RequestOperation; +import static dev.plexapi.sdk.operations.Operations.AsyncRequestOperation; + +import com.fasterxml.jackson.core.type.TypeReference; +import dev.plexapi.sdk.SDKConfiguration; +import dev.plexapi.sdk.SecuritySource; +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.UploadPlaylistRequest; +import dev.plexapi.sdk.models.operations.UploadPlaylistResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.Exceptions; +import dev.plexapi.sdk.utils.HTTPClient; +import dev.plexapi.sdk.utils.HTTPRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContextImpl; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContextImpl; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContextImpl; +import dev.plexapi.sdk.utils.Utils; +import java.io.InputStream; +import java.lang.Exception; +import java.lang.RuntimeException; +import java.lang.String; +import java.lang.Throwable; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; + + +public class UploadPlaylist { + + static abstract class Base { + final SDKConfiguration sdkConfiguration; + final String baseUrl; + final SecuritySource securitySource; + final HTTPClient client; + + public Base(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.baseUrl = Utils.templateUrl( + this.sdkConfiguration.serverUrl(), this.sdkConfiguration.getServerVariableDefaults()); + this.securitySource = this.sdkConfiguration.securitySource(); + this.client = this.sdkConfiguration.client(); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "uploadPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "uploadPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "uploadPlaylist", + java.util.Optional.of(java.util.List.of()), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/playlists/upload"); + HTTPRequest req = new HTTPRequest(url, "POST"); + req.addHeader("Accept", "application/json") + .addHeader("user-agent", SDKConfiguration.USER_AGENT); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + null)); + Utils.configureSecurity(req, this.sdkConfiguration.securitySource().getSecurity()); + + return req.build(); + } + } + + public static class Sync extends Base + implements RequestOperation { + public Sync(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private HttpRequest onBuildRequest(UploadPlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, UploadPlaylistRequest.class); + return sdkConfiguration.hooks().beforeRequest(createBeforeRequestContext(), req); + } + + private HttpResponse onError(HttpResponse response, Exception error) throws Exception { + return sdkConfiguration.hooks().afterError( + createAfterErrorContext(), + Optional.ofNullable(response), + Optional.ofNullable(error)); + } + + private HttpResponse onSuccess(HttpResponse response) throws Exception { + return sdkConfiguration.hooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public HttpResponse doRequest(UploadPlaylistRequest request) throws Exception { + HttpRequest r = onBuildRequest(request); + HttpResponse httpRes; + try { + httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "4XX", "5XX")) { + httpRes = onError(httpRes, null); + } else { + httpRes = onSuccess(httpRes); + } + } catch (Exception e) { + httpRes = onError(null, e); + } + + return httpRes; + } + + + @Override + public UploadPlaylistResponse handleResponse(HttpResponse response) throws Exception { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + UploadPlaylistResponse.Builder resBuilder = + UploadPlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + UploadPlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return res; + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + UploadPlaylistBadRequest out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + UploadPlaylistUnauthorized out = Utils.mapper().readValue( + response.body(), + new TypeReference<>() { + }); + out.withRawResponse(response); + + throw out; + } else { + throw new SDKError( + response, + response.statusCode(), + "Unexpected content-type received: " + contentType, + Utils.extractByteArrayFromBody(response)); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + throw new SDKError( + response, + response.statusCode(), + "API error occurred", + Utils.extractByteArrayFromBody(response)); + } + + throw new SDKError( + response, + response.statusCode(), + "Unexpected status code received: " + response.statusCode(), + Utils.extractByteArrayFromBody(response)); + } + } + public static class Async extends Base + implements AsyncRequestOperation { + + public Async(SDKConfiguration sdkConfiguration) { + super(sdkConfiguration); + } + + private CompletableFuture onBuildRequest(UploadPlaylistRequest request) throws Exception { + HttpRequest req = buildRequest(request, UploadPlaylistRequest.class); + return this.sdkConfiguration.asyncHooks().beforeRequest(createBeforeRequestContext(), req); + } + + private CompletableFuture> onError(HttpResponse response, Throwable error) { + return this.sdkConfiguration.asyncHooks().afterError(createAfterErrorContext(), response, error); + } + + private CompletableFuture> onSuccess(HttpResponse response) { + return this.sdkConfiguration.asyncHooks().afterSuccess(createAfterSuccessContext(), response); + } + + @Override + public CompletableFuture> doRequest(UploadPlaylistRequest request) { + return Exceptions.unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "4XX", "5XX")) { + return onError(resp, null); + } + return CompletableFuture.completedFuture(resp); + }) + .thenCompose(Function.identity()) + .thenCompose(this::onSuccess); + } + + @Override + public CompletableFuture handleResponse( + HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + dev.plexapi.sdk.models.operations.async.UploadPlaylistResponse.Builder resBuilder = + dev.plexapi.sdk.models.operations.async.UploadPlaylistResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + dev.plexapi.sdk.models.operations.async.UploadPlaylistResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + // no content + return CompletableFuture.completedFuture(res); + } + + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.UploadPlaylistBadRequest out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "401")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return response.body().toByteArray().thenApply(bodyBytes -> { + dev.plexapi.sdk.models.errors.async.UploadPlaylistUnauthorized out; + try { + out = Utils.mapper().readValue( + bodyBytes, + new TypeReference<>() { + }); + out.withRawResponse(response); + } catch (Exception e) { + throw new RuntimeException(e); + } + throw out; + }); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + + if (Utils.statusCodeMatches(response.statusCode(), "4XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + if (Utils.statusCodeMatches(response.statusCode(), "5XX")) { + // no content + return Utils.createAsyncApiError(response, "API error occurred"); + } + + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/AsyncHook.java b/src/main/java/dev/plexapi/sdk/utils/AsyncHook.java new file mode 100644 index 00000000..91b25952 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/AsyncHook.java @@ -0,0 +1,100 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + + +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.concurrent.CompletableFuture; +import java.util.Optional; +import java.util.UUID; + +/** + * Utility class for defining async hook interfaces. + */ +public final class AsyncHook { + + private AsyncHook() { + // prevent instantiation + } + + /** + * Specifies how a request is transformed before sending. + */ + @FunctionalInterface + public interface BeforeRequest { + + /** + * Transforms the given {@link HttpRequest} before sending. + * + *

Note that {@link HttpRequest} is immutable. To modify the request you can use + * {@code HttpRequest#newBuilder(HttpRequest, BiPredicate)} with + * JDK 16 and later (which will copy the request for modification in a builder). + * If that method is not available then use {@link Helpers#copy} (which also returns + * a builder). + * + * @param context context for the hook call + * @param request request to be transformed + * @return transformed request + */ + CompletableFuture beforeRequest(Hook.BeforeRequestContext context, HttpRequest request); + + BeforeRequest DEFAULT = (context, request) -> CompletableFuture.completedFuture(request); + } + + /** + * Specifies how a response is transformed before response processing. + */ + @FunctionalInterface + public interface AfterSuccess { + + /** + * Transforms the given response before response processing occurs. + * + * @param context context for the hook call + * @param response response to be transformed + * @return transformed response + */ + CompletableFuture> afterSuccess(Hook.AfterSuccessContext context, HttpResponse response); + + AfterSuccess DEFAULT = (context, response) -> CompletableFuture.completedFuture(response); + } + + /** + * Specifies what happens if a request action throws an Exception. + */ + @FunctionalInterface + public interface AfterError { + + /** + * Either returns an HttpResponse or throws an Exception. Must be passed either + * a response or an error (both can't be absent). + * + * @param context context for the error + * @param response response information if available. + * @param error the optional exception. If response present then the error is for-info + * only, it was the last error in the chain of AfterError hook + * calls leading to this one + * @return HTTP response if method decides that an exception is not to be thrown + */ + CompletableFuture> afterError( + Hook.AfterErrorContext context, + HttpResponse response, + Throwable error); + + AfterError DEFAULT = (context, response, error) -> Optional.ofNullable(response) + .map(CompletableFuture::completedFuture) + .orElse(CompletableFuture.failedFuture(error)); + } + + public static final class IdempotencyHook implements BeforeRequest { + + @Override + public CompletableFuture beforeRequest(Hook.BeforeRequestContext context, HttpRequest request) { + HttpRequest.Builder b = Helpers.copy(request); + b.header("Idempotency-Key", UUID.randomUUID().toString()); + return CompletableFuture.completedFuture(b.build()); + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/AsyncHooks.java b/src/main/java/dev/plexapi/sdk/utils/AsyncHooks.java new file mode 100644 index 00000000..f93f9f51 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/AsyncHooks.java @@ -0,0 +1,166 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import java.net.http.HttpResponse; +import java.net.http.HttpRequest; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.atomic.AtomicBoolean; + +import dev.plexapi.sdk.utils.AsyncHook.AfterError; +import dev.plexapi.sdk.utils.AsyncHook.AfterSuccess; +import dev.plexapi.sdk.utils.AsyncHook.BeforeRequest; +import dev.plexapi.sdk.utils.Hook.AfterErrorContext; +import dev.plexapi.sdk.utils.Hook.AfterSuccessContext; +import dev.plexapi.sdk.utils.Hook.BeforeRequestContext; +import dev.plexapi.sdk.utils.Hooks.FailEarlyException; +import dev.plexapi.sdk.utils.Blob; + +/** + * Async hook registry for runtime request/response processing. + * + *

Example usage: + *

+ * asyncHooks.registerBeforeRequest((context, request) ->
+ *     CompletableFuture.completedFuture(
+ *         Helpers.copy(request)
+ *             .header("transaction-id", UUID.randomUUID().toString())
+ *             .build()));
+ * 
+ */ +// ThreadSafe +public class AsyncHooks implements BeforeRequest, AfterSuccess, AfterError { + + // we use CopyOnWriteArrayList for thread safety + private final List beforeRequestHooks = new CopyOnWriteArrayList<>(); + private final List afterSuccessHooks = new CopyOnWriteArrayList<>(); + private final List afterErrorHooks = new CopyOnWriteArrayList<>(); + + public AsyncHooks() { + } + + /** + * Registers an async before-request hook. Hooks are chained in registration order. + * + * @param beforeRequest async hook returning CompletableFuture<HttpRequest> + * @return this + */ + public AsyncHooks registerBeforeRequest(BeforeRequest beforeRequest) { + Utils.checkNotNull(beforeRequest, "beforeRequest"); + this.beforeRequestHooks.add(beforeRequest); + return this; + } + + /** + * Registers an async after-success hook. Hooks are chained in registration order. + * + * @param afterSuccess async hook returning CompletableFuture<HttpResponse> + * @return this + */ + public AsyncHooks registerAfterSuccess(AfterSuccess afterSuccess) { + Utils.checkNotNull(afterSuccess, "afterSuccess"); + this.afterSuccessHooks.add(afterSuccess); + return this; + } + + /** + * Registers an async after-error hook. Hooks are chained in registration order. + * + * @param afterError async hook for error handling + * @return this + */ + public AsyncHooks registerAfterError(AfterError afterError) { + Utils.checkNotNull(afterError, "afterError"); + this.afterErrorHooks.add(afterError); + return this; + } + + @Override + public CompletableFuture beforeRequest(BeforeRequestContext context, HttpRequest request) { + Utils.checkNotNull(context, "context"); + Utils.checkNotNull(request, "request"); + + CompletableFuture result = CompletableFuture.completedFuture(request); + + for (BeforeRequest hook : beforeRequestHooks) { + result = result.thenCompose(req -> hook.beforeRequest(context, req)); + } + + return result; + } + + @Override + public CompletableFuture> afterSuccess( + AfterSuccessContext context, + HttpResponse response) { + Utils.checkNotNull(context, "context"); + Utils.checkNotNull(response, "response"); + + CompletableFuture> result = CompletableFuture.completedFuture(response); + + for (AfterSuccess hook : afterSuccessHooks) { + result = result.handle((resp, ex) -> + hook.afterSuccess(context, resp) + .thenApply(hookResp -> { + if (hookResp == null) { + throw new IllegalStateException( + "afterSuccess must return a non-null response"); + } + return hookResp; + }) + ).thenCompose(future -> future); + } + + return result; + } + + @Override + public CompletableFuture> afterError( + AfterErrorContext context, + HttpResponse response, + Throwable error) { + Utils.checkNotNull(context, "context"); + Utils.checkArgument( + (response != null) ^ (error != null), + "one and only one of response or error must be present"); + + CompletableFuture> result; + if (response != null) { + result = CompletableFuture.completedFuture(response); + } else { + result = CompletableFuture.failedFuture(error); + } + + AtomicBoolean failedEarly = new AtomicBoolean(false); + for (AfterError hook : afterErrorHooks) { + result = result.handle((resp, ex) -> { + if (failedEarly.get()) { + throw (FailEarlyException) ex; + } + return hook.afterError(context, resp, ex) + .handle((hookResp, hookErr) -> { + if (hookErr != null) { + if (hookErr instanceof FailEarlyException) { + failedEarly.set(true); + throw (FailEarlyException) hookErr; + } + throw Exceptions.unchecked(hookErr); + } + if (hookResp == null) { + throw new IllegalStateException( + "afterError must either throw an exception or return a non-null response"); + } + + return hookResp; + }); + } + ).thenCompose(future -> future); + } + + return result; + } + +} diff --git a/src/main/java/dev/plexapi/sdk/utils/AsyncResponse.java b/src/main/java/dev/plexapi/sdk/utils/AsyncResponse.java new file mode 100644 index 00000000..141f2d0f --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/AsyncResponse.java @@ -0,0 +1,24 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; +import dev.plexapi.sdk.utils.Blob; +import java.net.http.HttpResponse; + +public interface AsyncResponse { + + /** + * Returns the value of the Content-Type header. + **/ + String contentType(); + + /** + * Returns the HTTP status code. + **/ + int statusCode(); + + /** + * Returns the raw response. + **/ + HttpResponse rawResponse(); +} \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/utils/AsyncRetries.java b/src/main/java/dev/plexapi/sdk/utils/AsyncRetries.java new file mode 100644 index 00000000..9fb65e68 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/AsyncRetries.java @@ -0,0 +1,204 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import java.io.IOException; +import java.net.ConnectException; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.Instant; +import java.util.List; +import java.util.concurrent.*; +import java.util.function.Supplier; +import dev.plexapi.sdk.utils.Blob; + +public class AsyncRetries { + + private final RetryConfig retryConfig; + private final List retriableStatusCodes; + private final ScheduledExecutorService scheduler; + + private AsyncRetries(RetryConfig retryConfig, + List retriableStatusCodes, + ScheduledExecutorService scheduler) { + Utils.checkNotNull(retryConfig, "retryConfig"); + Utils.checkNotNull(retriableStatusCodes, "statusCodes"); + if (retriableStatusCodes.isEmpty()) { + throw new IllegalArgumentException("statusCodes list cannot be empty"); + } + this.retryConfig = retryConfig; + this.retriableStatusCodes = retriableStatusCodes; + this.scheduler = scheduler; + } + + public CompletableFuture> retry( + Supplier>> task + ) { + switch (retryConfig.strategy()) { + case BACKOFF: + CompletableFuture> future = new CompletableFuture<>(); + BackoffStrategy backoff = retryConfig.backoff() + // We want to fail fast during misconfigurations. + .orElseThrow(() -> new IllegalArgumentException("Backoff strategy is not defined")); + attempt(task, future, backoff, new State(0, Instant.now())); + return future; + case NONE: + return task.get(); + default: + throw new IllegalArgumentException("Unsupported retry strategy: " + retryConfig.strategy()); + } + } + + private void attempt(Supplier>> task, + CompletableFuture> result, + BackoffStrategy backoff, + State state) { + task.get().whenComplete((response, throwable) -> { + if (throwable == null) { + boolean matched = retriableStatusCodes.stream() + .anyMatch(pattern -> Utils.statusCodeMatches(response.statusCode(), pattern)); + if (matched) { + maybeRetry(task, result, backoff, state, new AsyncRetryableException(response)); + return; + } + result.complete(response); + return; + } + // Unwrap + Throwable e = (throwable instanceof CompletionException) ? throwable.getCause() : throwable; + if (e instanceof AsyncRetryableException) { + maybeRetry(task, result, backoff, state, e); + return; + } + if (e instanceof IOException) { + if (shouldRetryIOException(e, backoff)) { + maybeRetry(task, result, backoff, state, e); + return; + } + } + result.completeExceptionally(new NonRetryableException(e)); + }); + } + + private boolean shouldRetryIOException(Throwable e, BackoffStrategy backoff) { + if (e instanceof ConnectException && backoff.retryConnectError()) return true; + String message = e.getMessage(); + if (message == null) return false; + return (message.contains("Connect timed out") && backoff.retryConnectError()) + || (message.contains("Read timed out") && backoff.retryReadTimeoutError()); + } + + private void maybeRetry(Supplier>> task, + CompletableFuture> result, + BackoffStrategy backoff, + State state, + Throwable e) { + Duration timeSinceStart = Duration.between(state.startedAt(), Instant.now()); + if (timeSinceStart.toMillis() > backoff.maxElapsedTimeMs()) { + // retry exhausted + if (e instanceof AsyncRetryableException) { + result.complete(((AsyncRetryableException) e).response()); + return; + } + result.completeExceptionally(e); + return; + } + + double intervalMs = backoff.initialIntervalMs() * Math.pow(backoff.baseFactor(), state.count()); + double jitterMs = backoff.jitterFactor() * intervalMs; + intervalMs = intervalMs - jitterMs + Math.random() * (2 * jitterMs + 1); + intervalMs = Math.min(intervalMs, backoff.maxIntervalMs()); + + scheduler.schedule( + () -> attempt(task, result, backoff, state.countAttempt()), + (long) intervalMs, + TimeUnit.MILLISECONDS); + } + + public void shutdown() { + scheduler.shutdown(); + } + + public static Builder builder() { + return new Builder(); + } + + public final static class Builder { + + private RetryConfig retryConfig; + private List statusCodes; + private ScheduledExecutorService scheduler; + + private Builder() { + } + + /** + * Defines the retry configuration. + * + * @param retryConfig The retry configuration to use. + * @return The builder instance. + */ + public Builder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + /** + * Defines the status codes that should be considered as errors. + * + * @param statusCodes The list of status codes to treat as errors. + * @return The builder instance. + */ + public Builder statusCodes(List statusCodes) { + Utils.checkNotNull(statusCodes, "statusCodes"); + if (statusCodes.isEmpty()) { + throw new IllegalArgumentException("statusCodes list cannot be empty"); + } + this.statusCodes = statusCodes; + return this; + } + + /** + * Defines the scheduler that will be used to schedule and execute retry attempts. + * Recommend using a globally shared executor for this. + * + * @param scheduler An instance of {@link ScheduledExecutorService} + * @return The builder instance. + */ + public Builder scheduler(ScheduledExecutorService scheduler) { + Utils.checkNotNull(scheduler, "scheduler"); + this.scheduler = scheduler; + return this; + } + + public AsyncRetries build() { + return new AsyncRetries(retryConfig, statusCodes, scheduler); + } + } + + private static class State { + private long attempt; + private final Instant startedAt; + + public State(long attempt, Instant startedAt) { + this.attempt = attempt; + this.startedAt = startedAt; + } + + public long count() { + return attempt; + } + + public Instant startedAt() { + return startedAt; + } + + public State countAttempt() { + attempt++; + return this; + } + } + +} diff --git a/src/main/java/dev/plexapi/sdk/utils/AsyncRetryableException.java b/src/main/java/dev/plexapi/sdk/utils/AsyncRetryableException.java new file mode 100644 index 00000000..4b2451bc --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/AsyncRetryableException.java @@ -0,0 +1,20 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import dev.plexapi.sdk.utils.Blob; + +import java.net.http.HttpResponse; + +public final class AsyncRetryableException extends Exception { + private final HttpResponse response; + + public AsyncRetryableException(HttpResponse response) { + this.response = response; + } + + public HttpResponse response() { + return response; + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/Blob.java b/src/main/java/dev/plexapi/sdk/utils/Blob.java new file mode 100644 index 00000000..5e7e4ec2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/Blob.java @@ -0,0 +1,299 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Flow; +import java.util.concurrent.SubmissionPublisher; +import java.util.concurrent.atomic.AtomicBoolean; +import dev.plexapi.sdk.utils.reactive.ReactiveUtils; + +/** + * A utility class for creating data blobs from various input sources that implements {@code HttpRequest.BodyPublisher}. + *

+ * This class provides convenient factory methods to create blobs from: + *

    + *
  • File paths ({@link #from(Path)})
  • + *
  • InputStreams ({@link #from(InputStream)})
  • + *
  • Strings ({@link #from(String)})
  • + *
  • Byte arrays ({@link #from(byte[])})
  • + *
  • ByteBuffers ({@link #from(ByteBuffer)})
  • + *
  • Lists of ByteBuffers ({@link #from(List)})
  • + *
  • Reactive publishers ({@link #from(Flow.Publisher)})
  • + *
+ *

+ * Each blob can be used directly as a {@code HttpRequest.BodyPublisher} since this class implements that interface. + *

+ * Additionally, this class provides consumption methods for reactive data processing: + *

    + *
  • Get the stream as a {@code Flow.Publisher} ({@link #asPublisher()})
  • + *
  • Collect the entire stream into a byte array ({@link #toByteArray()})
  • + *
  • Write the stream directly to a file ({@link #toFile(Path)})
  • + *
+ *

+ * Single-use consumption: When using consumption methods ({@code asPublisher()}, {@code toByteArray()}, + * {@code toFile()}), each {@code Blob} instance can only be consumed once. After any consumption method + * is called, the instance is considered consumed and cannot be reused. Any further attempt to use a consumption method + * will result in an {@code IllegalStateException}. + *

+ * Retry compatibility: Most blob types support HTTP request retries effectively. However, InputStream-backed + * blobs ({@link #from(InputStream)}) do not support retries as the stream gets consumed during the first attempt. + * For retry-compatible scenarios, prefer file-based ({@link #from(Path)}) or in-memory ({@link #from(byte[])}) alternatives. + */ +public class Blob implements HttpRequest.BodyPublisher { + private final Flow.Publisher publisher; + private final long contentLength; + private final AtomicBoolean consumed = new AtomicBoolean(false); // Flag for single-use consumption + + /** + * Private constructor that takes a publisher and content length. + * + * @param publisher the underlying publisher + * @param contentLength the content length, or -1 if unknown + */ + private Blob(Flow.Publisher publisher, long contentLength) { + this.publisher = Objects.requireNonNull(publisher, "Publisher cannot be null"); + this.contentLength = contentLength; + } + + /** + * Creates a {@code Blob} from a file path. + *

+ * This method uses the Java HTTP client's {@code HttpRequest.BodyPublishers.ofFile()} to create + * a reactive publisher from the file content. + * + * @param path the path to the file to read + * @return a new {@code Blob} instance + * @throws FileNotFoundException if the file does not exist or cannot be read + * @throws NullPointerException if {@code path} is {@code null} + */ + public static Blob from(Path path) throws FileNotFoundException { + Objects.requireNonNull(path, "Path cannot be null"); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.ofFile(path); + return new Blob(bodyPublisher, bodyPublisher.contentLength()); + } + + /** + * Creates a {@code Blob} from an {@code InputStream}. + *

+ * This method uses {@code HttpRequest.BodyPublishers.ofInputStream()} to create a reactive + * publisher that reads from the InputStream lazily, avoiding blocking I/O operations. + *

+ * Important: InputStream-backed blobs do not support retries effectively. If the HTTP request + * fails and is retried, the InputStream will have already been consumed during the first attempt, + * causing subsequent retry attempts to send empty request bodies. For retry-compatible scenarios, + * consider using {@link #from(Path)} for file-based data or {@link #from(byte[])} for in-memory data. + * + * @param inputStream the InputStream to read from + * @return a new {@code Blob} instance + * @throws NullPointerException if {@code inputStream} is {@code null} + */ + public static Blob from(InputStream inputStream) { + Objects.requireNonNull(inputStream, "InputStream cannot be null"); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> inputStream); + return new Blob(bodyPublisher, -1); // Unknown length for InputStream + } + + /** + * Creates a {@code Blob} from a String using UTF-8 encoding. + * + * @param string the string to convert to a Blob + * @return a new {@code Blob} instance + * @throws NullPointerException if {@code string} is {@code null} + */ + public static Blob from(String string) { + Objects.requireNonNull(string, "String cannot be null"); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.ofString(string, StandardCharsets.UTF_8); + return new Blob(bodyPublisher, bodyPublisher.contentLength()); + } + + /** + * Creates a {@code Blob} from a byte array. + *

+ * This method uses HttpRequest.BodyPublishers.ofByteArray(). + * + * @param data the byte array to wrap as a Blob + * @return a new {@code Blob} instance + * @throws NullPointerException if {@code data} is {@code null} + */ + public static Blob from(byte[] data) { + Objects.requireNonNull(data, "Data cannot be null"); + HttpRequest.BodyPublisher bodyPublisher = HttpRequest.BodyPublishers.ofByteArray(data); + return new Blob(bodyPublisher, data.length); // Known length for byte array + } + + /** + * Creates a {@code Blob} from a single {@code ByteBuffer}. + * + * @param buffer the ByteBuffer to wrap as a Blob + * @return a new {@code Blob} instance + * @throws NullPointerException if {@code buffer} is {@code null} + */ + public static Blob from(ByteBuffer buffer) { + Objects.requireNonNull(buffer, "ByteBuffer cannot be null"); + SubmissionPublisher publisher = new SubmissionPublisher<>(); + publisher.submit(buffer.duplicate()); // Use duplicate to avoid modifying original + publisher.close(); + return new Blob(publisher, buffer.remaining()); // Known length from buffer + } + + /** + * Creates a {@code Blob} from a list of {@code ByteBuffer}s. + * + * @param buffers the list of ByteBuffers to wrap as a Blob + * @return a new {@code Blob} instance + * @throws NullPointerException if {@code buffers} is {@code null} + */ + public static Blob from(List buffers) { + Objects.requireNonNull(buffers, "ByteBuffer list cannot be null"); + SubmissionPublisher publisher = new SubmissionPublisher<>(); + + long totalLength = 0; + for (ByteBuffer buffer : buffers) { + publisher.submit(buffer.duplicate()); // Use duplicate to avoid modifying original + totalLength += buffer.remaining(); + } + publisher.close(); + + return new Blob(publisher, totalLength); // Known length from sum of buffer remainings + } + + /** + * Creates a {@code Blob} from a {@code Flow.Publisher>}. + *

+ * This method uses {@code ReactiveUtils.flatten()} to convert the publisher of lists + * into a publisher of individual ByteBuffers. + * + * @param sourcePublisher the publisher that provides data as lists of ByteBuffers + * @return a new {@code Blob} instance + * @throws NullPointerException if {@code sourcePublisher} is {@code null} + */ + public static Blob from(Flow.Publisher> sourcePublisher) { + Objects.requireNonNull(sourcePublisher, "Source publisher cannot be null"); + Flow.Publisher flattenedPublisher = ReactiveUtils.flatten(sourcePublisher); + return new Blob(flattenedPublisher, -1); // Unknown length for reactive publisher + } + + // Consumption methods (single-use) + + /** + * Returns a {@code Flow.Publisher} that emits individual {@code ByteBuffer} + * from the underlying stream. + *

+ * Consumes this instance: After calling this method, this {@code Blob} cannot be used again. + * + * @return a publisher of individual {@code ByteBuffer} items. + * @throws IllegalStateException if this instance has already been consumed. + */ + public Flow.Publisher asPublisher() { + return ensureNotConsumedAndMark(); + } + + /** + * Collects the entire stream into a single byte array. + *

+ * Consumes this instance: After calling this method, this {@code Blob} cannot be used again. + *

+ * The returned {@code CompletableFuture} completes when all data has been received and assembled into the byte array, + * or completes exceptionally if an error occurs. + * + * @return a {@code CompletableFuture} containing the complete byte array. + * @throws IllegalStateException if this instance has already been consumed. + */ + public CompletableFuture toByteArray() { + Flow.Publisher currentPublisher = ensureNotConsumedAndMark(); + + // Convert Flow.Publisher to Flow.Publisher> for BodySubscriber + Flow.Publisher> listPublisher = ReactiveUtils.wrapped(currentPublisher); + + HttpResponse.BodySubscriber bodySubscriber = HttpResponse.BodySubscribers.ofByteArray(); + listPublisher.subscribe(bodySubscriber); + + return bodySubscriber.getBody().toCompletableFuture(); + } + + /** + * Writes the entire stream to the specified file path. + *

+ * Consumes this instance: After calling this method, this {@code Blob} cannot be used again. + *

+ * The returned {@code CompletableFuture} completes with the {@code Path} to the written file when all data + * has been successfully written, or completes exceptionally if an error occurs. + * + * @param destinationPath the path where the stream data will be written. If the file exists, it will be truncated. + * @return a {@code CompletableFuture} containing the {@code Path} to the written file. + * @throws NullPointerException if {@code destinationPath} is {@code null}. + * @throws IllegalStateException if this instance has already been consumed. + */ + public CompletableFuture toFile(Path destinationPath) { + Objects.requireNonNull(destinationPath, "Destination path cannot be null"); + Flow.Publisher currentPublisher = ensureNotConsumedAndMark(); + + // Convert Flow.Publisher to Flow.Publisher> for BodySubscriber + Flow.Publisher> listPublisher = ReactiveUtils.wrapped(currentPublisher); + + HttpResponse.BodySubscriber bodySubscriber = HttpResponse.BodySubscribers.ofFile(destinationPath); + listPublisher.subscribe(bodySubscriber); + + return bodySubscriber.getBody().toCompletableFuture(); + } + + /** + * Converts the entire stream into an {@code InputStream} for traditional I/O operations. + *

+ * Consumes this instance: After calling this method, this {@code Blob} cannot be used again. + *

+ * The returned {@code CompletableFuture} completes with an {@code InputStream} containing all the data + * from the stream when ready, or completes exceptionally if an error occurs. The resulting InputStream + * can be used with traditional Java I/O APIs. + * + * @return a {@code CompletableFuture} containing an {@code InputStream} with the stream data. + * @throws IllegalStateException if this instance has already been consumed. + */ + public CompletableFuture toInputStream() { + Flow.Publisher currentPublisher = ensureNotConsumedAndMark(); + + // Convert Flow.Publisher to Flow.Publisher> for BodySubscriber + Flow.Publisher> listPublisher = ReactiveUtils.wrapped(currentPublisher); + + HttpResponse.BodySubscriber bodySubscriber = HttpResponse.BodySubscribers.ofInputStream(); + listPublisher.subscribe(bodySubscriber); + + return bodySubscriber.getBody().toCompletableFuture(); + } + + /** + * Ensures this instance has not already been consumed, marks it as consumed, and returns the publisher. + * + * @return the {@code Flow.Publisher} to be consumed. + * @throws IllegalStateException if this instance has already been consumed. + */ + private Flow.Publisher ensureNotConsumedAndMark() { + if (!consumed.compareAndSet(false, true)) { + throw new IllegalStateException("This Blob instance has already been consumed and cannot be reused."); + } + return this.publisher; + } + + // HttpRequest.BodyPublisher implementation + + @Override + public long contentLength() { + return contentLength; + } + + @Override + public void subscribe(Flow.Subscriber subscriber) { + publisher.subscribe(subscriber); + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/BlockingParser.java b/src/main/java/dev/plexapi/sdk/utils/BlockingParser.java new file mode 100644 index 00000000..a5d51c2e --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/BlockingParser.java @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import java.io.IOException; +import java.io.Reader; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.Optional; + +/** + * Blocking parser that reads from a Reader and delegates to a StreamingParser. + */ +public final class BlockingParser { + private final Reader reader; + private final StreamingParser parser; + private final char[] readBuffer = new char[8192]; + private boolean readerExhausted = false; + + public BlockingParser(Reader reader, StreamingParser parser) { + this.reader = reader; + this.parser = parser; + } + + /** + * Read the next parsed result from the Reader. + * + * @return next complete parsed result, or empty if no more data + * @throws IOException if reading fails + */ + public Optional next() throws IOException { + // First check if we already have a complete result buffered + Optional result = parser.next(); + if (result.isPresent()) { + return result; + } + // If reader is exhausted, try to get any remaining partial data + if (readerExhausted) { + return parser.finish(); + } + // Read more data until we have a complete result or EOF + int bytesRead; + while ((bytesRead = reader.read(readBuffer)) != -1) { + ByteBuffer chunk = ByteBuffer.wrap(new String(readBuffer, 0, bytesRead).getBytes(StandardCharsets.UTF_8)); + result = parser.add(chunk); + if (result.isPresent()) { + return result; + } + } + // Reader is now exhausted + readerExhausted = true; + return parser.finish(); + } + + /** + * Check if there are more results available (either buffered or from reader) + */ + public boolean hasNext() throws IOException { + return parser.hasBufferedData() || !readerExhausted; + } + + /** + * Close the underlying reader + */ + public void close() throws IOException { + reader.close(); + } + + // ===== Factory Methods ===== + + /** + * Create a blocking parser for JSON Lines format + */ + public static BlockingParser forJsonLines(Reader reader) { + return new BlockingParser<>(reader, StreamingParser.forJsonLines()); + } + + /** + * Create a blocking parser for SSE format + */ + public static BlockingParser forSSE(Reader reader) { + return new BlockingParser<>(reader, StreamingParser.forSSE()); + } +} \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/utils/CopiableInputStream.java b/src/main/java/dev/plexapi/sdk/utils/CopiableInputStream.java new file mode 100644 index 00000000..4adae872 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/CopiableInputStream.java @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import org.apache.commons.io.IOUtils; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; + +public class CopiableInputStream { + private final byte[] bytes; + + public CopiableInputStream(InputStream original) { + try (InputStream stream = original) { + this.bytes = IOUtils.toByteArray(stream); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public InputStream copy() { + return new ByteArrayInputStream(bytes); + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/EventStream.java b/src/main/java/dev/plexapi/sdk/utils/EventStream.java index 7a014f35..b495d0e8 100644 --- a/src/main/java/dev/plexapi/sdk/utils/EventStream.java +++ b/src/main/java/dev/plexapi/sdk/utils/EventStream.java @@ -3,40 +3,79 @@ */ package dev.plexapi.sdk.utils; -import java.io.IOException; -import java.io.InputStream; -import java.io.UncheckedIOException; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Optional; -import java.util.Spliterator; -import java.util.Spliterators; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; - /** - * Manages the parsing of an InputStream in SSE (Server Sent Events) format. + * Provides a convenient way to consume Server-Sent Events (SSE) from a stream. + *

+ * Each SSE message's {@code data} field is deserialized into the type {@code T}, + * allowing for easy processing of events as domain objects. + *

+ * + *

Event Consumption

+ *

Events can be consumed in multiple ways:

* - * @param the type that the SSE {@code data} field is deserialized into + *
    + *
  • Iteration: Use a for-each loop to process each event:
  • + *
+ *
{@code
+ * try (EventStream eventStream = new EventStream<>(...)) {
+ *     for (MyEvent event : eventStream) {
+ *         handleEvent(event);
+ *     }
+ * }
+ * }
+ * + *
    + *
  • Stream API: Consume events as a Java Stream (must be closed after use):
  • + *
+ *
{@code
+ * try (EventStream eventStream = new EventStream<>(...);
+ *      Stream stream = eventStream.stream()) {
+ *     stream.forEach(this::handleEvent);
+ * }
+ * }
+ * + *
    + *
  • Collect to List: Read all remaining events into a list:
  • + *
+ *
{@code
+ * try (EventStream eventStream = new EventStream<>(...)) {
+ *     List events = eventStream.toList();
+ * }
+ * }
+ * + *

+ * Events are lazily loaded from the underlying SSE stream. Consumption stops either + * when the stream ends or when an optional terminal message is encountered. + *

+ * + *

+ * Important: This class implements {@link AutoCloseable} and must be used + * within a try-with-resources block to ensure that underlying streams are + * properly closed after consumption, preventing resource leaks. + *

+ * + * @param the type that SSE {@code data} fields will be deserialized into */ -/** - * @param - */ -public final class EventStream implements AutoCloseable { - - private final EventStreamReader reader; +public final class EventStream implements Iterable, AutoCloseable { + private final BlockingParser parser; private final TypeReference typeReference; private final ObjectMapper mapper; private final Optional terminalMessage; // Internal use only public EventStream(InputStream in, TypeReference typeReference, ObjectMapper mapper, Optional terminalMessage) { - this.reader = new EventStreamReader(in); + BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8), 8192); + this.parser = BlockingParser.forSSE(reader); this.typeReference = typeReference; this.mapper = mapper; this.terminalMessage = terminalMessage; @@ -47,18 +86,19 @@ public final class EventStream implements AutoCloseable { * {@code Optional.empty()}. * * @return the next message or {@code Optional.empty()} if no more messages - * @throws IOException + * @throws IOException when parsing the next message. */ public Optional next() throws IOException { - return reader.readMessage() // - .filter(x -> !terminalMessage.isPresent() || !terminalMessage.get().equals(x.data())) // + return parser.next() // + .filter(x -> + terminalMessage.map(sentinel -> !sentinel.equals(x.data())).orElse(true)) .map(x -> Utils.asType(x, mapper, typeReference)); } /** * Reads all events and returns them as a {@code List}. This method calls * {@code close()}. - * + * * @return list of events */ public List toList() { @@ -75,55 +115,73 @@ public final class EventStream implements AutoCloseable { } } + /** + * Returns an {@link Iterator} of {@link T} events, enabling iteration via for-each loops. + * + * @return events iterator. + */ + @Override + public Iterator iterator() { + return new EventIterator<>(this); + } + /** * Returns a {@link Stream} of events. Must be closed after use! - * + * * @return streamed events */ public Stream stream() { - return StreamSupport.stream(Spliterators.spliteratorUnknownSize(new Iterator() { - Optional next = null; - - public T next() { - load(); - if (!next.isPresent()) { - throw new NoSuchElementException(); - } - T v = next.get(); - next = null; - return v; - } - - public boolean hasNext() { - load(); - return next.isPresent(); - } - - private void load() { - if (next == null) { + return StreamSupport.stream( + Spliterators.spliteratorUnknownSize( + iterator(), + Spliterator.ORDERED), false) + .onClose(() -> { try { - next = EventStream.this.next(); + EventStream.this.close(); } catch (IOException e) { throw new UncheckedIOException(e); + } catch (Exception e) { + throw new RuntimeException(e); } - } - } - - }, Spliterator.ORDERED), false).onClose(() -> { - try { - EventStream.this.close(); - } catch (IOException e) { - throw new UncheckedIOException(e); - } catch (Exception e) { - throw new RuntimeException(e); - } - }); + }); } @Override - public void close() throws Exception { - reader.close(); + public void close() throws IOException { + parser.close(); } -} + static class EventIterator implements Iterator { + private final EventStream stream; + private Optional next = Optional.empty(); + EventIterator(EventStream stream) { + this.stream = stream; + } + + public T next() { + load(); + if (next.isEmpty()) { + throw new NoSuchElementException(); + } + T v = next.get(); + next = Optional.empty(); + return v; + } + + public boolean hasNext() { + load(); + return next.isPresent(); + } + + private void load() { + if (next.isEmpty()) { + try { + next = stream.next(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + } + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/EventStreamLineReader.java b/src/main/java/dev/plexapi/sdk/utils/EventStreamLineReader.java deleted file mode 100644 index 4f9c0c9d..00000000 --- a/src/main/java/dev/plexapi/sdk/utils/EventStreamLineReader.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ -package dev.plexapi.sdk.utils; - -import java.io.IOException; -import java.io.Reader; - -/** - * Converts CR-LF, LF, CR to LF - */ -public class EventStreamLineReader extends Reader { - - private final Reader reader; - private int lastCh = -1; // not LF nor CR - - public EventStreamLineReader(Reader reader) { - this.reader = reader; - } - - @Override - public int read() throws IOException { - if (lastCh == -1) { - // load first character of stream - lastCh = reader.read(); - if (lastCh == -1 || lastCh == '\n') { - // force reload of buffered last ch - int v = lastCh; - lastCh = -1; - return v; - } - } - int ch = reader.read(); - if (ch == -1) { - if (lastCh == '\r') { - lastCh = -1; - return '\n'; - } else { - int v = lastCh; - lastCh = -1; - return v; - } - } else if (lastCh == '\n') { - lastCh = ch; - return '\n'; - } else if (lastCh == '\r' && ch == '\n') { - // force reload of buffered last ch - lastCh = -1; - return '\n'; - } else if (lastCh == '\r') { - lastCh = ch; - return '\n'; - } else { - int v = lastCh; - lastCh = ch; - return v; - } - } - - @Override - public int read(char[] cbuf, int off, int len) throws IOException { - throw new UnsupportedOperationException(); - } - - @Override - public void close() throws IOException { - reader.close(); - } - -} diff --git a/src/main/java/dev/plexapi/sdk/utils/EventStreamReader.java b/src/main/java/dev/plexapi/sdk/utils/EventStreamReader.java deleted file mode 100644 index 1244beb3..00000000 --- a/src/main/java/dev/plexapi/sdk/utils/EventStreamReader.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ -package dev.plexapi.sdk.utils; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.nio.charset.StandardCharsets; -import java.util.Optional; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public final class EventStreamReader implements AutoCloseable { - - private static final int BUFFER_SIZE = 8192; - - private static final String BYTE_ORDER_MARK = "\uFEFF"; - - private final Reader reader; - - private boolean first = true; - - public EventStreamReader(InputStream in) { - reader = new EventStreamLineReader( - new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8), BUFFER_SIZE)); - } - - /** - * Returns the event message (lines separated by \n) without the terminating - * \n\n. Returns null when end of stream reached (and may occur with a partially - * read event message that has not yet been terminated). Characters in comment - * lines are discarded as read (they are not buffered). - * - * @return the event message - * @throws IOException - */ - // VisibleForTesting - public String readRawMessage() throws IOException { - StringBuilder line = new StringBuilder(); - StringBuilder b = new StringBuilder(); - - char previousCh = 0; - boolean previousAvailable = false; - boolean isComment = false; - char ch; - while (true) { - int v = reader.read(); - if (v == -1) { - return null; - } - ch = (char) v; - if (previousAvailable) { - // note that incoming input stream converts sequences of \r and/or \n to \n - // characters so we only concern ourselves with \n (divide and conquer) - if (previousCh == '\n' && ch == '\n') { - b.append(line); - line.setLength(0); - isComment = false; - trimTrailingNewLines(b); - String msg = b.toString(); - if (first) { - // skip BOM if present in the first message only - if (msg.startsWith(BYTE_ORDER_MARK)) { - msg = msg.substring(BYTE_ORDER_MARK.length()); - } - first = false; - } - return msg; - } else { - if (line.length() == 0 && previousCh == ':') { - isComment = true; - } - if (!isComment) { - line.append(previousCh); - if (previousCh == '\n') { - b.append(line); - // reset line - line.setLength(0); - } - } else if (previousCh == '\n') { - isComment = false; - } - } - } else { - previousAvailable = true; - } - previousCh = ch; - } - } - - public Optional readMessage() throws IOException { - String m = readRawMessage(); - if (m == null) { - return Optional.empty(); - } else { - return Optional.of(parseMessage(m)); - } - } - - private static final Pattern LINE_PATTERN = Pattern.compile("^([a-zA-Z]+): ?(.*)$"); - private static final char LINEFEED = '\n'; - - // VisibleForTesting - public static EventStreamMessage parseMessage(String text) { - String[] lines = text.split("\n"); - Optional event = Optional.empty(); - Optional id = Optional.empty(); - Optional retryMs = Optional.empty(); - StringBuilder data = new StringBuilder(); - boolean firstData = true; - for (String line : lines) { - Matcher m = LINE_PATTERN.matcher(line); - if (m.find()) { - String key = m.group(1).toLowerCase(); - String value = m.group(2); - if ("event".equals(key)) { - event = Optional.of(value); - } else if ("id".equals(key)) { - id = Optional.of(value); - } else if ("retry".equals(key)) { - try { - retryMs = Optional.of(Integer.parseInt(value)); - } catch (NumberFormatException e) { - // ignore - } - } else if ("data".equals(key)) { - if (!firstData) { - data.append(LINEFEED); - } - firstData = false; - data.append(value); - } // else ignore the line - } - } - return new EventStreamMessage(event, id, retryMs, data.toString()); - } - - private static StringBuilder trimTrailingNewLines(StringBuilder b) { - int i = 0; - while (b.length() > i && b.charAt(b.length() - i - 1) == '\n') { - i++; - } - b.setLength(b.length() - i); - return b; - } - - @Override - public void close() throws Exception { - reader.close(); - } - -} diff --git a/src/main/java/dev/plexapi/sdk/utils/Exceptions.java b/src/main/java/dev/plexapi/sdk/utils/Exceptions.java new file mode 100644 index 00000000..b93e3f6d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/Exceptions.java @@ -0,0 +1,95 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; +import java.io.IOException; +import java.io.UncheckedIOException; + +public class Exceptions { + public static Exception coerceException(Throwable throwable) { + if (throwable instanceof Exception) { + return (Exception) throwable; + } + + return new Exception(throwable); + } + + public static RuntimeException unchecked(Throwable t) { + if (t instanceof RuntimeException) { + return (RuntimeException) t; + } else if (t instanceof Error) { + throw (Error) t; // propagate JVM-level errors properly + } else if (t instanceof IOException) { + throw new UncheckedIOException((IOException) t); + } else { + throw new RuntimeException(t); + } + } + + public static T rethrow(Throwable e) { + throw unchecked(e); + } + + @FunctionalInterface + public interface CheckedFunction { + R apply(T t) throws Exception; + } + + @FunctionalInterface + public interface CheckedSupplier { + T get() throws Exception; + } + + @FunctionalInterface + public interface CheckedConsumer { + void accept(T t) throws Exception; + } + + @FunctionalInterface + public interface CheckedRunnable { + void run() throws Exception; + } + + public static Function unchecked(CheckedFunction fn) { + return t -> { + try { + return fn.apply(t); + } catch (Exception e) { + throw unchecked(e); + } + }; + } + + public static Supplier unchecked(CheckedSupplier supplier) { + return () -> { + try { + return supplier.get(); + } catch (Exception e) { + throw unchecked(e); + } + }; + } + + public static Consumer unchecked(CheckedConsumer consumer) { + return t -> { + try { + consumer.accept(t); + } catch (Exception e) { + throw unchecked(e); + } + }; + } + + public static Runnable unchecked(CheckedRunnable runnable) { + return () -> { + try { + runnable.run(); + } catch (Exception e) { + throw unchecked(e); + } + }; + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/Globals.java b/src/main/java/dev/plexapi/sdk/utils/Globals.java new file mode 100644 index 00000000..5e4d8420 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/Globals.java @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.stream.Stream; + +public final class Globals { + + private final Map queryParams = new HashMap<>(); + private final Map pathParams = new HashMap<>(); + private final Map headerParams = new HashMap<>(); + + + public Globals() { + } + + // internal use only + public void putParam(String type, String name, Object value) { + if ("pathParam".equals(type)) { + putPathParam(name, value); + } else if ("queryParam".equals(type)) { + putQueryParam(name, value); + } else if ("header".equals(type)) { + putHeader(name, value); + } else { + throw new IllegalArgumentException("Unknown parameter type: " + type); + } + } + + // internal use only + public Optional getParam(String type, String name) { + if ("pathParam".equals(type)){ + return getPathParam(name); + } else if ("queryParam".equals(type)) { + return getQueryParam(name); + } else if ("header".equals(type)) { + return getHeader(name); + } else { + throw new IllegalArgumentException("Unknown parameter type: " + type); + } + } + + public void putQueryParam(String name, Object value) { + if (value != null) { + queryParams.put(name, Utils.valToString(value)); + } + } + + public void putPathParam(String name, Object value) { + if (value != null) { + pathParams.put(name, Utils.valToString(value)); + } + } + + public void putHeader(String name, Object value) { + if (value != null) { + headerParams.put(name, Utils.valToString(value)); + } + } + + public Optional getQueryParam(String name) { + return Optional.ofNullable(queryParams.get(name)); + } + + public Optional getPathParam(String name) { + return Optional.ofNullable(pathParams.get(name)); + } + + public Optional getHeader(String name) { + return Optional.ofNullable(headerParams.get(name)); + } + + public Stream> queryParamsAsStream() { + return queryParams.entrySet().stream(); + } + + public Stream> pathParamsAsStream() { + return pathParams.entrySet().stream(); + } + + public Stream> headerParamsAsStream() { + return headerParams.entrySet().stream(); + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/HTTPClient.java b/src/main/java/dev/plexapi/sdk/utils/HTTPClient.java index a60b5667..1542ed9c 100644 --- a/src/main/java/dev/plexapi/sdk/utils/HTTPClient.java +++ b/src/main/java/dev/plexapi/sdk/utils/HTTPClient.java @@ -3,29 +3,84 @@ */ package dev.plexapi.sdk.utils; +import dev.plexapi.sdk.utils.Blob; + import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; -import java.net.http.HttpResponse; +import java.net.http.HttpClient; import java.net.http.HttpRequest; +import java.net.http.HttpResponse; + +import java.util.concurrent.CompletableFuture; public interface HTTPClient { + HttpClient client = HttpClient.newHttpClient(); /** * Sends an HTTP request and returns the response. - * - *

Note that {@link HttpRequest} is immutable. To modify the request you can use - * {@code HttpRequest#newBuilder(HttpRequest, BiPredicate)} with - * JDK 16 and later (which will copy the request for modification in a builder). - * If that method is not available then use {@link Helpers#copy} (which also returns - * a builder). - * + * + *

+ * Note that {@link HttpRequest} is immutable. To modify the request you can + * use + * {@code HttpRequest#newBuilder(HttpRequest, BiPredicate)} + * with JDK 16 and later (which will copy the request for modification in a + * builder). If that method is not available then use {@link Helpers#copy} + * (which also returns a builder). + * * @param request HTTP request * @return HTTP response * @throws IOException * @throws InterruptedException * @throws URISyntaxException - */ - HttpResponse send(HttpRequest request) - throws IOException, InterruptedException, URISyntaxException; + */ + default HttpResponse send(HttpRequest request) + throws IOException, InterruptedException, URISyntaxException { + return client.send(request, HttpResponse.BodyHandlers.ofInputStream()); + } + + /** + * Sends an HTTP request asynchronously and returns a response whose body is + * exposed as a {@link Blob}. + *

+ * This method uses the {@code HttpResponse.BodyHandlers.ofPublisher()} to + * obtain the response body as a {@code Flow.Publisher>}, + * which is then wrapped in a {@code Blob} for non-blocking, + * reactive consumption of the response data. + *

+ * The returned {@code CompletableFuture} completes when the response is + * received, or completes exceptionally if an error occurs during the + * request or response processing. + * + * @param request the HTTP request to send + * @return a {@code CompletableFuture} containing the HTTP response with a + * {@code Blob} body + */ + default CompletableFuture> sendAsync( + HttpRequest request) { + return client.sendAsync(request, HttpResponse.BodyHandlers.ofPublisher()) + .thenApply(resp -> + new ResponseWithBody<>(resp, Blob::from)); + } + + /** + * Controls the debug flag that can be used by clients to perform conditional + * debugging actions like logging HTTP requests and responses. + * This is currently implemented in SpeakeasyHTTPClient but custom client + * implementations are free to use this method similarly if they wish. + * + * @param enabled Whether to enable debug flag + */ + default void enableDebugLogging(boolean enabled) { + // do nothing + } + + /** + * Returns whether debug logging is enabled. + * + * @return Whether debug logging is enabled + */ + default boolean isDebugLoggingEnabled() { + return false; + } } diff --git a/src/main/java/dev/plexapi/sdk/utils/Helpers.java b/src/main/java/dev/plexapi/sdk/utils/Helpers.java index f8b586b6..58741dbc 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Helpers.java +++ b/src/main/java/dev/plexapi/sdk/utils/Helpers.java @@ -104,7 +104,7 @@ public final class Helpers { @Override public void onError(Throwable throwable) { latch.countDown(); - Utils.rethrow(throwable); + Exceptions.rethrow(throwable); } @Override diff --git a/src/main/java/dev/plexapi/sdk/utils/HookAdapters.java b/src/main/java/dev/plexapi/sdk/utils/HookAdapters.java new file mode 100644 index 00000000..c549a89d --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/HookAdapters.java @@ -0,0 +1,181 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import java.io.InputStream; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * Utility class for adapting synchronous hooks to asynchronous hooks. + *

+ * This class provides adapter methods that convert synchronous hook implementations + * ({@link Hook.BeforeRequest}, {@link Hook.AfterSuccess}, {@link Hook.AfterError}) + * to their asynchronous counterparts ({@link AsyncHook.BeforeRequest}, + * {@link AsyncHook.AfterSuccess}, {@link AsyncHook.AfterError}). + *

+ * Performance Note: The execution of synchronous hooks is offloaded to the + * global {@link java.util.concurrent.ForkJoinPool#commonPool() ForkJoinPool}. + * For better performance in high-throughput scenarios, consider re-implementing + * hooks using non-blocking I/O (NIO) patterns instead of relying on these adapters. + *

+ * Thread Safety: All adapter methods are thread-safe and can be called + * concurrently from multiple threads. + * + * @see Hook + * @see AsyncHook + * @see java.util.concurrent.ForkJoinPool#commonPool() + */ +public final class HookAdapters { + + private HookAdapters() { + // prevent instantiation + } + + /** + * Adapts a synchronous {@link Hook.BeforeRequest} to an asynchronous + * {@link AsyncHook.BeforeRequest}. + *

+ * The synchronous hook execution is offloaded to the global + * {@link java.util.concurrent.ForkJoinPool#commonPool() ForkJoinPool}. + * Any exceptions thrown by the synchronous hook are wrapped as unchecked + * exceptions and propagated through the returned {@link CompletableFuture}. + *

+ * Performance Consideration: For high-throughput applications, + * consider implementing the hook directly using NIO patterns rather than + * using this adapter, as it avoids thread pool overhead and blocking operations. + * + * @param beforeRequestHook the synchronous before-request hook to adapt + * @return an asynchronous before-request hook that executes the synchronous hook + * in the global ForkJoinPool + * @throws NullPointerException if {@code beforeRequestHook} is {@code null} + */ + public static AsyncHook.BeforeRequest toAsync(Hook.BeforeRequest beforeRequestHook) { + return ((context, request) -> CompletableFuture.supplyAsync( + () -> Exceptions.unchecked(() -> beforeRequestHook.beforeRequest(context, request)).get())); + } + + /** + * Adapts a synchronous {@link Hook.AfterError} to an asynchronous + * {@link AsyncHook.AfterError}. + *

+ * This method handles the conversion between different response body types: + *

    + *
  • Converts {@link HttpResponse}<{@link Blob}> to + * {@link HttpResponse}<{@link InputStream}> for the synchronous hook
  • + *
  • Converts the result back to {@link HttpResponse}<{@link Blob}> + * for the asynchronous interface
  • + *
+ *

+ * The synchronous hook execution is offloaded to the global + * {@link java.util.concurrent.ForkJoinPool#commonPool() ForkJoinPool}. + * Any exceptions thrown by the synchronous hook are wrapped as unchecked + * exceptions and propagated through the returned {@link CompletableFuture}. + *

+ * Performance Consideration: For high-throughput applications, + * consider implementing the hook directly using NIO patterns rather than + * using this adapter, as it avoids thread pool overhead and blocking I/O operations. + * + * @param afterErrorHook the synchronous after-error hook to adapt + * @return an asynchronous after-error hook that executes the synchronous hook + * in the global ForkJoinPool + * @throws NullPointerException if {@code afterErrorHook} is {@code null} + */ + public static AsyncHook.AfterError toAsync(Hook.AfterError afterErrorHook) { + return (context, response, error) -> toStreamResponse(response) + .thenCompose(backCompatResp -> { + CompletableFuture> processedResp = CompletableFuture.supplyAsync(() -> + Exceptions.unchecked(() -> + afterErrorHook.afterError( + context, + Optional.of(backCompatResp), + Optional.of(Exceptions.coerceException(error)))).get()); + + return processedResp + .thenApply(HookAdapters::toBlobResponse); + }); + + } + + /** + * Adapts a synchronous {@link Hook.AfterSuccess} to an asynchronous + * {@link AsyncHook.AfterSuccess}. + *

+ * This method handles the conversion between different response body types: + *

    + *
  • Converts {@link HttpResponse}<{@link Blob}> to + * {@link HttpResponse}<{@link InputStream}> for the synchronous hook
  • + *
  • Converts the result back to {@link HttpResponse}<{@link Blob}> + * for the asynchronous interface
  • + *
+ *

+ * The synchronous hook execution is offloaded to the global + * {@link java.util.concurrent.ForkJoinPool#commonPool() ForkJoinPool}. + * Any exceptions thrown by the synchronous hook are wrapped as unchecked + * exceptions and propagated through the returned {@link CompletableFuture}. + *

+ * Performance Consideration: For high-throughput applications, + * consider implementing the hook directly using NIO patterns rather than + * using this adapter, as it avoids thread pool overhead and blocking I/O operations. + * + * @param afterSuccessHook the synchronous after-success hook to adapt + * @return an asynchronous after-success hook that executes the synchronous hook + * in the global ForkJoinPool + * @throws NullPointerException if {@code afterSuccessHook} is {@code null} + */ + public static AsyncHook.AfterSuccess toAsync(Hook.AfterSuccess afterSuccessHook) { + return (context, response) -> toStreamResponse(response) + .thenCompose(backCompatResp -> { + CompletableFuture> processedResp = CompletableFuture.supplyAsync(() -> + Exceptions.unchecked(() -> + afterSuccessHook.afterSuccess( + context, + backCompatResp)).get()); + + return processedResp + .thenApply(HookAdapters::toBlobResponse); + }); + + } + + /** + * Converts an {@link HttpResponse}<{@link InputStream}> to an + * {@link HttpResponse}<{@link Blob}>. + *

+ * This method wraps the InputStream response body in a {@link Blob} while + * preserving all other response metadata (status code, headers, etc.). + *

+ * Note: The resulting {@link Blob} is created from the InputStream, + * which means it may not support retries effectively if the InputStream + * gets consumed during the first attempt. + * + * @param response the response with InputStream body to convert + * @return a new response with the same metadata but with a Blob body + * @throws NullPointerException if {@code response} is {@code null} + */ + private static HttpResponse toBlobResponse(HttpResponse response) { + return new ResponseWithBody<>(response, Blob.from(response.body())); + } + + /** + * Converts an {@link HttpResponse}<{@link Blob}> to an + * {@link HttpResponse}<{@link InputStream}>. + *

+ * This method asynchronously converts the Blob response body to an InputStream + * while preserving all other response metadata (status code, headers, etc.). + * The conversion is performed using {@link Blob#toInputStream()}. + *

+ * Note: This operation consumes the {@link Blob}, making it unavailable + * for further use after this conversion. + * + * @param response the response with Blob body to convert + * @return a CompletableFuture containing a new response with the same metadata + * but with an InputStream body + * @throws NullPointerException if {@code response} is {@code null} + */ + private static CompletableFuture> toStreamResponse(HttpResponse response) { + return response.body().toInputStream().thenApply(body -> new ResponseWithBody<>(response, body)); + } +} \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/utils/Hooks.java b/src/main/java/dev/plexapi/sdk/utils/Hooks.java index 52425a16..62165d82 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Hooks.java +++ b/src/main/java/dev/plexapi/sdk/utils/Hooks.java @@ -27,7 +27,7 @@ import dev.plexapi.sdk.utils.Hook.SdkInitData; * For example, this code will add a transaction id header to every request: * *

- * hooks.registerBeforeRequest((context, request) -> {
+ * hooks.registerBeforeRequest((context, request) -> {
  *     request.headers().map().put("acme-transaction-id", nextTransactionId());
  *     return request;
  * });
diff --git a/src/main/java/dev/plexapi/sdk/utils/JSON.java b/src/main/java/dev/plexapi/sdk/utils/JSON.java
index 67593ed7..5ca657ac 100644
--- a/src/main/java/dev/plexapi/sdk/utils/JSON.java
+++ b/src/main/java/dev/plexapi/sdk/utils/JSON.java
@@ -12,8 +12,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
 public class JSON {
-    public static ObjectMapper getMapper() {
-        return new ObjectMapper()
+    private static final ObjectMapper MAPPER = new ObjectMapper()
             .registerModule(new JavaTimeModule())
             .registerModule(new Jdk8Module())
             .registerModule(new JsonNullableModule())
@@ -22,5 +21,8 @@ public class JSON {
             .configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
             .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
             .enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
+
+    public static ObjectMapper getMapper() {
+        return MAPPER;
     }
 }
\ No newline at end of file
diff --git a/src/main/java/dev/plexapi/sdk/utils/Multipart.java b/src/main/java/dev/plexapi/sdk/utils/Multipart.java
index 37d67b1e..dad81c2a 100644
--- a/src/main/java/dev/plexapi/sdk/utils/Multipart.java
+++ b/src/main/java/dev/plexapi/sdk/utils/Multipart.java
@@ -3,26 +3,25 @@
  */
 package dev.plexapi.sdk.utils;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UncheckedIOException;
-import java.net.http.HttpRequest;
+import dev.plexapi.sdk.utils.reactive.ReactiveUtils;
+
+import java.net.URLEncoder;
 import java.net.http.HttpRequest.BodyPublisher;
+import java.net.http.HttpRequest.BodyPublishers;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Optional;
-import java.util.UUID;
-import java.util.function.Supplier;
+import java.util.*;
+import java.util.concurrent.Flow;
 
 public final class Multipart {
 
-    private final static String DASHES = "--";
-    private static final String APPLICATION_OCTET_STREAM = "application/octet-stream";
+    private static final String CRLF = "\r\n";
+    private static final String DASHES = "--";
+    private static final Charset HDR_CS = StandardCharsets.ISO_8859_1; // headers
+    private static final Charset TXT_CS = StandardCharsets.UTF_8;      // text fields
+    private static final String DEFAULT_FILE_CT = "application/octet-stream";
+    public static final String DEFAULT_TEXT_CT = "text/plain; charset=UTF-8";
 
     private final BodyPublisher bodyPublisher;
     private final String boundary;
@@ -36,27 +35,35 @@ public final class Multipart {
         return bodyPublisher;
     }
 
+    /**
+     * Visible for tests.
+     */
+    public String boundary() {
+        return boundary;
+    }
+
+    /**
+     * RFC 7578: no charset parameter at the multipart level.
+     */
     public String contentType() {
-        return "multipart/form-data; charset=" + StandardCharsets.ISO_8859_1.name() + "; boundary=" + boundary;
+        return "multipart/form-data; boundary=" + boundary;
     }
 
     public static Builder builder() {
         return new Builder();
     }
 
+    // -------------------------------------------------------
+    // Builder
+    // -------------------------------------------------------
     public static final class Builder {
-
         private final List parts = new ArrayList<>();
         private final String boundary = UUID.randomUUID().toString();
 
         public Builder addPart(String name, String value) {
             Utils.checkNotNull(name, "name");
             Utils.checkNotNull(value, "value");
-            Part p = new Part();
-            p.type = PartType.STRING;
-            p.name = name;
-            p.value = value;
-            parts.add(p);
+            parts.add(new FormField(name, value, DEFAULT_TEXT_CT));
             return this;
         }
 
@@ -64,146 +71,155 @@ public final class Multipart {
             Utils.checkNotNull(name, "name");
             Utils.checkNotNull(value, "value");
             Utils.checkNotNull(contentType, "contentType");
-            Part p = new Part();
-            p.type = PartType.STRING;
-            p.name = name;
-            p.value = value;
-            p.contentType = contentType;
-            parts.add(p);
+            parts.add(new FormField(name, value, contentType));
             return this;
         }
 
-        public Builder addPart(String name, Supplier stream, String filename,
-                Optional contentType) {
+        public Builder addPart(String name, byte[] bytes, String filename, String contentType) {
+            return addPart(name, Blob.from(bytes), filename, contentType);
+        }
+
+        public Builder addPart(String name, Blob blob, String filename, String contentType) {
             Utils.checkNotNull(name, "name");
-            Utils.checkNotNull(stream, "stream");
+            Utils.checkNotNull(blob, "blob");
             Utils.checkNotNull(filename, "filename");
-            Utils.checkNotNull(contentType, "contentType");
-            Part p = new Part();
-            p.type = PartType.STREAM;
-            p.name = name;
-            p.stream = stream;
-            p.filename = filename;
-            p.contentType = contentType.orElse(null);
-            parts.add(p);
+            parts.add(new FilePart(name, blob, filename,
+                    Optional.ofNullable(contentType).orElse(DEFAULT_FILE_CT)));
             return this;
         }
 
-        private void addFinalBoundaryPart() {
-            Part p = new Part();
-            p.type = PartType.FINAL_BOUNDARY;
-            p.value = DASHES + boundary + DASHES;
-            parts.add(p);
-        }
-
         public Multipart build() {
-            if (parts.size() == 0) {
+            if (parts.isEmpty()) {
                 throw new IllegalStateException("Must have at least one part to build multipart message.");
             }
-            addFinalBoundaryPart();
-            BodyPublisher bp = HttpRequest.BodyPublishers.ofByteArrays( //
-                    () -> new PartsIterator(parts, boundary));
-            return new Multipart(bp, boundary);
+
+            // Build publishers for each part plus the closing boundary.
+            List pubs = new ArrayList<>(parts.size() + 1);
+            for (Part p : parts) {
+                pubs.add(p.toPublisher(boundary));
+            }
+            pubs.add(BodyPublishers.ofString(DASHES + boundary + DASHES + CRLF, HDR_CS));
+
+            BodyPublisher multipart = concat(pubs);
+            return new Multipart(multipart, boundary);
         }
     }
 
-    public enum PartType {
-        STRING, STREAM, FINAL_BOUNDARY
+    // -------------------------------------------------------
+    // Part model
+    // -------------------------------------------------------
+    interface Part {
+        BodyPublisher toPublisher(String boundary);
     }
 
-    static final class Part {
+    /**
+     * Text form field.
+     */
+    static final class FormField implements Part {
+        private final String name;
+        private final String value;
+        private final String contentType;
 
-        // type is the only mandatory field. Not keen on
-        // a whole bunch of nullable fields but not public api
-        // so will forego the noise of chained builders and
-        // Optional use
-
-        PartType type;
-        String name;
-        String value;
-        Supplier stream;
-        String filename;
-        String contentType;
-
-    }
-
-    private static final class PartsIterator implements Iterator {
-
-        private final Iterator iter;
-        private final String boundary;
-
-        private InputStream currentFileInput;
-        private boolean done;
-        private byte[] next;
-
-        PartsIterator(List parts, String boundary) {
-            this.iter = parts.iterator();
-            this.boundary = boundary;
+        FormField(String name, String value, String contentType) {
+            this.name = name;
+            this.value = value;
+            this.contentType = contentType != null ? contentType : "text/plain; charset=UTF-8";
         }
 
         @Override
-        public boolean hasNext() {
-            if (done)
-                return false;
-            if (next != null)
-                return true;
-            try {
-                next = computeNext();
-            } catch (IOException e) {
-                throw new UncheckedIOException(e);
-            }
-            if (next == null) {
-                done = true;
-                return false;
-            }
-            return true;
+        public BodyPublisher toPublisher(String boundary) {
+            String header = DASHES + boundary + CRLF +
+                    "Content-Disposition: form-data; name=\"" + escapeQuoted(name) + "\"" + CRLF +
+                    "Content-Type: " + contentType + CRLF +
+                    CRLF;
+
+            BodyPublisher h = BodyPublishers.ofString(header, HDR_CS);
+            BodyPublisher b = BodyPublishers.ofString(value, TXT_CS);
+            BodyPublisher t = BodyPublishers.ofString(CRLF, HDR_CS);
+
+            return concat(h, b, t);
+        }
+    }
+
+    /**
+     * File / blob upload.
+     */
+    static final class FilePart implements Part {
+        private final String name;
+        private final String filename;
+        private final String contentType;
+        private final Blob blob;
+
+        FilePart(String name, Blob blob, String filename, String contentType) {
+            this.name = name;
+            this.filename = filename;
+            this.contentType = contentType != null ? contentType : DEFAULT_FILE_CT;
+            this.blob = blob;
         }
 
         @Override
-        public byte[] next() {
-            if (!hasNext())
-                throw new NoSuchElementException();
-            byte[] res = next;
-            next = null;
-            return res;
-        }
+        public BodyPublisher toPublisher(String boundary) {
+            String cd = contentDispositionWithFilename(name, filename);
+            String header = DASHES + boundary + CRLF +
+                    "Content-Disposition: " + cd + CRLF +
+                    "Content-Type: " + contentType + CRLF +
+                    CRLF;
 
-        private byte[] computeNext() throws IOException {
-            if (currentFileInput == null) {
-                if (!iter.hasNext())
-                    return null;
-                Part nextPart = iter.next();
-                if (PartType.STRING.equals(nextPart.type)) {
-                    String part = DASHES + boundary + "\r\n" + "Content-Disposition: form-data; name=" + nextPart.name
-                            + "\r\n" + "Content-Type: text/plain; charset=UTF-8\r\n\r\n" + nextPart.value + "\r\n";
-                    return part.getBytes(StandardCharsets.UTF_8);
-                } else if (PartType.FINAL_BOUNDARY.equals(nextPart.type)) {
-                    return nextPart.value.getBytes(StandardCharsets.UTF_8);
-                } else {
-                    String filename = nextPart.filename;
-                    String contentType = nextPart.contentType;
-                    if (contentType == null) {
-                        contentType = APPLICATION_OCTET_STREAM;
-                    }
-                    currentFileInput = nextPart.stream.get();
-                    String partHeader = DASHES + boundary + "\r\n" + "Content-Disposition: form-data; name="
-                            + nextPart.name + "; filename=" + filename + "\r\n" + "Content-Type: " + contentType
-                            + "\r\n\r\n";
-                    return partHeader.getBytes(StandardCharsets.UTF_8);
-                }
-            } else {
-                byte[] buf = new byte[8192];
-                int r = currentFileInput.read(buf);
-                if (r > 0) {
-                    byte[] actualBytes = new byte[r];
-                    System.arraycopy(buf, 0, actualBytes, 0, r);
-                    return actualBytes;
-                } else {
-                    currentFileInput.close();
-                    currentFileInput = null;
-                    return "\r\n".getBytes(StandardCharsets.UTF_8);
-                }
-            }
+            BodyPublisher h = BodyPublishers.ofString(header, HDR_CS);
+            BodyPublisher c = BodyPublishers.fromPublisher(blob.asPublisher()); // streaming
+            BodyPublisher t = BodyPublishers.ofString(CRLF, HDR_CS);
+
+            return concat(h, c, t);
         }
     }
+
+    // -------------------------------------------------------
+    // Helpers
+    // -------------------------------------------------------
+    private static String escapeQuoted(String s) {
+        Objects.requireNonNull(s, "quoted string");
+        StringBuilder out = new StringBuilder(s.length());
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+            if (c == '"' || c == '\\') out.append('\\').append(c);
+            else if (c == '\r' || c == '\n') out.append(' ');
+            else out.append(c);
+        }
+        return out.toString();
+    }
+
+    /**
+     * RFC 5987 filename* with ASCII fallback.
+     */
+    private static String contentDispositionWithFilename(String name, String filename) {
+        String safeName = escapeQuoted(name);
+        String fallback = escapeQuoted(asAsciiFilenameFallback(filename));
+        String encoded;
+        try {
+            encoded = URLEncoder.encode(filename, TXT_CS).replace("+", "%20");
+        } catch (Exception e) {
+            encoded = fallback;
+        }
+        return "form-data; name=\"" + safeName + "\"; filename=\"" + fallback + "\"; filename*=UTF-8''" + encoded;
+    }
+
+    private static String asAsciiFilenameFallback(String filename) {
+        StringBuilder sb = new StringBuilder(filename.length());
+        for (int i = 0; i < filename.length(); i++) {
+            char c = filename.charAt(i);
+            if (c >= 0x20 && c <= 0x7E && c != '"' && c != '\\') sb.append(c);
+            else sb.append('_');
+        }
+        return sb.toString();
+    }
+
+    private static BodyPublisher concat(BodyPublisher... publishers) {
+        return BodyPublishers.fromPublisher(ReactiveUtils.concat(List.of(publishers)));
+    }
+
+    private static BodyPublisher concat(List publishers) {
+        List> bufferPublishers = List.copyOf(publishers);
+        return BodyPublishers.fromPublisher(ReactiveUtils.concat(bufferPublishers));
+    }
+
 }
diff --git a/src/main/java/dev/plexapi/sdk/utils/NonRetryableException.java b/src/main/java/dev/plexapi/sdk/utils/NonRetryableException.java
new file mode 100644
index 00000000..b2e60c6f
--- /dev/null
+++ b/src/main/java/dev/plexapi/sdk/utils/NonRetryableException.java
@@ -0,0 +1,17 @@
+/* 
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package dev.plexapi.sdk.utils;
+
+public final class NonRetryableException extends Exception {
+    private final Throwable throwable;
+
+    public NonRetryableException(Throwable throwable) {
+        super(throwable);
+        this.throwable = throwable;
+    }
+
+    public Throwable exception() {
+        return throwable;
+    }
+}
diff --git a/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java b/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java
index 4c362236..18979724 100644
--- a/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java
+++ b/src/main/java/dev/plexapi/sdk/utils/QueryParameters.java
@@ -3,19 +3,17 @@
  */
 package dev.plexapi.sdk.utils;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.*;
+import java.util.stream.Collectors;
+
 public class QueryParameters {
     public static  List parseQueryParams(Class type, T queryParams,
-            Map>> globals) throws Exception {
+            Globals globals) throws Exception {
         List allParams = new ArrayList<>();
 
         Field[] fields = type.getDeclaredFields();
@@ -63,6 +61,18 @@ public class QueryParameters {
             }
         }
 
+        // include all global params in pathParams if not already present
+        if (globals != null) {
+            Set allParamNames = allParams.stream()
+                .map(QueryParameter::name)
+                .collect(Collectors.toSet());
+            globals.queryParamsAsStream()
+                .filter(entry -> !allParamNames.contains(entry.getKey()))
+                .forEach(entry ->      
+                        allParams.add(QueryParameter.of(entry.getKey(), 
+                            entry.getValue(), false)));
+        }
+        
         return allParams;
     }
 
@@ -133,6 +143,11 @@ public class QueryParameters {
                     params.add(QueryParameter.of(queryParamsMetadata.name, Utils.valToString(value), queryParamsMetadata.allowReserved));
                     break;
                 }
+                Optional openEnumValue = Reflections.getOpenEnumValue(value.getClass(), value);
+                if (openEnumValue.isPresent()) {
+                    params.add(QueryParameter.of(queryParamsMetadata.name, Utils.valToString(openEnumValue.get()), queryParamsMetadata.allowReserved));
+                    break;
+                }
                 Field[] fields = value.getClass().getDeclaredFields();
 
                 List items = new ArrayList<>();
@@ -200,6 +215,7 @@ public class QueryParameters {
                 if (!Utils.allowIntrospection(value.getClass())) {
                     throw new RuntimeException("DeepObject style only supports Map and Object types, not " + value.getClass());
                 }
+
                 Field[] fields = value.getClass().getDeclaredFields();
 
                 for (Field field : fields) {
diff --git a/src/main/java/dev/plexapi/sdk/utils/Reflections.java b/src/main/java/dev/plexapi/sdk/utils/Reflections.java
new file mode 100644
index 00000000..71a0663c
--- /dev/null
+++ b/src/main/java/dev/plexapi/sdk/utils/Reflections.java
@@ -0,0 +1,138 @@
+/* 
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+package dev.plexapi.sdk.utils;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+// INTERNAL API ONLY
+
+public class Reflections {
+
+    /**
+     * Extracts the underlying value from an open enum instance if the class follows the open enum pattern.
+     *
+     * 

An open enum is a class that emulates enum behavior but can handle unknown values + * without runtime errors. This pattern is commonly used for API responses where new + * enum values might be added over time. + * + *

The method validates that the class follows the open enum pattern by checking for: + *

    + *
  • A static factory method {@code of(String)} or {@code of(Integer)} that returns the class type
  • + *
  • An instance method {@code value()} returning String or Integer
  • + *
  • At least one public static final field of the same class type (predefined constants)
  • + *
+ * + *

If all validation passes, the method invokes the {@code value()} method on the provided instance + * and returns the result. + * + * @param clazz the class to examine for open enum pattern + * @param instance the instance of the open enum class from which to extract the value + * @return {@code Optional} containing the extracted value (String or Integer) if the class + * follows the open enum pattern and the value extraction succeeds, {@code Optional.empty()} otherwise + */ + public static Optional getOpenEnumValue(Class clazz, Object instance) { + Objects.requireNonNull(clazz, "Class cannot be null"); + + try { + // Check for factory method of(String) or of(Integer) + boolean hasFactoryMethod = Arrays.stream(clazz.getDeclaredMethods()) + .anyMatch(method -> isValidFactoryMethod(method, clazz)); + if (!hasFactoryMethod) { + return Optional.empty(); + } + + // Check for at least one static constant of same type + if (!hasStaticConstants(clazz)) { + return Optional.empty(); + } + + // Check for value() method returning String or Integer + Method valueMethod = clazz.getMethod("value"); + if (!isValidValueMethod(valueMethod)) { + return Optional.empty(); + } + + valueMethod.setAccessible(true); + return Optional.of(valueMethod.invoke(instance)); + } catch (Exception e) { + return Optional.empty(); + } + } + + private static boolean isNumericType(Class type) { + // Primitive numeric types + if (type.isPrimitive()) { + return type == byte.class || type == short.class || + type == int.class || type == long.class || + type == float.class || type == double.class; + } + + // Number subclasses (Integer, Long, Double, BigDecimal, etc.) + if (Number.class.isAssignableFrom(type)) { + return true; + } + + // Atomic numeric types + return type == AtomicInteger.class || type == AtomicLong.class; + } + + /** + * Checks if the given method is a valid factory method for an open enum. + * + * @param method the method to check + * @param clazz the class that should be returned by the factory method + * @return true if valid factory method + */ + private static boolean isValidFactoryMethod(Method method, Class clazz) { + // Must be named "of" + if (!"of".equals(method.getName())) { + return false; + } + + // Must be static and return the enum class + if (!Modifier.isStatic(method.getModifiers()) || !method.getReturnType().equals(clazz)) { + return false; + } + + // Must have exactly one parameter of String or Integer type + Class[] parameterTypes = method.getParameterTypes(); + return parameterTypes.length == 1 && + (String.class.equals(parameterTypes[0]) || isNumericType(parameterTypes[0])); + } + + /** + * Checks if the given method is a valid value() method for an open enum. + * + * @param method the value() method to validate + * @return true if valid value method + */ + private static boolean isValidValueMethod(Method method) { + // Must not be static and return String or Integer + return !Modifier.isStatic(method.getModifiers()) && + (String.class.equals(method.getReturnType()) || isNumericType(method.getReturnType())); + } + + /** + * Checks if the class has at least one public static final field of the same class type. + * + * @param clazz the class to check for static constants + * @return true if has static constants + */ + private static boolean hasStaticConstants(Class clazz) { + return Arrays.stream(clazz.getDeclaredFields()) + .anyMatch(field -> { + int modifiers = field.getModifiers(); + return Modifier.isStatic(modifiers) && + Modifier.isFinal(modifiers) && + Modifier.isPublic(modifiers) && + clazz.equals(field.getType()); + }); + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/RequestBody.java b/src/main/java/dev/plexapi/sdk/utils/RequestBody.java index 60f46748..e39576b1 100644 --- a/src/main/java/dev/plexapi/sdk/utils/RequestBody.java +++ b/src/main/java/dev/plexapi/sdk/utils/RequestBody.java @@ -7,8 +7,11 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublishers; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -29,7 +32,7 @@ public final class RequestBody { } public static SerializedBody serialize(Object request, String requestField, String serializationMethod, - boolean nullable) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, + boolean nullable) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException, UnsupportedOperationException, IOException { if (request == null) { return null; @@ -98,6 +101,8 @@ public final class RequestBody { body = new SerializedBody(contentType, BodyPublishers.ofString((String) value)); } else if (value instanceof byte[]) { body = new SerializedBody(contentType, BodyPublishers.ofByteArray((byte[]) value)); + } else if (value instanceof HttpRequest.BodyPublisher) { + body = new SerializedBody(contentType, (HttpRequest.BodyPublisher) value); } else { throw new RuntimeException("Unsupported content type " + contentType + " for field " + fieldName); } @@ -128,7 +133,16 @@ public final class RequestBody { } if (metadata.file) { - serializeMultipartFile(metadata.name, builder, val); + if (val instanceof List || val.getClass().isArray()) { + // Handle file arrays + List arr = Utils.toList(val); + for (Object item : arr) { + serializeMultipartFile(metadata.name + "[]", builder, item); + } + } else { + // Handle single file + serializeMultipartFile(metadata.name, builder, val); + } } else if (metadata.json) { ObjectMapper mapper = JSON.getMapper(); String json = mapper.writeValueAsString(val); @@ -156,7 +170,7 @@ public final class RequestBody { } String fileName = ""; - byte[] content = null; + Object content = null; Field[] fields = file.getClass().getDeclaredFields(); @@ -174,7 +188,7 @@ public final class RequestBody { } if (metadata.content) { - content = (byte[]) val; + content = val; } else { fileName = Utils.valToString(val); } @@ -183,9 +197,22 @@ public final class RequestBody { if (fileName.isBlank() || content == null) { throw new RuntimeException("Invalid multipart file"); } - byte[] cont = content; - builder.addPart(fieldName, () -> new ByteArrayInputStream(cont), fileName, - Optional.of("application/octet-stream")); + + // Detect content type based on file extension + String contentType = "application/octet-stream"; // default fallback + try { + String detectedType = Files.probeContentType(Path.of(fileName)); + if (detectedType != null && !detectedType.isEmpty()) { + contentType = detectedType; + } + } catch (Exception e) { + // If detection fails, use the default fallback + } + if (content instanceof byte[]) { + builder.addPart(fieldName, (byte[]) content, fileName, contentType); + } else { + builder.addPart(fieldName, (Blob) content, fileName, contentType); + } } public static SerializedBody serializeFormData(Object value) diff --git a/src/main/java/dev/plexapi/sdk/utils/Response.java b/src/main/java/dev/plexapi/sdk/utils/Response.java index d26ab57a..5d701d72 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Response.java +++ b/src/main/java/dev/plexapi/sdk/utils/Response.java @@ -2,7 +2,6 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ package dev.plexapi.sdk.utils; - import java.io.InputStream; import java.net.http.HttpResponse; diff --git a/src/main/java/dev/plexapi/sdk/utils/ResponseWithBody.java b/src/main/java/dev/plexapi/sdk/utils/ResponseWithBody.java new file mode 100644 index 00000000..5c41e323 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/ResponseWithBody.java @@ -0,0 +1,95 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import javax.net.ssl.SSLSession; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpHeaders; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.util.Optional; +import java.util.function.Function; + +/** + * A wrapper for {@link HttpResponse} that allows mappi ng the response body from type {@code R} to type {@code B}. + *

+ * This class delegates all methods to the original response, except for {@link #body()}, which returns the mapped body. + * The mapping is performed using the provided {@code bodyMapper} function at construction time. + * + * @param the type of the original response body + * @param the type of the mapped response body + */ +public class ResponseWithBody implements HttpResponse { + private final HttpResponse original; + private final Function bodyMapper; + private final B body; + + /** + * Constructs a new {@code ResponseWithBody} by wrapping an existing {@link HttpResponse} and applying + * a mapping function to its body. + * + * @param original the original response to wrap + * @param bodyMapper a function to map the original body to the new body type + */ + public ResponseWithBody(HttpResponse original, Function bodyMapper) { + this.original = original; + this.bodyMapper = bodyMapper; + this.body = bodyMapper.apply(original.body()); + } + + /** + * Constructs a new {@code ResponseWithBody} by wrapping an existing {@link HttpResponse} with + * a pre-computed body value. + * + * @param original the original response to wrap + * @param body the pre-computed body value + */ + public ResponseWithBody(HttpResponse original, B body) { + this.original = original; + this.body = body; + this.bodyMapper = null; + } + + @Override + public int statusCode() { + return original.statusCode(); + } + + @Override + public HttpRequest request() { + return original.request(); + } + + @Override + public Optional> previousResponse() { + return original.previousResponse() + .map(prev -> new ResponseWithBody<>(prev, bodyMapper)); + } + + @Override + public HttpHeaders headers() { + return original.headers(); + } + + @Override + public B body() { + return body; + } + + @Override + public Optional sslSession() { + return original.sslSession(); + } + + @Override + public URI uri() { + return original.uri(); + } + + @Override + public HttpClient.Version version() { + return original.version(); + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/Retries.java b/src/main/java/dev/plexapi/sdk/utils/Retries.java index 39fd3676..e4fd0aa7 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Retries.java +++ b/src/main/java/dev/plexapi/sdk/utils/Retries.java @@ -31,33 +31,7 @@ public class Retries { this.retryConfig = retryConfig; this.statusCodes = statusCodes; } - - @SuppressWarnings("serial") - public static final class NonRetryableException extends Exception { - private final Exception exception; - - public NonRetryableException(Exception exception) { - super(exception); - this.exception = exception; - } - - public Exception exception() { - return exception; - } - } - - @SuppressWarnings("serial") - public static final class RetryableException extends Exception { - private final HttpResponse response; - - public RetryableException(HttpResponse response) { - this.response = response; - } - - public HttpResponse response() { - return response; - } - } + public HttpResponse run() throws Exception { @@ -130,7 +104,7 @@ public class Retries { try { return getResponse(retryConnectError, retryReadTimeoutError); } catch(NonRetryableException e) { - throw e.exception(); + throw Exceptions.coerceException(e.exception()); } catch(IOException | RetryableException e) { long nowMs = System.currentTimeMillis(); if (nowMs - startMs > backoff.maxElapsedTimeMs()) { diff --git a/src/main/java/dev/plexapi/sdk/utils/RetryableException.java b/src/main/java/dev/plexapi/sdk/utils/RetryableException.java new file mode 100644 index 00000000..d40e2cc2 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/RetryableException.java @@ -0,0 +1,19 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import java.io.InputStream; +import java.net.http.HttpResponse; + +public final class RetryableException extends Exception { + private final HttpResponse response; + + public RetryableException(HttpResponse response) { + this.response = response; + } + + public HttpResponse response() { + return response; + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/SessionManager.java b/src/main/java/dev/plexapi/sdk/utils/SessionManager.java index 0017af08..95d798b1 100644 --- a/src/main/java/dev/plexapi/sdk/utils/SessionManager.java +++ b/src/main/java/dev/plexapi/sdk/utils/SessionManager.java @@ -155,7 +155,7 @@ public final class SessionManager { "Unexpected status code " + response.statusCode() + ": " + responseBody); } TokenResponse t = Utils.mapper().readValue(response.body(), TokenResponse.class); - if (!t.tokenType.orElse("").equals("Bearer")) { + if (!t.tokenType.orElse("").toLowerCase().equals("bearer")) { throw new AuthException("Expected 'Bearer' token type but was '" + t.tokenType.orElse("") + "'"); } final Optional expiresAt = t.expiresInSeconds diff --git a/src/main/java/dev/plexapi/sdk/utils/SpeakeasyHTTPClient.java b/src/main/java/dev/plexapi/sdk/utils/SpeakeasyHTTPClient.java index 7b4631ff..ecd4ea91 100644 --- a/src/main/java/dev/plexapi/sdk/utils/SpeakeasyHTTPClient.java +++ b/src/main/java/dev/plexapi/sdk/utils/SpeakeasyHTTPClient.java @@ -3,6 +3,8 @@ */ package dev.plexapi.sdk.utils; +import dev.plexapi.sdk.utils.Blob; + import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; @@ -14,19 +16,28 @@ import java.net.http.HttpResponse; import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.Locale; +import java.util.Optional; import java.util.Set; import java.util.function.Consumer; import java.util.stream.Collectors; +import java.util.concurrent.CompletableFuture; public class SpeakeasyHTTPClient implements HTTPClient { + // global debug flag. Retained for backwards compatibility. private static boolean debugEnabled = false; + // Instance-level debug flag. Can be set by clients to enable debug logging for a + // single SDK instance. + private Boolean localDebugEnabled; + // uppercase private static Set redactedHeaders = Set.of("AUTHORIZATION", "X-API-KEY"); private static Consumer logger = System.out::println; + private final HttpClient client = HttpClient.newHttpClient(); + /** * Experimental, may be changed anytime. Sets debug logging on or off for * requests and responses including bodies for JSON content. WARNING: this @@ -42,6 +53,20 @@ public class SpeakeasyHTTPClient implements HTTPClient { debugEnabled = enabled; } + public static boolean getDebugLoggingEnabled() { + return debugEnabled; + } + + @Override + public boolean isDebugLoggingEnabled() { + return Optional.ofNullable(localDebugEnabled).orElse(debugEnabled); + } + + @Override + public void enableDebugLogging(boolean enabled) { + localDebugEnabled = enabled; + } + /** * Experimental, may be changed anytime. When debug logging is enabled this * method controls the suppression of header values in the logs. By default, @@ -57,7 +82,7 @@ public class SpeakeasyHTTPClient implements HTTPClient { .map(x -> x.toUpperCase(Locale.ENGLISH)) // .collect(Collectors.toSet()); } - + public static void setLogger(Consumer logger) { SpeakeasyHTTPClient.logger = logger; } @@ -65,17 +90,27 @@ public class SpeakeasyHTTPClient implements HTTPClient { @Override public HttpResponse send(HttpRequest request) throws IOException, InterruptedException, URISyntaxException { - HttpClient client = HttpClient.newHttpClient(); - if (debugEnabled) { + if (isDebugLoggingEnabled()) { request = logRequest(request); } var response = client.send(request, HttpResponse.BodyHandlers.ofInputStream()); - if (debugEnabled) { + if (isDebugLoggingEnabled()) { response = logResponse(response); } return response; } + @Override + public CompletableFuture> sendAsync(HttpRequest request) { + if (isDebugLoggingEnabled()) { + request = logRequest(request); + } + return client.sendAsync(request, HttpResponse.BodyHandlers.ofPublisher()) + .thenApply(response -> + // TODO: log responses when helper for Blob is setup + new ResponseWithBody<>(response, Blob::from)); + } + private HttpRequest logRequest(HttpRequest request) { log("Sending request: " + request); log("Request headers: " + redactHeaders(request.headers())); diff --git a/src/main/java/dev/plexapi/sdk/utils/StreamingParser.java b/src/main/java/dev/plexapi/sdk/utils/StreamingParser.java new file mode 100644 index 00000000..92deced9 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/StreamingParser.java @@ -0,0 +1,322 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils; + +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Generic streaming parser that handles byte buffer management and delegates + * format-specific logic to a StreamContentProcessor. + */ +public final class StreamingParser { + + /** + * Information about a found boundary in byte data + */ + static class BoundaryInfo { + public final int position; + public final int delimiterLength; + + public BoundaryInfo(int position, int delimiterLength) { + this.position = position; + this.delimiterLength = delimiterLength; + } + } + + /** + * Interface for format-specific parsing logic + */ + interface StreamContentProcessor { + /** + * Find the next boundary in the byte buffer + * @return boundary info, or position -1 if no boundary found + */ + BoundaryInfo findBoundary(byte[] data, int limit); + + /** + * Process extracted content and return the parsed result + * @param content the extracted content (without boundary delimiters) + * @return parsed result, or empty if content should be skipped + */ + Optional processContent(String content); + + /** + * Sanitize content text (e.g., handle line endings, BOM, etc.) + * @param rawContent the raw extracted content + * @param isFirst whether this is the first content processed + * @return sanitized content + */ + default String sanitizeContent(String rawContent, boolean isFirst) { + return rawContent.replace("\r\n", "\n").replace("\r", "\n"); + } + } + + private final StreamContentProcessor processor; + private ByteBuffer byteBuffer = ByteBuffer.allocate(8192); + private boolean first = true; + + StreamingParser(StreamContentProcessor processor) { + this.processor = processor; + } + + /** + * Add ByteBuffer data to the parser buffer and extract any complete items. + * + * @param inputBuffer byte data to add (will not be modified) + * @return next complete parsed result if one becomes available + */ + public Optional add(ByteBuffer inputBuffer) { + if (inputBuffer == null || !inputBuffer.hasRemaining()) { + return extractNextFromBytes(); + } + // Ensure we have enough capacity + if (byteBuffer.remaining() < inputBuffer.remaining()) { + byteBuffer = expandByteBuffer(byteBuffer.position() + inputBuffer.remaining()); + } + // Append new data + byteBuffer.put(inputBuffer.slice()); + return extractNextFromBytes(); + } + + /** + * Extract any remaining partial content when stream ends. + * + * @return final parsed result if there was incomplete data in the buffer + */ + public Optional finish() { + if (byteBuffer.position() > 0) { + byte[] remainingBytes = new byte[byteBuffer.position()]; + byteBuffer.flip(); + byteBuffer.get(remainingBytes); + byteBuffer.clear(); + String content = processor.sanitizeContent(new String(remainingBytes, StandardCharsets.UTF_8), first); + return processor.processContent(content); + } + return Optional.empty(); + } + + /** + * Check if there are additional complete items in the buffer. + * + * @return next complete parsed result from buffer if available + */ + public Optional next() { + return extractNextFromBytes(); + } + + /** + * Check if parser has any buffered data + */ + public boolean hasBufferedData() { + return byteBuffer.position() > 0; + } + + private Optional extractNextFromBytes() { + if (byteBuffer.position() == 0) { + return Optional.empty(); + } + // Find boundary directly in bytes + BoundaryInfo boundary = processor.findBoundary(byteBuffer.array(), byteBuffer.position()); + if (boundary.position == -1) { + return Optional.empty(); + } + // Extract content bytes without copying the entire buffer + byte[] contentBytes = new byte[boundary.position]; + byteBuffer.flip(); + byteBuffer.get(contentBytes, 0, boundary.position); + // Compact buffer to remove processed content + delimiter + byteBuffer.position(boundary.position + boundary.delimiterLength); + byteBuffer.compact(); + String content = processor.sanitizeContent(new String(contentBytes, StandardCharsets.UTF_8), first); + if (first) { + first = false; + } + Optional result = processor.processContent(content); + if (result.isPresent()) { + return result; + } + // Check for additional items if this one was skipped + return extractNextFromBytes(); + } + + private ByteBuffer expandByteBuffer(int newCapacity) { + ByteBuffer newBuffer = ByteBuffer.allocate(Math.max(newCapacity, byteBuffer.capacity() * 2)); + byteBuffer.flip(); + newBuffer.put(byteBuffer); + return newBuffer; + } + + /** + * Check if a byte pattern matches at a specific position + */ + public static boolean matchesPattern(byte[] data, int pos, int limit, byte... pattern) { + if (pos + pattern.length > limit) { + return false; + } + for (int i = 0; i < pattern.length; i++) { + if (data[pos + i] != pattern[i]) { + return false; + } + } + return true; + } + + // ===== JSON Lines Content Processor ===== + + /** + * JSON Lines content processor implementation + */ + private static class JsonLContentProcessor implements StreamContentProcessor { + // Line boundary patterns + private static final byte CR = '\r'; + private static final byte LF = '\n'; + private static final byte[] CRLF = {CR, LF}; // \r\n + private static final byte[] LF_ONLY = {LF}; // \n + + @Override + public BoundaryInfo findBoundary(byte[] data, int limit) { + for (int i = 0; i < limit; i++) { + // Check for CRLF first (longer pattern) + if (matchesPattern(data, i, limit, CRLF)) { + return new BoundaryInfo(i, CRLF.length); + } + // Check for LF only + if (matchesPattern(data, i, limit, LF_ONLY)) { + return new BoundaryInfo(i, LF_ONLY.length); + } + } + return new BoundaryInfo(-1, 0); + } + + @Override + public Optional processContent(String content) { + String trimmed = content.trim(); + // Return non-empty JSON lines + return trimmed.isEmpty() ? Optional.empty() : Optional.of(trimmed); + } + } + + // ===== SSE Content Processor ===== + + /** + * SSE content processor implementation + */ + private static class SSEContentProcessor implements StreamContentProcessor { + private static final String BYTE_ORDER_MARK = "\uFEFF"; + private static final Pattern LINE_PATTERN = Pattern.compile("^([a-zA-Z]+): ?(.*)$"); + private static final char LINEFEED = '\n'; + // Message boundary patterns + private static final byte CR = '\r'; + private static final byte LF = '\n'; + private static final byte[] CRLF_CRLF = {CR, LF, CR, LF}; // \r\n\r\n + private static final byte[] CRLF_LF = {CR, LF, LF}; // \r\n\n + private static final byte[] LF_CRLF = {LF, CR, LF}; // \n\r\n + private static final byte[] LF_LF = {LF, LF}; // \n\n + + @Override + public BoundaryInfo findBoundary(byte[] data, int limit) { + for (int i = 0; i < limit; i++) { + // Need at least 2 bytes for any boundary pattern + if (i + 1 >= limit) { + continue; + } + // Check longest patterns first to avoid partial matches + if (matchesPattern(data, i, limit, CRLF_CRLF)) { + return new BoundaryInfo(i, CRLF_CRLF.length); + } + if (matchesPattern(data, i, limit, CRLF_LF)) { + return new BoundaryInfo(i, CRLF_LF.length); + } + if (matchesPattern(data, i, limit, LF_CRLF)) { + return new BoundaryInfo(i, LF_CRLF.length); + } + if (matchesPattern(data, i, limit, LF_LF)) { + return new BoundaryInfo(i, LF_LF.length); + } + } + return new BoundaryInfo(-1, 0); + } + + @Override + public Optional processContent(String content) { + if (content.trim().isEmpty()) { + return Optional.empty(); + } + return Optional.of(parseMessage(content)); + } + + @Override + public String sanitizeContent(String rawContent, boolean isFirst) { + String sanitized = rawContent.replace("\r\n", "\n").replace("\r", "\n"); + if (isFirst && sanitized.startsWith(BYTE_ORDER_MARK)) { + sanitized = sanitized.substring(BYTE_ORDER_MARK.length()); + } + return sanitized; + } + + private EventStreamMessage parseMessage(String text) { + String[] lines = text.split("\n"); + Optional event = Optional.empty(); + Optional id = Optional.empty(); + Optional retryMs = Optional.empty(); + StringBuilder data = new StringBuilder(); + boolean firstData = true; + for (String line : lines) { + // Skip comment lines + if (line.startsWith(":")) { + continue; + } + Matcher m = LINE_PATTERN.matcher(line); + if (m.find()) { + String key = m.group(1).toLowerCase(); + String value = m.group(2); + switch (key) { + case "event": + event = Optional.of(value); + break; + case "id": + id = Optional.of(value); + break; + case "retry": + try { + retryMs = Optional.of(Integer.parseInt(value)); + } catch (NumberFormatException e) { + // ignore invalid retry values + } + break; + case "data": + if (!firstData) { + data.append(LINEFEED); + } + firstData = false; + data.append(value); + break; + // ignore unknown fields + } + } + } + return new EventStreamMessage(event, id, retryMs, data.toString()); + } + } + + // ===== Factory Methods ===== + + /** + * Create a streaming parser for JSON Lines format + */ + public static StreamingParser forJsonLines() { + return new StreamingParser<>(new JsonLContentProcessor()); + } + + /** + * Create a streaming parser for SSE format + */ + public static StreamingParser forSSE() { + return new StreamingParser<>(new SSEContentProcessor()); + } +} diff --git a/src/main/java/dev/plexapi/sdk/utils/Utils.java b/src/main/java/dev/plexapi/sdk/utils/Utils.java index 2884f96a..22902304 100644 --- a/src/main/java/dev/plexapi/sdk/utils/Utils.java +++ b/src/main/java/dev/plexapi/sdk/utils/Utils.java @@ -35,12 +35,14 @@ import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; +import java.lang.Iterable; 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.Objects; import java.util.Optional; import java.util.Random; import java.util.concurrent.Callable; @@ -50,6 +52,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; +import java.util.concurrent.CompletableFuture; import javax.net.ssl.SSLSession; @@ -66,6 +69,9 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; import com.fasterxml.jackson.databind.type.TypeFactory; +import dev.plexapi.sdk.models.errors.UncheckedSDKError; + + public final class Utils { private Utils() { @@ -80,7 +86,7 @@ public final class Utils { } public static String generateURL(String baseURL, String path) - throws IllegalArgumentException, IllegalAccessException { + throws IllegalArgumentException { if (baseURL != null && baseURL.endsWith("/")) { baseURL = baseURL.substring(0, baseURL.length() - 1); } @@ -89,7 +95,7 @@ public final class Utils { } public static String generateURL(Class type, String baseURL, String path, JsonNullable params, - Map>> globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { + Globals globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { if (params.isPresent() && params.get() != null) { return generateURL(type, baseURL, path, params.get(), globals); } else { @@ -98,7 +104,7 @@ public final class Utils { } public static String generateURL(Class type, String baseURL, String path, Optional params, - Map>> globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { + Globals globals) throws JsonProcessingException, IllegalArgumentException, IllegalAccessException { if (params.isPresent()) { return generateURL(type, baseURL, path, params.get(), globals); } else { @@ -107,7 +113,7 @@ public final class Utils { } public static String generateURL(Class type, String baseURL, String path, T params, - Map>> globals) + Globals globals) throws IllegalArgumentException, IllegalAccessException, JsonProcessingException { if (baseURL != null && baseURL.endsWith("/")) { baseURL = baseURL.substring(0, baseURL.length() - 1); @@ -173,6 +179,13 @@ public final class Utils { pathParams.put(pathParamsMetadata.name, pathEncode(valToString(value), pathParamsMetadata.allowReserved)); break; } + Optional openEnumValue = Reflections.getOpenEnumValue(value.getClass(), value); + if (openEnumValue.isPresent()) { + pathParams.put(pathParamsMetadata.name, pathEncode( + valToString(openEnumValue.get()), + pathParamsMetadata.allowReserved)); + break; + } List values = new ArrayList<>(); Field[] valueFields = value.getClass().getDeclaredFields(); @@ -207,7 +220,14 @@ public final class Utils { } } } - + // include all global params in pathParams if not already present + if (globals != null) { + globals.pathParamsAsStream() + .filter(entry -> !pathParams.containsKey(entry.getKey())) + .forEach(entry -> pathParams.put(entry.getKey(), // + pathEncode(entry.getValue(), false))); + } + return baseURL + templateUrl(path, pathParams); } @@ -265,7 +285,7 @@ public final class Utils { } public static List getQueryParams(Class type, Optional params, - Map>> globals) throws Exception { + Globals globals) throws Exception { if (params.isEmpty()) { return Collections.emptyList(); } else { @@ -274,7 +294,7 @@ public final class Utils { } public static List getQueryParams(Class type, JsonNullable params, - Map>> globals) throws Exception { + Globals globals) throws Exception { if (!params.isPresent() || params.get() == null) { return Collections.emptyList(); } else { @@ -283,7 +303,7 @@ public final class Utils { } public static List getQueryParams(Class type, T params, - Map>> globals) throws Exception { + Globals globals) throws Exception { return QueryParameters.parseQueryParams(type, params, globals); } @@ -316,12 +336,14 @@ public final class Utils { return sb.toString().replace(DOLLAR_MARKER, "$"); } - public static Map> getHeadersFromMetadata(Object headers, Map>> globals) throws Exception { - if (headers == null) { - return Collections.emptyMap(); - } - + public static Map> getHeadersFromMetadata(Object headers, Globals globals) throws Exception { Map> result = new HashMap<>(); + if (headers == null) { + // include all global headers in result if not already present + mergeGlobalHeaders(result, globals); + + return result; + } Field[] fields = headers.getClass().getDeclaredFields(); @@ -344,9 +366,14 @@ public final class Utils { case OBJECT: { if (!allowIntrospection(value.getClass())) { break; - } - List items = new ArrayList<>(); + } + Optional openEnumValue = Reflections.getOpenEnumValue(value.getClass(), value); + if (openEnumValue.isPresent()) { + upsertHeader(result, headerMetadata.name, openEnumValue.get()); + break; + } + List items = new ArrayList<>(); Field[] valueFields = value.getClass().getDeclaredFields(); for (Field valueField : valueFields) { valueField.setAccessible(true); @@ -431,20 +458,33 @@ public final class Utils { break; } default: { - if (!result.containsKey(headerMetadata.name)) { - result.put(headerMetadata.name, new ArrayList<>()); - } - - List values = result.get(headerMetadata.name); - values.add(valToString(value)); + upsertHeader(result, headerMetadata.name, value); break; } } } + // include all global headers in result if not already present + mergeGlobalHeaders(result, globals); + return result; } + private static void upsertHeader(Map> headers, String key, Object val) { + headers.computeIfAbsent(key, k -> new ArrayList<>()) + .add(valToString(val)); + } + + private static void mergeGlobalHeaders(Map> headers, Globals globals) { + if (globals == null) { + return; + } + globals.headerParamsAsStream() + .filter(entry -> !headers.containsKey(entry.getKey())) + .forEach(entry -> headers.put(entry.getKey(), + Collections.singletonList(entry.getValue()))); + } + public static String valToString(Object value) { if (value.getClass().isEnum()) { try { @@ -467,17 +507,10 @@ public final class Utils { } public static Object populateGlobal(Object value, String fieldName, String paramType, - Map>> globals) { - if (value == null && - globals != null && - globals.containsKey("parameters") && - globals.get("parameters").containsKey(paramType)) { - Object globalVal = globals.get("parameters").get(paramType).get(fieldName); - if (globalVal != null) { - value = globalVal; - } - } - + Globals globals) { + if (value == null && globals != null) { + return globals.getParam(paramType, fieldName).orElse(null); + } return value; } @@ -752,6 +785,10 @@ public final class Utils { } static Object resolveStringShape(Class type, String fieldName, Object value) throws IllegalAccessException { + if (value == null) { + return value; + } + try { // the presence of this TypeReference field indicates that the parameter // has a JsonShape of String and that we should convert BigInteger to @@ -770,7 +807,12 @@ public final class Utils { public static Stream stream(Callable> first, Function> next) { return StreamSupport.stream(iterable(first, next).spliterator(), false); } - + + public static Stream toStream(Iterable iterable) { + return StreamSupport.stream(iterable.spliterator(), false); + } + + // need a Function method that throws public interface Function { T apply(S value) throws Exception; @@ -815,26 +857,14 @@ public final class Utils { pending = false; } } catch (Exception e) { - rethrow(e); + Exceptions.rethrow(e); } } }; } }; } - - static T rethrow(Throwable e) { - if (e instanceof RuntimeException) { - throw (RuntimeException) e; - } else if (e instanceof Error) { - throw (Error) e; - } else if (e instanceof IOException) { - throw new UncheckedIOException((IOException) e); - } else { - throw new RuntimeException(e); - } - } - + public static boolean statusCodeMatches(int statusCode, String... expectedStatusCodes) { return Arrays.stream(expectedStatusCodes) .anyMatch(expected -> statusCodeMatchesOne(statusCode, expected)); @@ -1045,6 +1075,10 @@ public final class Utils { return readBytes(new File(filename)); } + public static String readString(String filename) { + return readString(new File(filename)); + } + public static byte[] readBytes(File file) { try { return readBytesAndClose(new FileInputStream(file)); @@ -1053,6 +1087,11 @@ public final class Utils { } } + public static String readString(File file) { + byte[] bytes = readBytes(file); + return new String(bytes, StandardCharsets.UTF_8); + } + public static byte[] readBytesAndClose(InputStream in) { try { return readBytes(in); @@ -1396,4 +1435,185 @@ public final class Utils { public static T valueOrNull(JsonNullable value) { return valueOrElse(value, null); } + + public static N castLong(long value, Class targetType) { + // Handle supported types safely + if (targetType == Integer.class) { + return targetType.cast((int) value); + } else if (targetType == Long.class) { + return targetType.cast(value); + } else if (targetType == Short.class) { + return targetType.cast((short) value); + } else if (targetType == BigInteger.class) { + return targetType.cast(BigInteger.valueOf(value)); + } else { + throw new IllegalArgumentException("Unsupported number type: " + targetType); + } + } + + public static Iterator transform(Iterator iterator, Function mapper) { + return new Iterator<>() { + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public O next() { + return Exceptions.unchecked(() -> mapper.apply(iterator.next())).get(); + } + }; + } + + /** + * Returns true if and only if the two objects are deeply equal, uses + * mathematical equivalence for Number subclasses ({@code 2 == 2.0}) instead of + * {@code Number.equals}. + * + *

+ * Should be paired with {@link #enhancedHashCode(Object)} to ensure the + * equals/hashCode contract. + * + * @param a the first object to compare + * @param b the second object to compare + * @return true if the objects are deeply equal bearing in mind mathematical + * equivalence, false otherwise + */ + public static boolean enhancedDeepEquals(Object a, Object b) { + if (a == null && b == null) { + return true; + } else if (a == null || b == null) { + return false; + } else if (a instanceof Optional && b instanceof Optional) { + return enhancedDeepEquals(((Optional) a).orElse(null), ((Optional) b).orElse(null)); + } else if (a instanceof JsonNullable && b instanceof JsonNullable) { + JsonNullable x = (JsonNullable) a; + JsonNullable y = (JsonNullable) b; + if (x.isPresent() && y.isPresent()) { + return enhancedDeepEquals(x.get(), y.get()); + } else { + return Objects.deepEquals(x, y); + } + } else if (a instanceof List && b instanceof List) { + List listA = (List) a; + List listB = (List) b; + if (listA.size() != listB.size()) { + return false; + } + for (int i = 0; i < listA.size(); i++) { + if (!enhancedDeepEquals(listA.get(i), listB.get(i))) { + return false; + } + } + return true; + } else if (a instanceof Map && b instanceof Map) { + // don't expect number keys, just Strings and enums + Map x = (Map) a; + Map y = (Map) b; + if (x.size() != y.size()) { + return false; + } + for (Entry entry : x.entrySet()) { + Object key = entry.getKey(); + Object value1 = entry.getValue(); + Object value2 = y.get(key); + if (!enhancedDeepEquals(value1, value2)) { + return false; + } + } + return true; + } else if (a instanceof Number && b instanceof Number) { + // compare values mathematically + BigDecimal x = toBigDecimal((Number) a); + BigDecimal y = toBigDecimal((Number) b); + return x.compareTo(y) == 0; + } else { + // we use deepEquals so that byte[] fields are compared appropriately + return Objects.deepEquals(a, b); + } + } + + /** + * Returns a combined hash code (applying {@link #enhancedHashCode}) for the + * given objects (usually the fields of an object whose hashCode we want to + * be calculated). + * + * @param objects + * @return combined hash code for the objects, 0 if the objects are null + */ + public static int enhancedHash(Object... objects) { + if (objects == null) { + return 0; + } + int result = 1; + for (Object o : objects) { + result = 31 * result + (o == null ? 0 :enhancedHashCode(o)); + } + return result; + } + + /** + * Returns a hash code that complies with the equals/hashCode contract when + * equals is implemented by {@link #enhancedDeepEquals(Object, Object)}. + * + * @param o object to calculate the hash code for (can be null) + * @return hash code for the object, 0 if the object is null + */ + public static int enhancedHashCode(Object o) { + if (o == null) { + return 0; + } else if (o instanceof Optional) { + Optional opt = (Optional) o; + return opt.map(Utils::enhancedHashCode).orElse(Optional.empty().hashCode()); + } else if (o instanceof JsonNullable) { + JsonNullable n = (JsonNullable) o; + return n.isPresent() ? Utils.enhancedHashCode(n.get()) : JsonNullable.undefined().hashCode(); + } else if (o instanceof List) { + return ((List) o).stream().mapToInt(Utils::enhancedHashCode).sum(); + } else if (o instanceof Map) { + // don't expect number keys, just Strings and enums + Map m = (Map) o; + return m.entrySet() // + .stream() // + .mapToInt(entry -> Objects.hashCode(entry.getKey()) + Utils.enhancedHashCode(entry.getValue())) // + .sum(); + } else if (o instanceof Number) { + return toBigDecimal((Number) o).stripTrailingZeros().hashCode(); + } else { + return o.hashCode(); + } + } + + private static BigDecimal toBigDecimal(Number number) { + if (number instanceof BigDecimal) { + return (BigDecimal) number; + } else if (number instanceof BigInteger) { + return new BigDecimal((BigInteger) number); + } else if (number instanceof Byte || number instanceof Short || + number instanceof Integer || number instanceof Long) { + return BigDecimal.valueOf(number.longValue()); + } else if (number instanceof Float || number instanceof Double) { + // Prevent precision issues for float/double + return BigDecimal.valueOf(number.doubleValue()); + } else { + // Fallback: treat as double + return BigDecimal.valueOf(number.doubleValue()); + } + } + + /** + * Creates a failed CompletableFuture with an async API exception. + * Uses the Blob to read the response body asynchronously. + */public static CompletableFuture createAsyncApiError( + HttpResponse response, + String reason) { + return response.body().toByteArray() + .thenApply(bodyBytes -> { + throw new UncheckedSDKError( + response, + response.statusCode(), + reason, + bodyBytes); + }); + } } diff --git a/src/main/java/dev/plexapi/sdk/utils/reactive/EventStream.java b/src/main/java/dev/plexapi/sdk/utils/reactive/EventStream.java new file mode 100644 index 00000000..1b8f32ca --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/reactive/EventStream.java @@ -0,0 +1,363 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils.reactive; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import dev.plexapi.sdk.utils.AsyncResponse; +import dev.plexapi.sdk.utils.Blob; +import dev.plexapi.sdk.utils.EventStreamMessage; +import dev.plexapi.sdk.utils.StreamingParser; +import dev.plexapi.sdk.utils.Utils; + +import java.net.http.HttpResponse; +import java.nio.ByteBuffer; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Flow; +import java.util.concurrent.atomic.AtomicLong; +import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; +import org.reactivestreams.Subscription; + +/** + * A reactive event stream publisher that can handle different protocols (SSE, JSONL) + * and emits typed events with proper backpressure handling. + * + * @param the AsyncResponse type that contains the event stream + * @param the type that events are deserialized into + */ +public class EventStream implements Publisher { + + /** + * Protocol interface that defines how to parse and process different event stream formats + */ + public interface Protocol { + /** + * Create a new parser instance for this protocol + */ + StreamingParser createParser(); + + /** + * Process a parsed item and convert it to the target type + * @param parsed the parsed item from the parser + * @param objectMapper the ObjectMapper for deserialization + * @param typeReference the target type reference + * @return the converted item, or null if this item should be skipped + * @throws Exception if conversion fails + */ + ItemT processItem(ParsedT parsed, ObjectMapper objectMapper, TypeReference typeReference) throws Exception; + + /** + * Check if processing should stop (e.g., terminal message encountered) + * @param parsed the parsed item + * @return true if processing should stop + */ + boolean shouldStop(ParsedT parsed); + } + + private final CompletableFuture asyncResponseFuture; + private final TypeReference typeReference; + private final ObjectMapper objectMapper; + private final Protocol protocol; + + private EventStream(CompletableFuture asyncResponseFuture, + TypeReference typeReference, + ObjectMapper objectMapper, + Protocol protocol) { + this.asyncResponseFuture = asyncResponseFuture; + this.typeReference = typeReference; + this.objectMapper = objectMapper; + this.protocol = protocol; + } + + /** + * Create an EventStream for SSE (Server-Sent Events) format + */ + public static EventStream forSSE( + CompletableFuture asyncResponseFuture, + TypeReference typeReference, + ObjectMapper objectMapper, + String terminalMessage) { + return new EventStream<>(asyncResponseFuture, typeReference, objectMapper, + new SSEProtocol<>(terminalMessage)); + } + + /** + * Create an EventStream for JSONL (JSON Lines) format + */ + public static EventStream forJsonL( + CompletableFuture asyncResponseFuture, + TypeReference typeReference, + ObjectMapper objectMapper) { + return new EventStream<>(asyncResponseFuture, typeReference, objectMapper, + new JsonLProtocol<>()); + } + + /** + * Returns the value of the Content-Type header. + **/ + public CompletableFuture contentType() { + return asyncResponseFuture.thenApply(AsyncResponse::contentType); + } + + /** + * Returns the HTTP status code. + **/ + public CompletableFuture statusCode() { + return asyncResponseFuture.thenApply(AsyncResponse::statusCode); + } + + /** + * Returns the raw HTTP response. + **/ + public CompletableFuture> rawResponse() { + return asyncResponseFuture.thenApply(AsyncResponse::rawResponse); + } + + /** + * Returns the AsyncResponse body. + **/ + public CompletableFuture body() { + return asyncResponseFuture; + } + + @Override + public void subscribe(Subscriber subscriber) { + if (subscriber == null) { + throw new NullPointerException("Subscriber cannot be null"); + } + + EventStreamSubscription subscription = new EventStreamSubscription( + rawResponse(), subscriber + ); + subscriber.onSubscribe(subscription); + } + + private class EventStreamSubscription implements Subscription { + private final Subscriber subscriber; + private final AtomicLong demand = new AtomicLong(0); + private final StreamingParser parser; + + private Flow.Subscription upstreamSubscription; + private volatile boolean cancelled = false; + private volatile boolean completed = false; + private volatile Throwable pendingError; + + @SuppressWarnings("unchecked") + public EventStreamSubscription(CompletableFuture> httpResponseFuture, + Subscriber subscriber) { + this.subscriber = subscriber; + this.parser = ((Protocol) protocol).createParser(); + + // Wait for the CompletableFuture and then subscribe to the Blob + httpResponseFuture.whenComplete((httpResponse, throwable) -> { + if (cancelled) { + return; + } + if (throwable != null) { + // Store the error to signal when demand is requested + pendingError = throwable; + return; + } + + // Extract Blob from HttpResponse and subscribe to it + Blob blob = httpResponse.body(); + // Blob.asPublisher() now returns Flow.Publisher directly + Flow.Publisher flowPublisher = blob.asPublisher(); + flowPublisher.subscribe(new Flow.Subscriber<>() { + @Override + public void onSubscribe(Flow.Subscription subscription) { + if (cancelled) { + subscription.cancel(); + return; + } + upstreamSubscription = subscription; + requestMoreIfNeeded(); + } + + @Override + public void onNext(ByteBuffer byteBuffer) { + if (cancelled || completed) { + return; + } + try { + processBuffer(byteBuffer); + if (!completed) { + requestMoreIfNeeded(); + } + } catch (Exception e) { + signalError(e); + } + } + + @Override + public void onError(Throwable throwable) { + signalError(throwable); + } + + @Override + public void onComplete() { + try { + processEndOfStream(); + signalComplete(); + } catch (Exception e) { + signalError(e); + } + } + }); + }); + } + + @Override + public void request(long n) { + if (n <= 0) { + signalError(new IllegalArgumentException("Request amount must be positive")); + return; + } + if (cancelled || completed) { + return; + } + demand.addAndGet(n); + requestMoreIfNeeded(); + } + + @Override + public void cancel() { + if (!cancelled) { + cancelled = true; + if (upstreamSubscription != null) { + upstreamSubscription.cancel(); + } + } + } + + private void processBuffer(ByteBuffer byteBuffer) { + // Use ByteBuffer directly without copying + Optional parsedOpt = parser.add(byteBuffer); + while (parsedOpt.isPresent()) { + if (!processItem(parsedOpt.get())) { + return; // Stop processing (terminal condition or error) + } + // Check for additional items in the buffer + parsedOpt = parser.next(); + } + } + + @SuppressWarnings("unchecked") + private boolean processItem(Object parsed) { + Protocol typedProtocol = (Protocol) protocol; + + // Check if processing should stop + if (typedProtocol.shouldStop(parsed)) { + signalComplete(); + return false; + } + + // Emit if there's demand + if (demand.get() > 0) { + try { + ItemT item = typedProtocol.processItem(parsed, objectMapper, typeReference); + if (item != null) { + demand.decrementAndGet(); + subscriber.onNext(item); + } + } catch (Exception e) { + signalError(e); + return false; // Signal to stop processing on error + } + } + return true; // Continue processing + } + + private void requestMoreIfNeeded() { + if (cancelled || completed) { + return; + } + + // Check for pending error first + if (pendingError != null && demand.get() > 0) { + signalError(pendingError); + return; + } + + if (upstreamSubscription != null && demand.get() > 0) { + upstreamSubscription.request(1); + } + } + + private void processEndOfStream() { + Optional parsedOpt = parser.finish(); + parsedOpt.ifPresent(this::processItem); + } + + private void signalError(Throwable t) { + if (!cancelled && !completed) { + completed = true; + subscriber.onError(t); + } + } + + private void signalComplete() { + if (!cancelled && !completed) { + completed = true; + subscriber.onComplete(); + } + } + } + + /** + * SSE Protocol implementation + */ + private static class SSEProtocol implements Protocol { + private final String terminalMessage; + + public SSEProtocol(String terminalMessage) { + this.terminalMessage = terminalMessage; + } + + @Override + public StreamingParser createParser() { + return StreamingParser.forSSE(); + } + + @Override + public ItemT processItem(EventStreamMessage message, ObjectMapper objectMapper, TypeReference typeReference) { + // Skip empty data messages + if (message.data().isEmpty()) { + return null; + } + return Utils.asType(message, objectMapper, typeReference); + } + + @Override + public boolean shouldStop(EventStreamMessage message) { + // Check if this is a terminal message + return terminalMessage != null && terminalMessage.equals(message.data()); + } + } + + /** + * JSONL Protocol implementation + */ + private static class JsonLProtocol implements Protocol { + + @Override + public StreamingParser createParser() { + return StreamingParser.forJsonLines(); + } + + @Override + public ItemT processItem(String jsonLine, ObjectMapper objectMapper, TypeReference typeReference) throws Exception { + return objectMapper.readValue(jsonLine, typeReference); + } + + @Override + public boolean shouldStop(String jsonLine) { + // JSONL doesn't have terminal messages + return false; + } + } + +} \ No newline at end of file diff --git a/src/main/java/dev/plexapi/sdk/utils/reactive/ReactiveUtils.java b/src/main/java/dev/plexapi/sdk/utils/reactive/ReactiveUtils.java new file mode 100644 index 00000000..29345284 --- /dev/null +++ b/src/main/java/dev/plexapi/sdk/utils/reactive/ReactiveUtils.java @@ -0,0 +1,512 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package dev.plexapi.sdk.utils.reactive; + +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Flow; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Function; + +// Internal API only + +/** + * Utility class for reactive stream operations. + */ +public final class ReactiveUtils { + + private ReactiveUtils() { + // Utility class + } + + /** + * Maps elements from a Flow.Publisher using an asynchronous transformation function. + * This is useful for transforming HttpResponse elements using operations + * that return CompletableFuture results. + * + * @param the input element type + * @param the output element type + * @param source the source publisher + * @param mapper the async transformation function (e.g., AsyncOperation::handleResponse) + * @return a new publisher that emits the mapped elements + */ + public static Flow.Publisher mapAsync( + Flow.Publisher source, + Function> mapper) { + + Objects.requireNonNull(source, "Source publisher cannot be null"); + Objects.requireNonNull(mapper, "Mapper function cannot be null"); + + return new AsyncMappingPublisher<>(source, mapper); + } + + /** + * Maps elements from a Flow.Publisher using a synchronous transformation function. + * + * @param the input element type + * @param the output element type + * @param source the source publisher + * @param mapper the transformation function + * @return a new publisher that emits the mapped elements + */ + public static Flow.Publisher map( + Flow.Publisher source, + Function mapper) { + + Objects.requireNonNull(source, "Source publisher cannot be null"); + Objects.requireNonNull(mapper, "Mapper function cannot be null"); + + return new SyncMappingPublisher<>(source, mapper); + } + + /** + * Flattens a stream of collections into a stream of individual items. + * + * @param the input collection type + * @param the output element type + * @param source the source publisher emitting collections + * @param flattener the function to extract items from each collection + * @return a new publisher that emits individual items from the collections + */ + public static Flow.Publisher flatten( + Flow.Publisher source, + Function> flattener) { + + Objects.requireNonNull(source, "Source publisher cannot be null"); + Objects.requireNonNull(flattener, "Flattener function cannot be null"); + + return new FlatteningPublisher<>(source, flattener); + } + + /** + * Flattens a stream of {@code List} into a stream of individual {@code T} items. + * + * @param the type of elements to emit downstream + * @param source the source publisher emitting lists + * @return a new publisher that emits individual items from the lists + */ + public static Flow.Publisher flatten(Flow.Publisher> source) { + return flatten(source, list -> list); + } + + /** + * Wraps a {@code Flow.Publisher} into a {@code Flow.Publisher>}. + * + * @param source the source publisher + * @param the type of elements to emit downstream + * @return a new publisher that emits lists of items from the source publisher + */ + public static Flow.Publisher> wrapped(Flow.Publisher source) { + return new SyncMappingPublisher<>(source, List::of); + } + + /** + * Concatenates multiple publishers into a single publisher. + * + * @param pubs the publishers to concatenate + * @param the type of elements to emit downstream + * @return a new publisher that concatenates the given publishers + */ + public static Flow.Publisher concat(List> pubs) { + return new ConcatPublisher<>(pubs); + } + + /** + * Internal implementation of async mapping publisher. + */ + private static class AsyncMappingPublisher implements Flow.Publisher { + private final Flow.Publisher source; + private final Function> mapper; + + public AsyncMappingPublisher(Flow.Publisher source, Function> mapper) { + this.source = source; + this.mapper = mapper; + } + + @Override + public void subscribe(Flow.Subscriber subscriber) { + source.subscribe(new AsyncMappingSubscriber<>(subscriber, mapper)); + } + } + + /** + * Internal implementation of sync mapping publisher. + */ + private static class SyncMappingPublisher implements Flow.Publisher { + private final Flow.Publisher source; + private final Function mapper; + + public SyncMappingPublisher(Flow.Publisher source, Function mapper) { + this.source = source; + this.mapper = mapper; + } + + @Override + public void subscribe(Flow.Subscriber subscriber) { + source.subscribe(new SyncMappingSubscriber<>(subscriber, mapper)); + } + } + + /** + * Internal implementation of flattening publisher. + */ + private static class FlatteningPublisher implements Flow.Publisher { + private final Flow.Publisher source; + private final Function> flattener; + + public FlatteningPublisher(Flow.Publisher source, Function> flattener) { + this.source = source; + this.flattener = flattener; + } + + @Override + public void subscribe(Flow.Subscriber subscriber) { + source.subscribe(new FlatteningSubscriber<>(subscriber, flattener)); + } + } + + /** + * Internal implementation of concatenating publisher. + */ + private static final class ConcatPublisher implements Flow.Publisher { + private final List> pubs; + + ConcatPublisher(List> pubs) { + this.pubs = List.copyOf(pubs); + } + + @SuppressWarnings("unchecked") + @Override + public void subscribe(Flow.Subscriber downstream) { + downstream.onSubscribe(new ConcatSubscription<>((Flow.Subscriber) downstream, pubs.iterator())); + } + + } + + /** + * Subscriber that handles async mapping transformations. + */ + private static class AsyncMappingSubscriber implements Flow.Subscriber { + private final Flow.Subscriber downstream; + private final Function> mapper; + private final AtomicBoolean cancelled = new AtomicBoolean(false); + private final AtomicLong pendingDemand = new AtomicLong(0); + private final AtomicLong pendingCompletes = new AtomicLong(0); + private Flow.Subscription upstream; + private volatile boolean upstreamCompleted = false; + + public AsyncMappingSubscriber(Flow.Subscriber downstream, Function> mapper) { + this.downstream = downstream; + this.mapper = mapper; + } + + @Override + public void onSubscribe(Flow.Subscription subscription) { + this.upstream = subscription; + downstream.onSubscribe(new Flow.Subscription() { + @Override + public void request(long n) { + if (n <= 0) { + downstream.onError(new IllegalArgumentException("Request count must be positive")); + return; + } + + long currentDemand = pendingDemand.addAndGet(n); + if (currentDemand < 0) { + pendingDemand.set(Long.MAX_VALUE); + } + + upstream.request(n); + } + + @Override + public void cancel() { + cancelled.set(true); + upstream.cancel(); + } + }); + } + + @Override + public void onNext(T item) { + if (cancelled.get()) return; + + try { + pendingCompletes.incrementAndGet(); + CompletableFuture future = mapper.apply(item); + future.whenComplete((result, error) -> { + if (cancelled.get()) { + return; + } + + if (error != null) { + cancelled.set(true); + downstream.onError(error); + } else if (pendingDemand.get() > 0) { + pendingDemand.decrementAndGet(); + downstream.onNext(result); + } + + // Check if we should complete after this async operation + if (pendingCompletes.decrementAndGet() == 0 && upstreamCompleted) { + downstream.onComplete(); + } + }); + } catch (Exception e) { + if (!cancelled.get()) { + cancelled.set(true); + downstream.onError(e); + } + } + } + + @Override + public void onError(Throwable throwable) { + if (!cancelled.get()) { + downstream.onError(throwable); + } + } + + @Override + public void onComplete() { + upstreamCompleted = true; + if (!cancelled.get() && pendingCompletes.get() == 0) { + downstream.onComplete(); + } + } + } + + /** + * Subscriber that handles sync mapping transformations. + */ + private static class SyncMappingSubscriber implements Flow.Subscriber { + private final Flow.Subscriber downstream; + private final Function mapper; + private Flow.Subscription upstream; + private volatile boolean cancelled = false; + + public SyncMappingSubscriber(Flow.Subscriber downstream, Function mapper) { + this.downstream = downstream; + this.mapper = mapper; + } + + @Override + public void onSubscribe(Flow.Subscription subscription) { + this.upstream = subscription; + downstream.onSubscribe(new Flow.Subscription() { + @Override + public void request(long n) { + if (!cancelled) { + upstream.request(n); + } + } + + @Override + public void cancel() { + cancelled = true; + upstream.cancel(); + } + }); + } + + @Override + public void onNext(T item) { + if (cancelled) return; + + try { + R result = mapper.apply(item); + downstream.onNext(result); + } catch (Exception e) { + cancelled = true; + upstream.cancel(); + downstream.onError(e); + } + } + + @Override + public void onError(Throwable throwable) { + if (!cancelled) { + downstream.onError(throwable); + } + } + + @Override + public void onComplete() { + if (!cancelled) { + downstream.onComplete(); + } + } + } + + /** + * Subscriber that handles flattening transformations. + */ + private static class FlatteningSubscriber implements Flow.Subscriber { + private final Flow.Subscriber downstream; + private final Function> flattener; + private Flow.Subscription upstreamSubscription; + private volatile boolean cancelled = false; + + public FlatteningSubscriber(Flow.Subscriber downstream, Function> flattener) { + this.downstream = Objects.requireNonNull(downstream, "Downstream subscriber cannot be null"); + this.flattener = flattener; + } + + @Override + public void onSubscribe(Flow.Subscription subscription) { + this.upstreamSubscription = Objects.requireNonNull(subscription, "Upstream subscription cannot be null"); + downstream.onSubscribe(new Flow.Subscription() { + @Override + public void request(long n) { + if (n <= 0) { + downstream.onError(new IllegalArgumentException("Demand must be positive: " + n)); + return; + } + + if (!cancelled && upstreamSubscription != null) { + upstreamSubscription.request(n); + } + } + + @Override + public void cancel() { + cancelled = true; + if (upstreamSubscription != null) { + upstreamSubscription.cancel(); + } + } + }); + } + + @Override + public void onNext(T item) { + if (cancelled) { + return; + } + + try { + Iterable items = flattener.apply(item); + for (R flattenedItem : items) { + if (cancelled) { + break; + } + downstream.onNext(flattenedItem); + } + } catch (Exception e) { + if (!cancelled) { + cancelled = true; + upstreamSubscription.cancel(); + downstream.onError(e); + } + } + } + + @Override + public void onError(Throwable throwable) { + if (!cancelled) { + downstream.onError(throwable); + } + } + + @Override + public void onComplete() { + if (!cancelled) { + downstream.onComplete(); + } + } + } + + /** + * Subscriber that handles concatenating publishers. + */ + private static final class ConcatSubscription implements Flow.Subscription { + private final Flow.Subscriber downstream; + private final Iterator> it; + + private Flow.Subscription upstream; + private long demand = 0L; + private boolean cancelled = false; + private boolean completed = false; + + public ConcatSubscription(Flow.Subscriber downstream, + Iterator> it) { + this.downstream = downstream; + this.it = it; + } + + + @Override + public synchronized void request(long n) { + if (cancelled || completed || n <= 0) return; + demand = addCap(demand, n); + if (upstream == null) { + subscribeNext(); + } else { + upstream.request(n); + } + } + + @Override + public synchronized void cancel() { + cancelled = true; + if (upstream != null) upstream.cancel(); + } + + private void subscribeNext() { + if (cancelled) return; + if (!it.hasNext()) { + completed = true; + downstream.onComplete(); + return; + } + Flow.Publisher next = it.next(); + next.subscribe(new Upstream()); + } + + private final class Upstream implements Flow.Subscriber { + @Override + public void onSubscribe(Flow.Subscription s) { + synchronized (ConcatSubscription.this) { + upstream = s; + if (demand > 0) s.request(demand); + } + } + + @Override + public void onNext(T item) { + long afterDecrement; + synchronized (ConcatSubscription.this) { + if (demand == 0) return; // should not happen if upstream respects RS + demand--; + afterDecrement = demand; + } + downstream.onNext(item); + // no need to request here; downstream will call request() again if needed + } + + @Override + public void onError(Throwable t) { + downstream.onError(t); + } + + @Override + public void onComplete() { + synchronized (ConcatSubscription.this) { + upstream = null; + if (cancelled) return; + } + // carry over remaining demand to next publisher + subscribeNext(); + } + } + + private static long addCap(long a, long b) { + long r = a + b; + return (r < 0L) ? Long.MAX_VALUE : r; + } + } +}